{"id":18018980,"url":"https://github.com/nv/cssom","last_synced_at":"2025-05-14T06:14:10.582Z","repository":{"id":398435,"uuid":"1025209","full_name":"NV/CSSOM","owner":"NV","description":"Unmaintained! ⚠️ CSS Object Model implemented in pure JavaScript. Also, a CSS parser.","archived":false,"fork":false,"pushed_at":"2023-04-18T01:21:40.000Z","size":229,"stargazers_count":751,"open_issues_count":25,"forks_count":99,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-04-11T00:52:18.333Z","etag":null,"topics":["css-parser","cssom","dom","javascript"],"latest_commit_sha":null,"homepage":"https://nv.github.io/CSSOM/docs/parse.html","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/NV.png","metadata":{"files":{"readme":"README.mdown","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2010-10-26T11:24:05.000Z","updated_at":"2025-03-16T21:08:10.000Z","dependencies_parsed_at":"2023-07-05T14:47:24.482Z","dependency_job_id":null,"html_url":"https://github.com/NV/CSSOM","commit_stats":{"total_commits":185,"total_committers":23,"mean_commits":8.043478260869565,"dds":0.2918918918918919,"last_synced_commit":"00ec21868e12422581c81779135c2f1648441204"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NV%2FCSSOM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NV%2FCSSOM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NV%2FCSSOM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NV%2FCSSOM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NV","download_url":"https://codeload.github.com/NV/CSSOM/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248322609,"owners_count":21084336,"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":["css-parser","cssom","dom","javascript"],"created_at":"2024-10-30T05:08:36.153Z","updated_at":"2025-04-11T00:52:23.164Z","avatar_url":"https://github.com/NV.png","language":"JavaScript","readme":"# CSSOM\n\nCSSOM.js is a CSS parser written in pure JavaScript. It is also a partial implementation of [CSS Object Model](http://dev.w3.org/csswg/cssom/). \n\n    CSSOM.parse(\"body {color: black}\")\n    -\u003e {\n      cssRules: [\n        {\n          selectorText: \"body\",\n          style: {\n            0: \"color\",\n            color: \"black\",\n            length: 1\n          }\n        }\n      ]\n    }\n\n\n## [Parser demo](http://nv.github.io/CSSOM/docs/parse.html)\n\nWorks well in Google Chrome 6+, Safari 5+, Firefox 3.6+, Opera 10.63+.\nDoesn't work in IE \u003c 9 because of unsupported getters/setters.\n\nTo use CSSOM.js in the browser you might want to build a one-file version that exposes a single `CSSOM` global variable:\n\n    ➤ git clone https://github.com/NV/CSSOM.git\n    ➤ cd CSSOM\n    ➤ node build.js\n    build/CSSOM.js is done\n\nTo use it with Node.js or any other CommonJS loader:\n\n    ➤ npm install cssom\n\n## Why is this not maintained?\n\n1. I no longer use it in my projects\n2. Even though cssom npm package has 26 million weekly downloads (as of April 17, 2023), I haven't made a dollar from my work.\n\nIf you want specific issues to be resolved, you can hire me for $100 per hour (which is 1/2 of my normal rate).\n\n## Don’t use it if...\n\nYou parse CSS to mungle, minify or reformat code like this:\n\n```css\ndiv {\n  background: gray;\n  background: linear-gradient(to bottom, white 0%, black 100%);\n}\n```\n\nThis pattern is often used to give browsers that don’t understand linear gradients a fallback solution (e.g. gray color in the example).\nIn CSSOM, `background: gray` [gets overwritten](http://nv.github.io/CSSOM/docs/parse.html#css=div%20%7B%0A%20%20%20%20%20%20background%3A%20gray%3B%0A%20%20%20%20background%3A%20linear-gradient(to%20bottom%2C%20white%200%25%2C%20black%20100%25)%3B%0A%7D).\nIt does **NOT** get preserved.\n\nIf you do CSS mungling, minification, or image inlining, considere using one of the following:\n\n  * [postcss](https://github.com/postcss/postcss)\n  * [reworkcss/css](https://github.com/reworkcss/css)\n  * [csso](https://github.com/css/csso)\n  * [mensch](https://github.com/brettstimmerman/mensch)\n\n\n## [Tests](http://nv.github.com/CSSOM/spec/)\n\nTo run tests locally:\n\n    ➤ git submodule init\n    ➤ git submodule update\n\n\n## [Who uses CSSOM.js](https://github.com/NV/CSSOM/wiki/Who-uses-CSSOM.js)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnv%2Fcssom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnv%2Fcssom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnv%2Fcssom/lists"}