{"id":16346625,"url":"https://github.com/matype/postcss-validator","last_synced_at":"2025-04-04T12:24:15.412Z","repository":{"id":57328660,"uuid":"84956045","full_name":"matype/postcss-validator","owner":"matype","description":"PostCSS plugin to check if an input string is valid CSS","archived":false,"fork":false,"pushed_at":"2020-07-24T19:27:41.000Z","size":9,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T12:08:01.571Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matype.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","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":"2017-03-14T14:04:59.000Z","updated_at":"2021-09-11T09:01:27.000Z","dependencies_parsed_at":"2022-09-13T20:01:01.158Z","dependency_job_id":null,"html_url":"https://github.com/matype/postcss-validator","commit_stats":null,"previous_names":["morishitter/postcss-validator","matype/postcss-validator"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matype%2Fpostcss-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matype%2Fpostcss-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matype%2Fpostcss-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matype%2Fpostcss-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matype","download_url":"https://codeload.github.com/matype/postcss-validator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247175996,"owners_count":20896383,"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":[],"created_at":"2024-10-11T00:35:49.441Z","updated_at":"2025-04-04T12:24:15.387Z","avatar_url":"https://github.com/matype.png","language":"JavaScript","readme":"# postcss-validator [![Build Status](https://travis-ci.org/morishitter/postcss-validator.svg)](https://travis-ci.org/morishitter/postcss-validator)\n\nPostCSS is very flexible CSS parser, so we can extend CSS syntax easily.\nBut, The output of PostCSS plugins may not be valid CSS string.\n[postcss-validator](https://github.com/morishitter/postcss-validator) can check if an input string is valid CSS.\n\n## Features\n\npostcss-validator can check to using the followings:\n\n- Nested selector (like Sass)\n- Unknown properties\n\n## Example\n\n### Using nested selectors\n\nInput:\n\n```\n.class {\n  color: tomato;\n\n  .nested {\n    color: lime;\n  }\n}\n```\n\nYield:\n\n```\nCssSyntaxError: postcss-validator: \u003ccss input\u003e:2:3: Nested rules [.nested]\n```\n\n### Using unknown property\n\nInput:\n\n```\n.class {\n  margintop: 10px;\n}\n```\n\nYield:\n\n```\nCssSyntaxError: postcss-validator: \u003ccss input\u003e:2:3: Unknown property [margintop] is used\n```\n\n## Installation\n\n```shell\n$ npm install postcss-validator\n```\n\n## Usage\n\nSet postcss-validator at the bottom of loaded PostCSS plugins.\n\n### in Node.js\n\n```js\n// dependencies\nvar fs = require(\"fs\")\nvar postcss = require(\"postcss\")\nvar customProperties = require(\"postcss-custom-properties\")\nvar nesting = require(\"postcss-nesting\")\nvar validator = require(\"postcss-validator\")\n\n// css to be processed\nvar css = fs.readFileSync(\"input.css\", \"utf8\")\n\n// process css\nvar output = postcss()\n  .use(customProperties())\n  .use(nesting())\n  .use(validator())\n  .process(css)\n  .css\n```\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2017 Masaaki Morishita\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatype%2Fpostcss-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatype%2Fpostcss-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatype%2Fpostcss-validator/lists"}