{"id":17973840,"url":"https://github.com/rubum/css-parser","last_synced_at":"2025-03-25T14:31:43.996Z","repository":{"id":57487440,"uuid":"373094723","full_name":"rubum/css-parser","owner":"rubum","description":"A tool for parsing CSS in Elixir  to a  structured data. It's an initial attempt in implementing PostCSS in Elixir.","archived":false,"fork":false,"pushed_at":"2021-06-12T21:19:11.000Z","size":58,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-09-27T21:46:30.532Z","etag":null,"topics":["css","cssparser","postcss"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rubum.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-02T08:44:44.000Z","updated_at":"2023-12-28T05:18:45.000Z","dependencies_parsed_at":"2022-09-01T22:51:59.023Z","dependency_job_id":null,"html_url":"https://github.com/rubum/css-parser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubum%2Fcss-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubum%2Fcss-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubum%2Fcss-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubum%2Fcss-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rubum","download_url":"https://codeload.github.com/rubum/css-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222021741,"owners_count":16917573,"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","cssparser","postcss"],"created_at":"2024-10-29T17:03:39.652Z","updated_at":"2024-10-29T17:03:42.457Z","avatar_url":"https://github.com/rubum.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CssParser\n\n**CssParser** provides css parsing in Elixir.\nAn example follows below:\n\n```elixir\niex\u003e CssParser.parse(\"h4, h3 {color: blue; font-size: 20px;}\")\n     [\n      %{\n        rules: \"color: blue; font-size: 20px;\",\n        selectors: \"h4, h3\",\n        type: \"elements\"\n      }\n    ]\n```\n\nCssParser can even remove comments from a css string, as below:\n\n```elixir\niex\u003e CssParser.parse(\"/* first comment */ p {font-weight: bold;} /* second comment */\")\n     [\n      %{\n        rules: \"font-weight: bold;\", selectors: \" p\", type: \"rules\"\n       }\n     ]\n```\n\nIf you have a file with css, CssParser can parse it as long as it's a valid source:\n\n```elixir\niex\u003e CssParser.parse(\"/some/file/with.css\")\n```\nIn case the passed css file isn't valid, you get the following result:\n\n```elixir\niex\u003e CssParser.parse(\"/non/existing/file.css\")\n     \"No such file or directory\"\n```\n\n## Installation\n\nCssParser can be installed by adding `css_parser` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:css_parser, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\nDocumentation can be found at [https://hexdocs.pm/css_parser](https://hexdocs.pm/css_parser).\n\n## Running tests\n\nClone the repo and fetch its dependencies:\n\n    $ git clone https://github.com/rubum/css-parser.git\n    $ cd css-parser\n    $ mix deps.get\n    $ mix test\n\n## License\n\nCopyright (c) 2020 Rubum\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubum%2Fcss-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubum%2Fcss-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubum%2Fcss-parser/lists"}