{"id":14968115,"url":"https://github.com/postcss/postcss-use","last_synced_at":"2025-04-05T21:07:04.188Z","repository":{"id":57328664,"uuid":"37867567","full_name":"postcss/postcss-use","owner":"postcss","description":"Enable PostCSS plugins directly in your stylesheet.","archived":false,"fork":false,"pushed_at":"2022-07-30T22:28:03.000Z","size":107,"stargazers_count":152,"open_issues_count":5,"forks_count":16,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-10-29T13:45:55.346Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/postcss.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-22T16:45:23.000Z","updated_at":"2024-08-02T02:19:53.000Z","dependencies_parsed_at":"2022-09-12T09:50:20.464Z","dependency_job_id":null,"html_url":"https://github.com/postcss/postcss-use","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postcss%2Fpostcss-use","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postcss%2Fpostcss-use/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postcss%2Fpostcss-use/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postcss%2Fpostcss-use/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/postcss","download_url":"https://codeload.github.com/postcss/postcss-use/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247399874,"owners_count":20932876,"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-09-24T13:39:19.272Z","updated_at":"2025-04-05T21:07:04.169Z","avatar_url":"https://github.com/postcss.png","language":"JavaScript","readme":"# [postcss][postcss]-use [![Build Status](https://travis-ci.org/postcss/postcss-use.svg?branch=master)][ci]\n\n\u003e Enable PostCSS plugins directly in your stylesheet.\n\n```css\n@use postcss-preset-env(stage: 0, browsers: \"last 2 versions\");\n\nh1 {\n  \u0026 a {\n    color: red\n  }\n}\n```\n\n## Install\n\nWith [npm](https://npmjs.org/package/postcss-use) do:\n\n```\nnpm install postcss-use --save\n```\n\n## Example\n\nOptions may be passed into plugins as a JSON object, an array, a hash map, or\nas declarations. Hash maps will follow the format of\n`option: value, option2: value2`.\n\n### Input\n\n#### Standard syntax\n\nWith [postcss-discard-comments]:\n\n```css\n@use postcss-discard-comments(removeAll: true);\n/*! test */\nh1 {\n    color: red\n}\n```\n\n#### Alternative syntax\n\nYou may also use configuration blocks that are more *CSS-like*. Note that root\narray options cannot be parsed by this method.\n\n```css\n@use postcss-discard-comments {\n    removeAll: true\n}\n```\n\n### Output\n\n```css\nh1 {\n    color: red\n}\n```\n\n## API\n\n### use(options)\n\n#### options\n\n##### modules\n\nType: `array|string`\n*Required option*.\n\nThe `modules` option specifies a list of allowable PostCSS Plugins, expressed\nas a `String`, `Array`, or `RegExp`. By default, all plugins are disabled in\norder to prevent malicious usage in browser environments.\n\n```js\nuse({\n  // allow plugins starting with autoprefixer, postcss, precss, and cssnano\n  modules: [\n    /^autoprefixer/,\n    /^postcss/,\n    /^precss/,\n    /^cssnano/\n  ]\n})\n```\n\n```js\nuse({\n  // allow autoprefixer, postcss-preset-env, and postcss-flexbugs-fixes\n  modules: [ 'autoprefixer', 'postcss-preset-env', 'postcss-flexbugs-fixes' ]\n})\n```\n\nSetting the option to `\"*\"` will allow PostCSS Use to require any plugins. This\nis not recommended for environments where you may be accepting arbitrary user\ninput; use at your own risk.\n\n##### resolveFromFile\n\nType: `boolean` (default: `false`)\n\nThe `resolveFromFile` option specifies whether plugins should be resolved\nrelative to the file that referenced them. This may be used to enable the usage\nof different versions of the same plugin. By default, it is disabled.\n\n```js\nuse({\n  resolveFromFile: true\n})\n```\n\n##### options\n\nType: `object` (default: `{}`)\n\nThe `options` option specifies individual options for specific plugins by\nplugin name.\n\n```js\nuse({\n  options: {\n    'postcss-preset-env': {\n      stage: 0,\n      browsers: 'last two versions'\n    }\n  }\n})\n```\n\n## Usage\n\nSee the [PostCSS documentation](https://github.com/postcss/postcss#usage) for\nexamples for your environment.\n\n## Contributors\n\nThanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n| [\u003cimg src=\"https://avatars.githubusercontent.com/u/1282980?v=3\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003eBen Briggs\u003c/sub\u003e](http://beneb.info)\u003cbr /\u003e[💻](https://github.com/postcss/postcss-use/commits?author=ben-eb) [📖](https://github.com/postcss/postcss-use/commits?author=ben-eb) 👀 [⚠️](https://github.com/postcss/postcss-use/commits?author=ben-eb) | [\u003cimg src=\"https://avatars.githubusercontent.com/u/188426?v=3\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003eJonathan Neal\u003c/sub\u003e](//jonathantneal.com)\u003cbr /\u003e[💻](https://github.com/postcss/postcss-use/commits?author=jonathantneal) [⚠️](https://github.com/postcss/postcss-use/commits?author=jonathantneal) | [\u003cimg src=\"https://avatars.githubusercontent.com/u/2784308?v=3\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003e一丝\u003c/sub\u003e](www.iyunlu.com/view)\u003cbr /\u003e[💻](https://github.com/postcss/postcss-use/commits?author=yisibl) | [\u003cimg src=\"https://avatars.githubusercontent.com/u/157534?v=3\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003eMaxime Thirouin\u003c/sub\u003e](https://moox.io/)\u003cbr /\u003e[📖](https://github.com/postcss/postcss-use/commits?author=MoOx) | [\u003cimg src=\"https://avatars.githubusercontent.com/u/5635476?v=3\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003eBogdan Chadkin\u003c/sub\u003e](https://github.com/TrySound)\u003cbr /\u003e[📖](https://github.com/postcss/postcss-use/commits?author=TrySound) 👀 | [\u003cimg src=\"https://avatars.githubusercontent.com/u/48200?v=3\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003eEspen Hovlandsdal\u003c/sub\u003e](https://espen.codes/)\u003cbr /\u003e[💻](https://github.com/postcss/postcss-use/commits?author=rexxars) [⚠️](https://github.com/postcss/postcss-use/commits?author=rexxars) | [\u003cimg src=\"https://avatars.githubusercontent.com/u/19343?v=3\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003eAndrey Sitnik\u003c/sub\u003e](http://sitnik.ru)\u003cbr /\u003e👀 |\n| :---: | :---: | :---: | :---: | :---: | :---: | :---: |\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors] specification. Contributions of\nany kind welcome!\n\n## License\n\nMIT © [Ben Briggs](http://beneb.info)\n\n\n[all-contributors]: https://github.com/kentcdodds/all-contributors\n[ci]:      https://travis-ci.org/postcss/postcss-use\n[postcss]: https://github.com/postcss/postcss\n[postcss-discard-comments]: https://github.com/ben-eb/postcss-discard-comments\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpostcss%2Fpostcss-use","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpostcss%2Fpostcss-use","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpostcss%2Fpostcss-use/lists"}