{"id":19653011,"url":"https://github.com/csstools/postcss-partial-import","last_synced_at":"2025-04-28T17:31:10.899Z","repository":{"id":57328262,"uuid":"42072525","full_name":"csstools/postcss-partial-import","owner":"csstools","description":"Inline sugary @import statements in CSS","archived":false,"fork":false,"pushed_at":"2019-11-06T18:47:43.000Z","size":63,"stargazers_count":72,"open_issues_count":8,"forks_count":19,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-04-14T05:31:44.416Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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":null,"support":null}},"created_at":"2015-09-07T20:11:47.000Z","updated_at":"2023-10-19T09:16:55.000Z","dependencies_parsed_at":"2022-09-18T17:22:56.902Z","dependency_job_id":null,"html_url":"https://github.com/csstools/postcss-partial-import","commit_stats":null,"previous_names":["jonathantneal/postcss-partial-import"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-partial-import","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-partial-import/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-partial-import/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-partial-import/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csstools","download_url":"https://codeload.github.com/csstools/postcss-partial-import/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223114154,"owners_count":17089646,"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-11-11T15:12:54.503Z","updated_at":"2024-11-11T15:12:55.573Z","avatar_url":"https://github.com/csstools.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Partial Import \u003ca href=\"https://github.com/postcss/postcss\"\u003e\u003cimg src=\"https://postcss.github.io/postcss/logo.svg\" alt=\"PostCSS Logo\" width=\"90\" height=\"90\" align=\"right\"\u003e\u003c/a\u003e\n\n[![NPM Version][npm-img]][npm-url]\n[![Build Status][cli-img]][cli-url]\n[![Licensing][lic-image]][lic-url]\n[![Changelog][log-image]][log-url]\n[![Gitter Chat][git-image]][git-url]\n\n[Partial Import] lets you use sugary `@import` statements in CSS, including [glob]-like and [Sass]-like behavior. It even lets you generates imports as a scaffolding tool.\n\n```css\n/* before: style.css */\n\n@import \"foo/bar\";\n\n/* before: foo/bar.css */\n\n.example-1 {\n    background-color: #fafafa;\n}\n\n/* after: style.css */\n\n.example-1 {\n    background-color: #fafafa;\n}\n```\n\n## Options\n\n#### `root`\n\nType: `String`  \nDefault: [`from`](https://github.com/postcss/postcss#node-source) or `process.cwd()`\n\nThe root where paths are resolved. This should be the directory containing `node_modules`.\n\n#### `path`\n\nType: `String` | `Array`  \nDefault: `[]`\n\nA path or paths used to locate files.\n\n#### `plugins`\n\nType: `Array`  \nDefault: `undefined`\n\nAn array of plugins to be applied to imported file.\n\n#### `onImport`\n\nType: `Function`  \nDefault: `null`\n\nThe function called after the import process, receiving an array of imported files.\n\n#### `resolve`\n\nType: `Function`  \nDefault: `null`\n\nA custom resolver, receiving the `id`, `basedir`, and `importOptions` of an import.\n\n#### `load`\n\nType: `Function`  \nDefault: null\n\nA custom loader, receiving the `filename`, `importOptions`, and content or\npromised content.\n\n#### `skipDuplicates`\n\nType: `Boolean`  \nDefault: `true`\n\nWhether similar files (based on the same content) will be skipped.\n\n#### `prefix`\n\nType: `String`  \nDefault: `\"\"`\n\nLeading characters conditionally prepended to imports which are not found without them. For [Sass]-like, use `\"_\"`.\n\n#### `glob`\n\nType: `Boolean` | `Object`  \nDefault: `true`\n\nWhether [glob]-like behavior should be supported by imports. An object passed here will be forwarded to [glob] in order to change pattern matching behavior.\n\n#### `touch`\n\nType: `Boolean`  \nDefault: `false`\n\nWhether imports should be created as files if they do not already exist.\n\n#### `extension`\n\nType: `String`  \nDefault: `.css`\n\nA file extension conditionally appended to touched imports which do not specify an extension.\n\n## Usage\n\nAdd [Partial Import] to your build tool:\n\n```bash\nnpm install postcss-partial-import --save-dev\n```\n\n#### Node\n\n```js\nrequire('postcss-partial-import').process(YOUR_CSS, { /* options */ });\n```\n\n#### PostCSS\n\nAdd [PostCSS] to your build tool:\n\n```bash\nnpm install postcss --save-dev\n```\n\nLoad [Partial Import] as a PostCSS plugin:\n\n```js\npostcss([\n\trequire('postcss-partial-import')({ /* options */ })\n]).process(YOUR_CSS, /* options */);\n```\n\n#### Gulp\n\nAdd [Gulp PostCSS] to your build tool:\n\n```bash\nnpm install gulp-postcss --save-dev\n```\n\nEnable [Partial Import] within your Gulpfile:\n\n```js\nvar postcss = require('gulp-postcss');\n\ngulp.task('css', function () {\n\treturn gulp.src('./src/*.css').pipe(\n\t\tpostcss([\n\t\t\trequire('postcss-partial-import')({ /* options */ })\n\t\t])\n\t).pipe(\n\t\tgulp.dest('.')\n\t);\n});\n```\n\n#### Grunt\n\nAdd [Grunt PostCSS] to your build tool:\n\n```bash\nnpm install grunt-postcss --save-dev\n```\n\nEnable [Partial Import] within your Gruntfile:\n\n```js\ngrunt.loadNpmTasks('grunt-postcss');\n\ngrunt.initConfig({\n\tpostcss: {\n\t\toptions: {\n\t\t\tuse: [\n\t\t\t\trequire('postcss-partial-import')({ /* options */ })\n\t\t\t]\n\t\t},\n\t\tdist: {\n\t\t\tsrc: '*.css'\n\t\t}\n\t}\n});\n```\n\n[npm-url]: https://www.npmjs.com/package/postcss-partial-import\n[npm-img]: https://img.shields.io/npm/v/postcss-partial-import.svg\n[cli-url]: https://travis-ci.org/jonathantneal/postcss-partial-import\n[cli-img]: https://img.shields.io/travis/jonathantneal/postcss-partial-import.svg\n[lic-url]: LICENSE.md\n[lic-image]: https://img.shields.io/npm/l/postcss-partial-import.svg\n[log-url]: CHANGELOG.md\n[log-image]: https://img.shields.io/badge/changelog-md-blue.svg\n[git-url]: https://gitter.im/postcss/postcss\n[git-image]: https://img.shields.io/badge/chat-gitter-blue.svg\n\n[Partial Import]: https://github.com/jonathantneal/postcss-partial-import\n[glob]: https://github.com/isaacs/node-glob#readme\n[Sass]: http://sass-lang.com/guide#topic-4\n[PostCSS]: https://github.com/postcss/postcss\n[Gulp PostCSS]: https://github.com/postcss/gulp-postcss\n[Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fpostcss-partial-import","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsstools%2Fpostcss-partial-import","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fpostcss-partial-import/lists"}