{"id":18563616,"url":"https://github.com/younth/fis-postprocessor-px2rem","last_synced_at":"2026-03-16T11:35:17.001Z","repository":{"id":57237091,"uuid":"50714528","full_name":"younth/fis-postprocessor-px2rem","owner":"younth","description":"fis3 plugins for px2rem when we use rem for mobile flexbox","archived":false,"fork":false,"pushed_at":"2016-09-03T08:56:37.000Z","size":11,"stargazers_count":24,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-16T09:05:31.286Z","etag":null,"topics":["fis3","flex","px2rem"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/younth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-30T07:31:16.000Z","updated_at":"2023-10-24T22:44:01.000Z","dependencies_parsed_at":"2022-08-26T15:10:16.989Z","dependency_job_id":null,"html_url":"https://github.com/younth/fis-postprocessor-px2rem","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/younth%2Ffis-postprocessor-px2rem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/younth%2Ffis-postprocessor-px2rem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/younth%2Ffis-postprocessor-px2rem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/younth%2Ffis-postprocessor-px2rem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/younth","download_url":"https://codeload.github.com/younth/fis-postprocessor-px2rem/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223153878,"owners_count":17096633,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fis3","flex","px2rem"],"created_at":"2024-11-06T22:13:02.859Z","updated_at":"2026-03-16T11:35:16.927Z","avatar_url":"https://github.com/younth.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fis-postprocessor-px2rem\n\nfis3/fis `px` 自动转为 `rem` 插件，提高源码可维护性\n\n## 安装\n\n* npm i -g fis-postprocessor-px2rem  \n* 修改 fis-conf.js  \n    ```\n    fis.match('*less', {\n        postprocessor: fis.plugin('px2rem', {\n            remUnit: 75\n        })\n    });\n    ```\n\n## 用法\n\n* 该插件要配合基于rem的flex布局方案使用，推荐大家用手淘的`lib-flexible`\n* 通过增加注释判断转换类型，主要有：\n    1. 默认所有的px都会转为rem\n    2. `/*no*/` 不转换，常用于 1px的处理\n    2. `/*px*/` 强制使用px，即不适配，各个分辨率看到的大小一样，字体通常会用到。\n\n\n## 参数\n\n```\n    {\n        baseDpr: 2,             // dpr基准\n        remUnit: 75,            // rem 基准，由设计稿决定\n        remPrecision: 6         // rem 精确位数\n    }\n```\n\n## Example\n\n#### Pre processing:\n\nOne raw stylesheet: `test.css`\n\n```\n.selector {\n    width: 150px;\n    height: 64px; /*px*/\n    font-size: 28px; /*px*/\n    border: 1px solid #ddd; /*no*/\n}\n```\n\n#### After processing:\n\nRem version: `test.css`\n\n```\n.selector {\n    width: 2rem;\n    border: 1px solid #ddd;\n}\n[data-dpr=\"1\"] .selector {\n    height: 32px;\n    font-size: 14px;\n}\n[data-dpr=\"2\"] .selector {\n    height: 64px;\n    font-size: 28px;\n}\n[data-dpr=\"3\"] .selector {\n    height: 96px;\n    font-size: 42px;\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyounth%2Ffis-postprocessor-px2rem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyounth%2Ffis-postprocessor-px2rem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyounth%2Ffis-postprocessor-px2rem/lists"}