{"name":"happy-style","version":"1.0.3","keywords":["store","variable","functional"],"author":{"url":"http://coderaiser.github.io/","name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"license":"MIT","_id":"happy-style@1.0.3","maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"homepage":"https://github.com/coderaiser/happy-style","bugs":{"url":"https://github.com/coderaiser/happy-style/issues"},"bin":{"happy-style":"bin/happy-style.js"},"dist":{"shasum":"b0dd136fe1a8ea0f319b65f6f8ba9f59fb9e5a71","tarball":"http://registry-npm.ywwl.com/happy-style/download/happy-style-1.0.3.tgz","fileCount":212,"integrity":"sha512-0oRSNH4KESPKUAIga7dM803jEtRd3//UaQszBp9AO7nOvLNRLsRSBuaFR36fIXl4POoXcHhENec8itIflriT2g==","signatures":[{"sig":"MEQCIAhOw7sHPRuEuBA5hqaFLAvBxm0Cn1Wda5Al4WkY4P1dAiAX2SlnnHT25n+rZvCzaSF98YUhMOaJUQzK01VqNWRAgw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIDhc2DPYZ+0Gu0ugSFPYn9eDWXVvzfVgcUFWmeerq3EVAiB2j8jSYD3ek3sFbWSxm0HUADnFyG4mXlA4xcf9hvfiCA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":51999,"size":17168,"noattachment":false,"key":"/happy-style/-/happy-style-1.0.3.tgz"},"type":"module","engines":{"node":">=22"},"exports":{".":"./lib/happy-style.js"},"gitHead":"ba00d5343405c5d054548ebb5a0a7bde471708b0","imports":{"#parser":"./lib/parser/parser.js","#printer":"./lib/printer/printer.js","#happy-style":"./lib/happy-style.js","#parser/rule":"./lib/parser/visitors/rule/rule.js","#parser/test":"./test/create-parser-test.js","#parser/value":"./lib/parser/visitors/value/value.js","#printer/test":"./test/create-printer-test.js","#parser/atrule":"./lib/parser/visitors/atrule/atrule.js","#parser/selector":"./lib/parser/visitors/selector/selector.js","#parser/visitors":"./lib/parser/visitors/index.js","#parser/declaration":"./lib/parser/visitors/declaration/declaration.js","#parser/leading-comment":"./lib/parser/visitors/leading-comment.js"},"scripts":{"lint":"madrun lint","test":"madrun test","report":"madrun report","watcher":"madrun watcher","coverage":"madrun coverage","fix:lint":"madrun fix:lint","watch:lint":"madrun watch:lint","watch:tape":"madrun watch:tape","watch:test":"madrun watch:test","watch:coverage":"madrun watch:coverage","watch:coverage:base":"madrun watch:coverage:base","watch:coverage:tape":"madrun watch:coverage:tape"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"repository":{"url":"git+https://github.com/coderaiser/happy-style.git","type":"git"},"_npmVersion":"12.0.2","description":"css to js ast parser","directories":{},"_nodeVersion":"26.9.0","dependencies":{"redstd":"^1.0.2","css-tree":"^3.2.1","@putout/babel":"^5.7.3","@putout/printer":"^18.17.0","@putout/operator-json":"^3.4.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^10.0.3","madrun":"^13.0.1","montag":"^2.0.1","putout":"^42.2.3","nodemon":"^3.1.11","redlint":"^6.9.2","superc8":"^12.7.0","supertape":"^13.2.0","try-catch":"^4.0.9","@putout/test":"^15.4.0","just-kebab-case":"^4.2.0","eslint-plugin-node":"^11.0.0","eslint-plugin-putout":"^31.1.1","@putout/plugin-printer":"^8.17.0"},"_npmOperationalInternal":{"tmp":"tmp/happy-style_1.0.3_1790193742354_0.9508886737587179","host":"s3://npm-registry-packages-npm-production"},"readme":"# Happy Style [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL]\n\n[NPMURL]: https://npmjs.org/package/happy-style \"npm\"\n[NPMIMGURL]: https://img.shields.io/npm/v/happy-style.svg?style=flat\n[BuildStatusURL]: https://github.com/coderaiser/happy-style/actions?query=workflow%3A%22Node+CI%22 \"Build Status\"\n[BuildStatusIMGURL]: https://github.com/coderaiser/happy-style/workflows/Node%20CI/badge.svg\n[LicenseIMGURL]: https://img.shields.io/badge/license-MIT-317BF9.svg?style=flat\n[LicenseURL]: https://tldrlegal.com/license/mit-license \"MIT License\"\n\nCSS to JS AST parser.\n\n## Install\n\n```\nnpm i happy-style --save\n```\n\n## How to use?\n\n### Binary\n\n```\ncat style.css | happy-style\n```\n\nFor full loop use (format detected automatically):\n\n```\ncat style.css | happy-style | happy-style\n```\n\n### Reference\n\nHappy Style converts CSS to a JavaScript AST and back this way:\n\n| CSS                         | Becomes                                                                    |\n|-----------------------------|----------------------------------------------------------------------------|\n| `.button { color: red }`    | `rule(selector([classSelector('button')]), [declaration('color', 'red')])` |\n| `@media (min-width: 100px)` | `mediaQuery([...])`                                                        |\n| `@keyframes anim { ... }`   | `keyframes('anim', [ ... ])`                                               |\n\nThe arguments of `functionValue` are always printed the same way: a single\nspace fills every gap between them, and a comma is an argument of its own, so\n`rgb(255, 0, 0)` is\n`functionValue('rgb', [255, operator(','), 0, operator(','), 0])` while\n`rgb(0 0 0 / 20%)` is\n`functionValue('rgb', [0, 0, 0, operator('/'), percentage(20)])`.\n\n### API\n\n```js\nimport {montag} from 'montag';\nimport {\n    convertCssToJs,\n    convertJsToCss,\n    parseCss,\n    printCss,\n} from 'happy-style';\n\nconst source = montag`\n    .button {\n        color: red;\n    }\n`;\n\nconst js = convertCssToJs(source);\n\n// returns\n`\n[\n    rule(\n        selector([classSelector('button')]),\n        [declaration('color', 'red')],\n    ),\n];\n`;\n\nconvertJsToCss(js);\n// returns\n`\n.button {\n    color: red;\n}\n`;\n```\n\n## License\n\nMIT\n","publish_time":1790193742452,"_cnpm_publish_time":1790193742452,"dist-tags":{"latest":"1.0.9"}}