{"name":"@adobe/css-tools","version":"4.4.4","keywords":["css","parser","stringifier","stylesheet","ast","typescript","css-parser","css-ast","css-tools","minify","format","preprocessor"],"author":{"name":"TJ Holowaychuk","email":"tj@vision-media.ca"},"license":"MIT","_id":"@adobe/css-tools@4.4.4","maintainers":[{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"},{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"djaeggi","email":"djaeggi@adobe.com"},{"name":"dylandepass","email":"dylandepass@gmail.com"},{"name":"mhaack","email":"mhaack@adobe.com"},{"name":"amol-anand","email":"amol@adobe.com"},{"name":"stopp-adobe","email":"stopp@adobe.com"},{"name":"doten","email":"doten@adobe.com"},{"name":"duh_schmidt","email":"schmidt@adobe.com"},{"name":"asthabh23","email":"astha.bhargava23@gmail.com"},{"name":"zdahbi","email":"zouhir.dahbi@outlook.com"},{"name":"tuicu","email":"tuicu@adobe.com"},{"name":"fmeschbe","email":"fmeschbe@adobe.com"}],"contributors":[{"name":"Jean-Philippe Zolesio","email":"holblin@gmail.com"}],"homepage":"https://github.com/adobe/css-tools#readme","bugs":{"url":"https://github.com/adobe/css-tools/issues"},"dist":{"shasum":"2856c55443d3d461693f32d2b96fb6ea92e1ffa9","tarball":"http://registry-npm.ywwl.com/@adobe/css-tools/download/@adobe/css-tools-4.4.4.tgz","fileCount":16,"integrity":"sha512-Elp+iwUx5rN5+Y8xLt5/GRoG20WGoDCQ/1Fb+1LiGtvwbDavuSk0jhD/eZdckHAuzcDzccnkv+rEjyWfRx18gg==","signatures":[{"sig":"MEUCIQDL49T/0ABQEY8XCYxOX5xx4VI9rUY1d/CtSYLZg2m8zwIgWhEsOe18+CE4nXyucBPF9/p8hah4HtF58vOXzEnC0Ks=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":146090,"size":27587,"noattachment":false,"key":"/@adobe/css-tools/-/@adobe/css-tools-4.4.4.tgz"},"main":"./dist/cjs/adobe-css-tools.cjs","type":"module","types":"./dist/esm/adobe-css-tools.d.mts","module":"./dist/esm/adobe-css-tools.mjs","source":"src/index.ts","browser":"./dist/umd/adobe-css-tools.js","exports":{".":{"import":"./dist/esm/adobe-css-tools.mjs","require":"./dist/cjs/adobe-css-tools.cjs"},"./package.json":"./package.json"},"gitHead":"3175e5abbd012eccfd180b6a5ca54935d5a98e2e","scripts":{"fix":"biome check --write","lint":"biome check","test":"jest","build":"rollup -c","clean":"rm -rf ./dist","prepack":"rollup -c","posttest":"npm run lint","prebuild":"npm run clean","benchmark":"npm run build && node benchmark/index.mjs","postbuild":"tar -czf dist/archive.tgz LICENSE README.md dist/cjs dist/esm dist/umd docs package.json && npx attw --format ascii dist/archive.tgz && rm dist/archive.tgz","check-package-bundle":"attw --pack ."},"_npmUser":{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},"repository":{"url":"git+https://github.com/adobe/css-tools.git","type":"git"},"_npmVersion":"10.8.2","description":"A modern CSS parser and stringifier with TypeScript support","directories":{},"sideEffects":false,"_nodeVersion":"18.20.8","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","bytes":"^3.1.0","tslib":"^2.8.1","rollup":"^4.45.1","ts-jest":"^29.1.1","benchmark":"^2.1.4","typescript":"^5.7.3","@types/jest":"^29.5.14","@types/node":"^24.0.3","@types/bytes":"^3.1.5","@biomejs/biome":"^2.1.2","@types/benchmark":"^2.1.1","rollup-plugin-dts":"^6.2.1","@arethetypeswrong/cli":"^0.18.2","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-commonjs":"^28.0.6","@rollup/plugin-typescript":"^12.1.4","@rollup/plugin-node-resolve":"^16.0.1"},"_npmOperationalInternal":{"tmp":"tmp/css-tools_4.4.4_1755024517699_0.6516706696742318","host":"s3://npm-registry-packages-npm-production"},"readme":"# @adobe/css-tools\n\n> A modern CSS parser and stringifier with TypeScript support\n\n[![npm version](https://badge.fury.io/js/%40adobe%2Fcss-tools.svg)](https://badge.fury.io/js/%40adobe%2Fcss-tools)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nParse CSS into an Abstract Syntax Tree (AST) and convert it back to CSS with configurable formatting. Built with TypeScript for type safety and modern JavaScript features.\n\n## Install\n\n```bash\nnpm install @adobe/css-tools\n```\n\n## Usage\n\n```js\nimport { parse, stringify } from '@adobe/css-tools'\n\n// Parse CSS to AST\nconst ast = parse('body { font-size: 12px; }')\n\n// Stringify AST back to CSS\nconst css = stringify(ast)\n// => \"body { font-size: 12px; }\"\n\n// Pretty print with custom indentation\nconst formatted = stringify(ast, { indent: '  ' })\n// => \"body {\\n  font-size: 12px;\\n}\"\n\n// Minify output\nconst minified = stringify(ast, { compress: true })\n// => \"body{font-size:12px}\"\n```\n\n## API\n\n### `parse(code, options?)`\n\nParses CSS code and returns an Abstract Syntax Tree (AST).\n\n**Parameters:**\n- `code` (string) - The CSS code to parse\n- `options` (object, optional) - Parsing options\n  - `silent` (boolean) - Silently fail on parse errors instead of throwing\n  - `source` (string) - File path for better error reporting\n\n**Returns:** `CssStylesheetAST` - The parsed CSS as an AST\n\n### `stringify(ast, options?)`\n\nConverts a CSS AST back to CSS string with configurable formatting.\n\n**Parameters:**\n- `ast` (CssStylesheetAST) - The CSS AST to stringify\n- `options` (object, optional) - Stringification options\n  - `indent` (string) - Indentation string (default: `'  '`)\n  - `compress` (boolean) - Whether to compress/minify the output (default: `false`)\n\n**Returns:** `string` - The formatted CSS string\n\n## Features\n\n- **Complete CSS Support**: All standard CSS features including selectors, properties, values, at-rules, and comments\n- **TypeScript Support**: Full type definitions for all AST nodes and functions\n- **Error Handling**: Configurable error handling with detailed position information\n- **Formatting Options**: Pretty print, minify, or custom formatting\n- **Performance Optimized**: Efficient parsing and stringification for large CSS files\n- **Source Maps**: Track original source positions for debugging and tooling\n\n### Supported CSS Features\n\n- **Selectors**: Element, class, ID, attribute, pseudo-class, pseudo-element selectors\n- **Properties**: All standard CSS properties and custom properties\n- **Values**: Colors, lengths, percentages, functions, calc(), etc.\n- **At-rules**: @media, @keyframes, @import, @charset, @namespace, @font-face, @page, @document, @supports, @container, @layer, @starting-style, @host, @custom-media\n- **Comments**: Both /* */ and // comments\n- **Whitespace**: Preserves formatting information\n- **Vendor prefixes**: Supports vendor-prefixed at-rules and properties\n- **Nested rules**: Media queries, supports, containers, etc.\n- **Complex selectors**: Combinators, pseudo-selectors, attribute selectors\n\n## Examples\n\n### Error Handling\n\n```js\nimport { parse } from '@adobe/css-tools'\n\nconst malformedCss = `\n  body { color: red; }\n  { color: blue; } /* Missing selector */\n  .valid { background: green; }\n`\n\n// Parse with silent error handling\nconst result = parse(malformedCss, { silent: true })\n\n// Check for parsing errors\nif (result.stylesheet.parsingErrors) {\n  console.log('Parsing errors:', result.stylesheet.parsingErrors.length)\n  result.stylesheet.parsingErrors.forEach(error => {\n    console.log(`Error at line ${error.line}: ${error.message}`)\n  })\n}\n\n// Valid rules are still parsed\nconsole.log('Valid rules:', result.stylesheet.rules.length)\n```\n\n### Source Tracking\n\n```js\nimport { parse } from '@adobe/css-tools'\n\nconst css = 'body { color: red; }'\nconst ast = parse(css, { source: 'styles.css' })\n\n// Position information is available\nconst rule = ast.stylesheet.rules[0]\nconsole.log(rule.position?.source) // \"styles.css\"\nconsole.log(rule.position?.start) // { line: 1, column: 1 }\nconsole.log(rule.position?.end) // { line: 1, column: 20 }\n```\n\nFor more examples, see the [Examples documentation](docs/EXAMPLES.md).\n\n## Performance\n\nThe library is optimized for performance and can handle large CSS files efficiently. For benchmarking information, see the `benchmark/` directory in the source code.\n\n## Documentation\n\n- [API Reference](docs/API.md) - Complete API documentation\n- [AST Structure](docs/AST.md) - Detailed AST node types and structure\n- [Examples](docs/EXAMPLES.md) - Comprehensive usage examples\n- [Changelog](docs/CHANGELOG.md) - Version history and changes\n\n## Background\n\nThis is a fork of the npm `css` package, maintained by Adobe with modern improvements including TypeScript support, enhanced performance, and security updates. It provides a robust foundation for CSS tooling, preprocessing, and analysis.\n\n## License\n\n[MIT](LICENSE)\n","publish_time":1755024517862,"_cnpm_publish_time":1755024517862,"dist-tags":{"latest":"5.0.0"}}