{"id":13564557,"url":"https://github.com/csstools/postcss-normalize","last_synced_at":"2025-05-13T19:17:30.036Z","repository":{"id":34590942,"uuid":"38538164","full_name":"csstools/postcss-normalize","owner":"csstools","description":"Use the parts of normalize.css (or sanitize.css) you need from your browserslist","archived":false,"fork":false,"pushed_at":"2024-12-28T18:57:27.000Z","size":225,"stargazers_count":829,"open_issues_count":3,"forks_count":40,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-05-12T12:56:07.765Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/csstools.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-07-04T15:22:31.000Z","updated_at":"2025-05-09T09:10:58.000Z","dependencies_parsed_at":"2025-01-09T11:00:52.533Z","dependency_job_id":"e5ff68a3-527b-4fbc-91e2-c6edba2e0c4f","html_url":"https://github.com/csstools/postcss-normalize","commit_stats":{"total_commits":45,"total_committers":9,"mean_commits":5.0,"dds":0.3555555555555555,"last_synced_commit":"0ef7c4d8634a3e647e90a4ee08557724b8f5b9e7"},"previous_names":["jonathantneal/postcss-normalize"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-normalize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-normalize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-normalize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-normalize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csstools","download_url":"https://codeload.github.com/csstools/postcss-normalize/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253766364,"owners_count":21960897,"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":[],"created_at":"2024-08-01T13:01:32.920Z","updated_at":"2025-05-13T19:17:29.964Z","avatar_url":"https://github.com/csstools.png","language":"CSS","funding_links":[],"categories":["CSS"],"sub_categories":[],"readme":"# PostCSS Normalize [\u003cimg src=\"https://postcss.github.io/postcss/logo.svg\" alt=\"PostCSS\" width=\"90\" height=\"90\" align=\"right\"\u003e][postcss]\n\n[\u003cimg alt=\"npm version\" src=\"https://img.shields.io/npm/v/postcss-normalize.svg\" height=\"20\"\u003e][npm-url]\n[\u003cimg alt=\"build status\" src=\"https://img.shields.io/travis/csstools/postcss-normalize/main.svg\" height=\"20\"\u003e][cli-url]\n[\u003cimg alt=\"support chat\" src=\"https://img.shields.io/badge/support-chat-blue.svg\" height=\"20\"\u003e][git-url]\n\n[PostCSS Normalize] lets you use the parts of [normalize.css] or [sanitize.css]\nthat you need from your [browserslist].\n\n```css\n@import \"normalize.css\";\n```\n\n```css\n@import \"sanitize.css\";\n```\n\n**PostCSS Normalize** uses a non-opinionated version of [normalize.css], but\nan opinionated version may also be used.\n\n```css\n@import \"normalize.css/opinionated.css\";\n```\n\n### Examples\n\nHere is a sample of what **normalize.css** looks like when the **browserslist**\nis `ie \u003e= 9`:\n\n```css\n/**\n * Add the correct display in IE 9-.\n */\n\naudio,\nvideo {\n  display: inline-block;\n}\n\n/**\n * Remove the border on images inside links in IE 10-.\n */\n\nimg {\n  border-style: none;\n}\n```\n\nAnd here is the same sample when the **browserslist** is `ie \u003e= 10`:\n\n```css\n/**\n * Remove the border on images inside links in IE 10-.\n */\n\nimg {\n  border-style: none;\n}\n```\n\n## Usage\n\nAdd [PostCSS Normalize] to your project:\n\n```bash\nnpm install postcss-normalize --save-dev\n```\n\nAdd a [browserslist] entry in `package.json`:\n\n```json\n{\n  \"browserslist\": \"last 2 versions\"\n}\n```\n\nUse **PostCSS Normalize** to process your CSS:\n\n```js\nconst postcssNormalize = require('postcss-normalize')\n\npostcssNormalize.process(YOUR_CSS /*, processOptions, pluginOptions */)\n```\n\nOr use it as a [PostCSS] plugin:\n\n```js\nconst postcss = require('postcss')\nconst postcssNormalize = require('postcss-normalize')\n\npostcss([\n  postcssNormalize(/* pluginOptions */)\n]).process(YOUR_CSS /*, processOptions */)\n```\n\n**PostCSS Normalize** runs in all Node environments, with special instructions\nfor:\n\n| [Node](INSTALL.md#node) | [PostCSS CLI](INSTALL.md#postcss-cli) | [Webpack](INSTALL.md#webpack) | [Create React App](INSTALL.md#create-react-app) | [Gulp](INSTALL.md#gulp) | [Grunt](INSTALL.md#grunt) |\n| --- | --- | --- | --- | --- | --- |\n\n## PostCSS Import Usage\n\n**PostCSS Normalize** includes a `postcssImport` function to configure\n[PostCSS Import] and allow you to continue using the `@import` syntax.\n\n```js\nconst postcss = require('postcss')\nconst postcssImport = require('postcss-import')\nconst postcssNormalize = require('postcss-normalize')\n\npostcss([\n  postcssImport(\n    postcssNormalize(\n      /* pluginOptions (for PostCSS Normalize) */\n    ).postcssImport(\n      /* pluginOptions (for PostCSS Import) */\n    )\n  )\n]) // now you can use @import \"normalize.css\", etc. again\n```\n\nAlternatively, use `@import-normalize` or `@import-sanitize` to avoid conflicts\nwith `@import` transforms.\n\n```pcss\n@import-normalize;\n```\n\n```pcss\n@import-normalize \"normalize/opinionated.css\";\n```\n\n```pcss\n@import-sanitize;\n```\n\n## Options\n\n### allowDuplicates\n\nThe `allowDuplicates` option determines whether multiple, duplicate insertions\nof CSS libraries are allowed. By default, duplicate libraries are omitted.\n\n```js\npostcssNormalize({ allowDuplicates: true })\n```\n\n### forceImport\n\nThe `forceImport` option defines CSS libraries that will be inserted at the\nbeginning of the CSS file. Unless overriden by `allowDuplicates`, duplicate\nCSS libraries would still be omitted.\n\n```js\npostcssNormalize({ forceImport: true })\n```\n\nSpecific CSS libraries may be defined.\n\n```js\npostcssNormalize({\n  forceImport: 'sanitize.css'\n})\n```\n\n### browsers\n\nThe `browsers` option defines an override of the project’s **browserslist** for\n**PostCSS Normalize**. This option should be avoided in leui of a browserslist\nfile.\n\n```js\npostcssNormalize({ browsers: 'last 2 versions' })\n```\n\n## CSS Libraries\n\n**PostCSS Normalize** can include [normalize.css] or [sanitize.css] and\nconfigure either with the following combinations:\n\n```css\n@import \"normalize\"; /* also, @import \"normalize.css\" */\n@import \"normalize/opinionated\"; /* also, @import \"normalize.css/opinionated.css\", @import \"normalize.css/*\" */\n@import \"sanitize\"; /* also, @import \"sanitize.css\" */\n@import \"sanitize/assets\"; /* also, @import \"sanitize.css/assets.css\" */\n@import \"sanitize/forms\"; /* also, @import \"sanitize.css/forms.css\" */\n@import \"sanitize/reduce-motion\"; /* also, @import \"sanitize.css/reduce-motion.css\" */\n@import \"sanitize/system-ui\"; /* also, @import \"sanitize.css/system-ui.css\" */\n@import \"sanitize/typography\"; /* also, @import \"sanitize.css/typography.css\" */\n@import \"sanitize/ui-monospace\"; /* also, @import \"sanitize.css/ui-monospace.css\" */\n@import \"sanitize/*\"; /* also, @import \"sanitize.css/*\" (sanitize + all additions) */\n```\n\n[cli-img]: https://img.shields.io/travis/csstools/postcss-normalize/main.svg\n[cli-url]: https://travis-ci.org/csstools/postcss-normalize\n[git-img]: https://img.shields.io/badge/support-chat-blue.svg\n[git-url]: https://gitter.im/postcss/postcss\n[npm-img]: https://img.shields.io/npm/v/postcss-normalize.svg\n[npm-url]: https://www.npmjs.com/package/postcss-normalize\n\n[browserslist]: http://browserl.ist/\n[CSS Libraries]: #css-libraries\n[normalize.css]: https://github.com/csstools/normalize.css\n[Options]: #options\n[PostCSS]: https://github.com/postcss/postcss\n[PostCSS Import]: https://github.com/postcss/postcss-import\n[PostCSS Import Usage]: #postcss-import-usage\n[PostCSS Normalize]: https://github.com/csstools/postcss-normalize\n[sanitize.css]: https://github.com/csstools/sanitize.css\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fpostcss-normalize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsstools%2Fpostcss-normalize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fpostcss-normalize/lists"}