{"id":14968187,"url":"https://github.com/csstools/postcss-short-data","last_synced_at":"2025-10-26T00:31:10.778Z","repository":{"id":57328518,"uuid":"46275946","full_name":"csstools/postcss-short-data","owner":"csstools","description":"Use shorthand data attribute selectors in CSS","archived":true,"fork":false,"pushed_at":"2016-10-10T03:37:59.000Z","size":53,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-05T11:17:15.594Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://jonathantneal.github.io/postcss-short-data","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/csstools.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-16T13:23:41.000Z","updated_at":"2024-12-28T18:45:57.000Z","dependencies_parsed_at":"2022-09-21T01:52:27.189Z","dependency_job_id":null,"html_url":"https://github.com/csstools/postcss-short-data","commit_stats":null,"previous_names":["jonathantneal/postcss-short-data"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-short-data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-short-data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-short-data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-short-data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csstools","download_url":"https://codeload.github.com/csstools/postcss-short-data/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237961236,"owners_count":19393785,"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-09-24T13:39:30.200Z","updated_at":"2025-10-26T00:31:10.358Z","avatar_url":"https://github.com/csstools.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shorthand Data\n\n\u003cimg align=\"right\" width=\"135\" height=\"95\" src=\"http://postcss.github.io/postcss/logo-leftp.png\" title=\"Philosopher’s stone, logo of PostCSS\"\u003e\n\n[![NPM Version][npm-img]][npm] [![Build Status][ci-img]][ci]\n\n[Shorthand Data] lets you write shorthand data attribute selectors in CSS.\n\n```css\n/* before */\n\nnav a[-active] {\n\tbackground: #f3f3f3;\n}\n\nbutton[-target~=\"main\"] {\n\tbackground: #334332;\n}\n\n/* after */\n\nnav a[data-active] {\n\tbackground: #f3f3f3;\n}\n\nbutton[data-target~=\"main\"] {\n\tbackground: #334332;\n}\n```\n\n## Usage\n\nAdd [Shorthand Data] to your build tool:\n\n```bash\nnpm install postcss-short-data --save-dev\n```\n\n#### Node\n\n```js\nrequire('postcss-short-data').process(YOUR_CSS, { /* options */ });\n```\n\n#### PostCSS\n\nAdd [PostCSS] to your build tool:\n\n```bash\nnpm install postcss --save-dev\n```\n\nLoad [Shorthand Data] as a PostCSS plugin:\n\n```js\npostcss([\n\trequire('postcss-short-data')({ /* options */ })\n]);\n```\n\n#### Gulp\n\nAdd [Gulp PostCSS] to your build tool:\n\n```bash\nnpm install gulp-postcss --save-dev\n```\n\nEnable [Shorthand Data] within your Gulpfile:\n\n```js\nvar postcss = require('gulp-postcss');\n\ngulp.task('css', function () {\n\treturn gulp.src('./css/src/*.css').pipe(\n\t\tpostcss([\n\t\t\trequire('postcss-short-data')({ /* options */ })\n\t\t])\n\t).pipe(\n\t\tgulp.dest('./css')\n\t);\n});\n```\n\n#### Grunt\n\nAdd [Grunt PostCSS] to your build tool:\n\n```bash\nnpm install grunt-postcss --save-dev\n```\n\nEnable [Shorthand Data] within your Gruntfile:\n\n```js\ngrunt.loadNpmTasks('grunt-postcss');\n\ngrunt.initConfig({\n\tpostcss: {\n\t\toptions: {\n\t\t\tprocessors: [\n\t\t\t\trequire('postcss-short-data')({ /* options */ })\n\t\t\t]\n\t\t},\n\t\tdist: {\n\t\t\tsrc: 'css/*.css'\n\t\t}\n\t}\n});\n```\n\n[ci]:      https://travis-ci.org/jonathantneal/postcss-short-data\n[ci-img]:  https://img.shields.io/travis/jonathantneal/postcss-short-data.svg\n[npm]:     https://www.npmjs.com/package/postcss-short-data\n[npm-img]: https://img.shields.io/npm/v/postcss-short-data.svg\n\n[Gulp PostCSS]:  https://github.com/postcss/gulp-postcss\n[Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss\n[PostCSS]:       https://github.com/postcss/postcss\n\n[Shorthand Data]: https://github.com/jonathantneal/postcss-short-data\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fpostcss-short-data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsstools%2Fpostcss-short-data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fpostcss-short-data/lists"}