{"id":15280552,"url":"https://github.com/saionaro/postcss-transform-pxvw","last_synced_at":"2026-01-05T13:05:47.373Z","repository":{"id":57328605,"uuid":"212624875","full_name":"saionaro/postcss-transform-pxvw","owner":"saionaro","description":"The postcss plugin which allows using pixels for responsive layouts","archived":false,"fork":false,"pushed_at":"2019-10-07T10:37:58.000Z","size":115,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T12:14:55.968Z","etag":null,"topics":["css","postcss","postcss-plugin","responsive"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saionaro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-03T16:20:24.000Z","updated_at":"2019-10-11T10:17:55.000Z","dependencies_parsed_at":"2022-09-05T19:40:50.782Z","dependency_job_id":null,"html_url":"https://github.com/saionaro/postcss-transform-pxvw","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saionaro%2Fpostcss-transform-pxvw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saionaro%2Fpostcss-transform-pxvw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saionaro%2Fpostcss-transform-pxvw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saionaro%2Fpostcss-transform-pxvw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saionaro","download_url":"https://codeload.github.com/saionaro/postcss-transform-pxvw/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245065532,"owners_count":20555309,"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":["css","postcss","postcss-plugin","responsive"],"created_at":"2024-09-30T12:11:16.542Z","updated_at":"2026-01-05T13:05:47.289Z","avatar_url":"https://github.com/saionaro.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# postcss-transform-pxvw [![Actions Status](https://github.com/Saionaro/postcss-transform-pxvw/workflows/CI/badge.svg)](https://github.com/Saionaro/postcss-transform-pxvw/actions) [![npm version](https://badge.fury.io/js/postcss-transform-pxvw.svg)](https://badge.fury.io/js/postcss-transform-pxvw)\n\nThe plugin allows you use exact pixels from a design markup and get in result a responsive layout. It's very helpful for pixel perfect.\n\nThere is new `pxvw(val: number, pageWidth?: number)` function. See example below:\n\n## Example\n\nCSS in your source:\n\n```css\n.selector {\n  /* It means \"At 1024 page width it should be exact 150 pixels\" */\n  width: pxvw(150, 1024);\n  /* It means \"At 1024 page width:\n      margin-top: 100px;\n      margin-bottom: 150px;\n      margin-left: 249px;\n      And on any width:\n      margin-right: 21px\"\n   */\n  margin: pxvw(100, 1024) 21px pxvw(150, 1024) pxvw(249, 1024);\n}\n```\n\nCSS after transform:\n\n```css\n.selector {\n  width: 14.6484vw;\n  margin: 9.7656vw 21px 14.6484vw 24.3164vw;\n}\n```\n\nIt also works with `less` and `sass`. Includes its variables.\n\nSee more examples at [tests] cases.\n\n## Installation\n\n### Download package\n\nFor NPM users:\n\n`npm i postcss-transform-pxvw --save-dev`\n\nor if you using Yarn:\n\n`yarn add postcss-transform-pxvw -D`\n\n### Add to your toolchain\n\n```js\npostcss([\n  require(\"postcss-transform-pxvw\")({\n    // ...options here\n  })\n]);\n```\n\nSee [PostCSS] docs for examples for your environment.\n\n## Options\n\n| Name               | Type     | Default value | Description                                                                                   |\n| ------------------ | -------- | ------------- | --------------------------------------------------------------------------------------------- |\n| `defaultPageWidth` | `number` | 1200          | The page width which will be used for calculations when second `pxvw()` argument not provided |\n| `digitsCount`      | `number` | 3             | The digits number which stay after decimal dot in vw value                                    |\n\n[postcss]: https://github.com/postcss/postcss\n[tests]: https://github.com/Saionaro/postcss-transform-pxvw/tree/master/tests\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaionaro%2Fpostcss-transform-pxvw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaionaro%2Fpostcss-transform-pxvw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaionaro%2Fpostcss-transform-pxvw/lists"}