{"id":19432225,"url":"https://github.com/gebrkn/jadzia","last_synced_at":"2026-06-12T04:31:25.635Z","repository":{"id":57279094,"uuid":"199951377","full_name":"gebrkn/jadzia","owner":"gebrkn","description":"create CSS with pure javascript","archived":false,"fork":false,"pushed_at":"2021-06-05T17:02:05.000Z","size":15,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-19T17:39:15.721Z","etag":null,"topics":["css","css-generator","css-parametrization","css-preprocessor"],"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/gebrkn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-01T01:06:53.000Z","updated_at":"2022-10-25T09:42:39.000Z","dependencies_parsed_at":"2022-09-11T18:51:34.957Z","dependency_job_id":null,"html_url":"https://github.com/gebrkn/jadzia","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gebrkn/jadzia","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gebrkn%2Fjadzia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gebrkn%2Fjadzia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gebrkn%2Fjadzia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gebrkn%2Fjadzia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gebrkn","download_url":"https://codeload.github.com/gebrkn/jadzia/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gebrkn%2Fjadzia/sbom","scorecard":{"id":421282,"data":{"date":"2025-08-11","repo":{"name":"github.com/gebrkn/jadzia","commit":"8f6911e541be7aa0055a19ab515cfd5cd21b10b2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/4 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-19T01:16:08.456Z","repository_id":57279094,"created_at":"2025-08-19T01:16:08.456Z","updated_at":"2025-08-19T01:16:08.456Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34229624,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-12T02:00:06.859Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["css","css-generator","css-parametrization","css-preprocessor"],"created_at":"2024-11-10T14:35:04.546Z","updated_at":"2026-06-12T04:31:25.608Z","avatar_url":"https://github.com/gebrkn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jadzia\n\n`jadzia` generates css from javascript objects.\n\n###### example:\n```javascript\nlet rule = {\n    '#headline': {\n        width: 300,\n        paddingLeft: 5,\n\n        'div': {\n            font: [12, 'Arial'],\n        },\n\n        '\u0026.active': {\n            color: 'cyan',\n            ':hover': {\n                color: 'blue'\n            }\n        }\n    }\n}\n\njadzia.css(rule)\n```\n###### output:\n```css\n#headline {\n    width: 300px;\n    padding-left: 5px;\n}\n#headline div {\n    font: 12px Arial;\n}\n#headline.active {\n    color: cyan;\n}\n#headline.active:hover {\n    color: blue;\n}\n```\n\n`jadzia` is useful if you (like me):\n\n- write lots of complex and highly parametrized CSS\n- know javascript and don't want to learn ad-hoc CSS languages\n- like to be framework-agnostic and keep CSS where it belongs: in .css files\n\n## input\n\n`jadzia`'s input is a `rule`, which is an object containing css properties.\nYou can also pass an (arbitrarily nested) array of `rule`s or a function returning a `rule`.\nA rule object can also contain other nested rules with their respective selectors.\n\n\n###### example:\n```javascript\nlet rule = {\n    '#headline': {\n        // css props\n        width: 300,\n        paddingLeft: 5,\n\n        // nested rule\n        'div': {\n            font: [12, 'Arial'],\n\n            // another nested rule\n            '.important': {\n                fontWeight: 800\n            }\n        }\n    }\n}\n\njadzia.css(rule)\n```\n###### output:\n```css\n#headline {\n    width: 300px;\n    padding-left: 5px;\n}\n#headline div {\n    font: 12px Arial;\n}\n#headline div .important {\n    font-weight: 800;\n}\n```\n\n### selectors\n\nSelectors are just like css selectors. If a nested selector starts with an `\u0026` or `:`, it's merged with the parent selector.\nFor comma-separated nested selectors, `jadzia` creates all possible combinations of them.\nSelectors that end with an `\u0026` are prepended to the parent.\n\n###### example:\n```javascript\nlet rule = {\n    '#headline': {\n        width: 300,\n        paddingLeft: 5,\n\n        // simple sub-selector\n        'div': {\n            font: [12, 'Arial'],\n        },\n\n        // merge with parent\n        '\u0026.active': {\n            color: 'cyan'\n        },\n\n        // prepend to parent\n        '.dark-theme\u0026': {\n            color: 'black'\n        },\n\n        // create combinations\n        'em, strong': {\n            opacity: 0.3\n        }\n    }\n}\n\njadzia.css(rule)\n```\n###### output:\n```css\n#headline {\n    width: 300px;\n    padding-left: 5px;\n}\n#headline div {\n    font: 12px Arial;\n}\n#headline.active {\n    color: cyan;\n}\n.dark-theme #headline {\n    color: black;\n}\n#headline em {\n    opacity: 0.3;\n}\n#headline strong {\n    opacity: 0.3;\n}\n```\n\n### media selectors\n\nMedia selectors are moved to the topmost level and merged.\n\n###### example:\n```javascript\nlet rule = {\n    '#headline': {\n        '@media screen': {\n            '@media (max-width: 800px)': {\n                width: 800,\n            }\n        },\n        '@media print': {\n            display: 'none'\n        }\n    },\n    article: {\n        '@media screen and (max-width: 800px)': {\n            width: '100%',\n        },\n        '@media print': {\n            fontSize: 11\n        }\n    }\n}\n\njadzia.css(rule)\n```\n###### output:\n```css\n@media screen and (max-width: 800px) {\n    #headline {\n        width: 800px;\n    }\n    article {\n        width: 100%;\n    }\n}\n@media print {\n    #headline {\n        display: none;\n    }\n    article {\n        font-size: 11px;\n    }\n}\n```\n\n### property names\n\nCSS property names can be quoted, or written with an underscore instead of a dash, or in camelCase:\n\n###### example:\n```javascript\nlet rule = {\n    '#headline': {\n        paddingLeft: 5,\n        padding_top: 10,\n        'padding-bottom': 20,\n        _webkitTransition: 'all 4s ease',\n    }\n}\n\njadzia.css(rule)\n```\n###### output:\n```css\n#headline {\n    padding-left: 5px;\n    padding-top: 10px;\n    padding-bottom: 20px;\n    -webkit-transition: all 4s ease;\n}\n```\n\nCustom properties (like `--custom-prop`) can be written with two underscores (`__customProp`). Additionally, all unknown CSS properties are treated as custom and quoted. If you need to quote a known property, pass it in the `quote` option. If you need an unknown unquoted property, pass it in the `unquote` option:\n\n\n###### example:\n```javascript\nlet rule = {\n    '#headline': {\n        __customProp: 'a',\n        unknownProp: 'b',\n        newProp: 'c',\n        zoom: 3,\n    }\n}\n\njadzia.css(rule, {\n    quote: ['zoom'], \n    unquote:['new-prop']\n})\n```\n###### output:\n```css\n#headline {\n    --custom-prop: a;\n    --unknown-prop: b;\n    new-prop: c;\n    --zoom: 3;\n}\n```\n\n\n\n### property values\n\nA property value can be:\n\n- a string, which is taken as is\n- an _empty_ string, which will appear in css as `''` (useful for `content` props)\n- a number, to which the default unit will be added if required\n- an array, which will appear space-joined\n- `null`, in which case the property will be removed (useful when extending base rules)\n- a function returning one of the above\n\n###### example:\n```javascript\nconst minMargin = 5;\n\nconst baseBlock = {\n    display: 'block',\n    opacity: 0.3,\n    backgroundColor: 'cyan',\n}\n\nlet rule = {\n    '#headline': {\n        paddingLeft: 5,\n        color: 'cyan',\n        border: [1, 'dotted', 'white'],\n\n        margin: () =\u003e [1, 3].map(x =\u003e x + minMargin),\n        content: '',\n\n        ...baseBlock,\n        backgroundColor: null,\n    }\n}\n\njadzia.css(rule)\n```\n###### output:\n```css\n#headline {\n    padding-left: 5px;\n    color: cyan;\n    border: 1px dotted white;\n    margin: 6px 8px;\n    content: '';\n    display: block;\n    opacity: 0.3;\n}\n```\n\n## API\n\n```\njadzia.css(rules, options)\n```\ntakes `rules` and returns formatted CSS.\n\n```\njadzia.object(rules, options)\n```\ntakes `rules` and returns a normalized CSS object.\n\n```\njadzia.format(object, options)\n```\nformats a normalized object into CSS.\n\n\n###### example:\n```javascript\nlet rule = {\n    '#headline': {\n        width: 300,\n        paddingLeft: 5,\n\n        'div': {\n            font: [12, 'Arial'],\n        }\n    }\n}\n\nJSON.stringify(jadzia.object(rule), null, 4)\n```\n###### output:\n```javascript\n{\n    \"#headline\": {\n        \"width\": \"300px\",\n        \"padding-left\": \"5px\"\n    },\n    \"#headline div\": {\n        \"font\": \"12px Arial\"\n    }\n}\n```\n\n\nThe options are:\n\noption|    |default\n------|----|----\n`quote` | list of properties that should be preceded with two dashes | `[]`\n`unquote` | list of properties that should not be preceded with two dashes | `[]`\n`indent` | indentation for the generated CSS | `4`\n`sort` | sort selectors and property values | `false`\n`unit` | default unit for numeric values | `px`\n\n###### example:\n```javascript\nlet rule = {\n    '#headline': {\n        zIndex: 3,\n        padding: 4,\n        zoom: 5,\n    }\n}\n\njadzia.css(rule, {\n    unit: 'em',\n    indent: 2,\n    sort: true,\n    quote: ['zoom'],\n})\n```\n###### output:\n```css\n#headline {\n  --zoom: 5;\n  padding: 4em;\n  z-index: 3;\n}\n```\n\n`options` are passed to selector and property functions. You can put your own values there for CSS parametrization:\n\n\n###### example:\n```javascript\nlet rule = options =\u003e ({\n    '#headline': {\n        width: 300,\n        color: options.textColor,\n        border: [1, 'dotted', options.borderColor],\n    }\n});\n\njadzia.css(rule, {\n    textColor: '#cc0000',\n    borderColor: 'cyan'\n})\n```\n###### output:\n```css\n#headline {\n    width: 300px;\n    color: #cc0000;\n    border: 1px dotted cyan;\n}\n```\n\n## info\n\n(c) 2019 Georg Barikin (https://github.com/gebrkn). MIT license.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgebrkn%2Fjadzia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgebrkn%2Fjadzia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgebrkn%2Fjadzia/lists"}