{"c8":{"lines":90,"reporter":["lcov","text"],"check-coverage":true},"_id":"postcss-html@2.0.0","bugs":{"url":"https://github.com/ota-meshi/postcss-html/issues"},"dist":{"shasum":"47555530c6d871cf5a6347387f717d7bfaf2ffa9","tarball":"http://registry-npm.ywwl.com/postcss-html/download/postcss-html-2.0.0.tgz","fileCount":19,"integrity":"sha512-f2Rvw5FCollEfVj3wfN7JdQb7n2rNIthW+epw2EByio7M6P7RH0BTj8a/ODHrUXd0cmO7ychb6YniymV93182Q==","signatures":[{"sig":"MEUCIEENHw9EGf/zXxmko8TxkEYu6DerpFVtRMiwLAfTWWnkAiEA6LMYpb6lo07444NLqK/3fdzXMabUDFtgKDYB8Jtn4J0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDg63oNAyDGwE6bYX5KWihJjlJ7pqwPoDLNVw3Sz5yO2gIgVADwYRKCyeJZSmri18q5BTbXIOhgX+RsILk0P1T+XZ4="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/postcss-html@2.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":28783,"size":9739,"noattachment":false,"key":"/postcss-html/-/postcss-html-2.0.0.tgz"},"main":"./lib/index.js","name":"postcss-html","type":"module","types":"./lib/index.d.ts","author":{"name":"gucong"},"engines":{"node":"^22.12 || >=24"},"exports":{".":{"types":"./lib/index.d.ts","default":"./lib/index.js"},"./package.json":"./package.json"},"gitHead":"b3680e486ea735b29d5a3541a6ff7a29320113d8","license":"MIT","scripts":{"lint":"eslint .","test":"c8 npm run mocha","mocha":"mocha \"test/**/*.{js,cjs}\" --no-timeouts","eslint-fix":"eslint . --fix","preversion":"npm run test","update-snap":"mocha \"test/**/*.{js,cjs}\" --no-timeouts --update"},"version":"2.0.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:fedf4da3-bc2c-420c-9526-9d820963739f"}},"homepage":"https://github.com/ota-meshi/postcss-html#readme","keywords":["postcss","syntax","html","vue","quickapp","PHP","css","less","sass","scss","sss","sugarss"],"repository":{"url":"git+https://github.com/ota-meshi/postcss-html.git","type":"git"},"_npmVersion":"11.16.0","description":"PostCSS syntax for parsing HTML (and HTML-like)","directories":{},"maintainers":[{"name":"jeddy3","email":"npm@richardhallows.com"},{"name":"ai","email":"andrey@sitnik.es"},{"name":"gucong","email":"gucong@gmail.com"},{"name":"ota-meshi","email":"otameshiyo23@gmail.com"}],"_nodeVersion":"24.18.0","contributors":[{"url":"https://github.com/ota-meshi","name":"Yosuke Ota"}],"dependencies":{"js-tokens":"^9.0.0","htmlparser2":"^9.1.0","postcss-safe-parser":"^7.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.0.0","chai":"~6.2.0","mocha":"^11.0.0","eslint":"^8.0.1","sugarss":"^5.0.0","prettier":"^3.0.0","stylelint":"^17.0.0","autoprefixer":"^10.3.7","postcss-less":"^6.0.0","postcss-scss":"^4.0.1","postcss-styl":"^0.12.0","eslint-plugin-n":"^17.0.0","eslint-plugin-vue":"^9.0.0","eslint-plugin-yml":"^1.0.0","eslint-plugin-jsonc":"^2.0.0","eslint-plugin-regexp":"^2.0.0","eslint-config-prettier":"^10.0.0","eslint-plugin-prettier":"^5.0.0","@ota-meshi/eslint-plugin":"^0.15.0","mocha-chai-jest-snapshot":"1.1.7","stylelint-config-standard":"^40.0.0","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-node-dependencies":"^0.13.0","eslint-plugin-json-schema-validator":"^5.0.0"},"peerDependencies":{"postcss":"^8.5.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/postcss-html_2.0.0_1785541258786_0.14465902254593255"},"readme":"# PostCSS HTML Syntax\n\n[![NPM license](https://img.shields.io/npm/l/postcss-html.svg)](https://www.npmjs.com/package/postcss-html)\n[![NPM version](https://img.shields.io/npm/v/postcss-html.svg?style=flat-square)](https://www.npmjs.com/package/postcss-html)\n[![NPM downloads](https://img.shields.io/npm/dw/postcss-html.svg)](http://www.npmtrends.com/postcss-html)\n[![NPM downloads](https://img.shields.io/npm/dm/postcss-html.svg)](http://www.npmtrends.com/postcss-html)\n[![NPM downloads](https://img.shields.io/npm/dy/postcss-html.svg)](http://www.npmtrends.com/postcss-html)\n[![Build Status](https://github.com/ota-meshi/postcss-html/workflows/CI/badge.svg?branch=master)](https://github.com/ota-meshi/postcss-html/actions?query=workflow%3ACI)\n\n<img align=\"right\" width=\"95\" height=\"95\"\n title=\"Philosopher’s stone, logo of PostCSS\"\n src=\"http://postcss.github.io/postcss/logo.svg\">\n\n[PostCSS](https://github.com/postcss/postcss) syntax for parsing HTML (and HTML-like)\n\n- [Vue Single-File Components](https://vuejs.org/guide/scaling-up/sfc.html)\n- [Svelte Components](https://svelte.dev/docs#component-format)\n- [Astro Components](https://docs.astro.build/en/core-concepts/astro-components/)\n- [PHP](http://php.net)\n- [Quick App](https://doc.quickapp.cn/framework/source-file.html)\n- [XSLT](https://www.w3.org/TR/xslt-30/)\n\n## Getting Started\n\nFirst thing's first, install the module:\n\n```bash\nnpm install postcss-html --save-dev\n```\n\npostcss-html is an ES module and requires Node.js `^22.12 || >=24`. CommonJS consumers on those Node.js versions can still load it with `require(\"postcss-html\")`.\n\nIf you want support SCSS/SASS/LESS/SugarSS syntax, you need to install the corresponding module.\n\n- SCSS: [postcss-scss](https://github.com/postcss/postcss-scss)\n- SASS: [postcss-sass](https://github.com/aleshaoleg/postcss-sass)\n- LESS: [postcss-less](https://github.com/shellscape/postcss-less)\n- SugarSS: [sugarss](https://github.com/postcss/sugarss)\n- Stylus: [postcss-styl](https://github.com/ota-meshi/postcss-styl)\n\n## Use Cases\n\n```js\nimport postcss from 'postcss';\nimport postcssHtml from 'postcss-html';\nimport postcssScss from 'postcss-scss';\nimport postcssLess from 'postcss-less';\nimport postcssSafeParser from 'postcss-safe-parser';\n\nconst syntax = postcssHtml({\n    // syntax for parse scss (non-required options)\n    scss: postcssScss,\n    // syntax for parse less (non-required options)\n    less: postcssLess,\n    // syntax for parse css blocks (non-required options)\n    css: postcssSafeParser,\n});\npostcss(plugins).process(source, { syntax: syntax }).then(function (result) {\n    // An alias for the result.css property. Use it with syntaxes that generate non-CSS output.\n    result.content\n});\n```\n\nIf you want support SCSS/SASS/LESS/SugarSS syntax, you need to install these module:\n\n- SCSS: [postcss-scss](https://github.com/postcss/postcss-scss)\n- SASS: [postcss-sass](https://github.com/aleshaoleg/postcss-sass)\n- LESS: [postcss-less](https://github.com/shellscape/postcss-less)\n- SugarSS: [sugarss](https://github.com/postcss/sugarss)\n- Stylus: [postcss-styl](https://github.com/ota-meshi/postcss-styl)\n\n## Advanced Use Cases\n\n### Options\n\n```js\nimport postcssHtml from 'postcss-html';\nimport postcssSass from 'postcss-sass';\nimport sugarss from 'sugarss';\nimport postcssCustomSyntax from 'postcss-custom-syntax';\n\nconst options = {\n    rules: [\n        {\n            // custom language\n            test: /^postcss$/i,\n            lang: 'scss'\n        },\n        {\n            // custom language\n            test: /^customcss$/i,\n            lang: 'custom'\n        },\n    ],\n\n    // custom parser for CSS (using `postcss-safe-parser`)\n    css: 'postcss-safe-parser',\n    // custom parser for SASS (PostCSS-compatible syntax.)\n    sass: postcssSass,\n    // custom parser for SCSS (by module name)\n    scss: 'postcss-scss',\n    // custom parser for LESS (by module path)\n    less: './node_modules/postcss-less',\n    // custom parser for SugarSS\n    sugarss: sugarss,\n    // custom parser for custom language\n    custom: postcssCustomSyntax,\n}\nconst syntax = postcssHtml(options);\n```\n\n## Turning PostCSS off from within your HTML\n\nPostCSS can be temporarily turned off by using special comments in your HTML. For example:\n\n```html\n<html>\n<body>\n<!-- postcss-ignore -->\n<a style=\"color: red;\" description=\"style is not parsed.\"></a>\n\n<a style=\"color: red;\" description=\"style is parsed.\"></a>\n```\n\n```html\n<html>\n<body>\n<!-- postcss-disable -->\n<a style=\"color: red;\" description=\"style is not parsed.\"></a>\n<a style=\"color: red;\" description=\"style is not parsed.\"></a>\n<!-- postcss-enable -->\n\n<a style=\"color: red;\" description=\"style is parsed.\"></a>\n```\n\n## Linting with Stylelint\n\nThe main use case of this plugin is to apply linting with [Stylelint] to `<style>` tags and `<div style=\"*\">` property in HTML (and HTML-like).\n\nYou can use it by configuring your `stylelint` config as follows:\n\n```json\n{\n    \"overrides\": [\n        {\n            \"files\": [\"*.html\", \"**/*.html\"],\n            \"customSyntax\": \"postcss-html\"\n        }\n    ]\n}\n```\n\nYou can use it more easily if you use an already configured sharable config.\n\n```diff\n{\n+    \"extends\": [\n+        \"stylelint-config-html\",\n         // If you are using Vue.\n+        \"stylelint-config-recommended-vue\"\n+    ],\n-    \"overrides\": [\n-        {\n-            \"files\": [\"*.html\", \"**/*.html\"],\n-            \"customSyntax\": \"postcss-html\"\n-        }\n-    ]\n}\n```\n\n- [stylelint-config-html]\n- [stylelint-config-recommended-vue]\n\n[Stylelint]: https://stylelint.io/\n[stylelint-config-html]: https://github.com/ota-meshi/stylelint-config-html\n[stylelint-config-recommended-vue]: https://github.com/ota-meshi/stylelint-config-recommended-vue\n","publish_time":1785541258869,"_cnpm_publish_time":1785541258869,"dist-tags":{"latest":"2.0.0","next":"1.0.0-alpha.4"}}