{"id":19653044,"url":"https://github.com/csstools/postcss-space-start-attrs","last_synced_at":"2025-04-28T17:31:15.839Z","repository":{"id":57328526,"uuid":"46287606","full_name":"csstools/postcss-space-start-attrs","owner":"csstools","description":"Target attributes beginning with a certain value in a space separated list","archived":true,"fork":false,"pushed_at":"2016-12-14T18:14:40.000Z","size":64,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-15T11:23:01.332Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://jonathantneal.github.io/postcss-space-start-attrs/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","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-16T16:35:29.000Z","updated_at":"2024-10-23T21:23:54.000Z","dependencies_parsed_at":"2022-09-21T02:30:20.905Z","dependency_job_id":null,"html_url":"https://github.com/csstools/postcss-space-start-attrs","commit_stats":null,"previous_names":["jonathantneal/postcss-space-start-attrs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-space-start-attrs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-space-start-attrs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-space-start-attrs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-space-start-attrs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csstools","download_url":"https://codeload.github.com/csstools/postcss-space-start-attrs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250574590,"owners_count":21452586,"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-11-11T15:13:00.689Z","updated_at":"2025-04-28T17:31:15.800Z","avatar_url":"https://github.com/csstools.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Space Start Attributes \u003ca href=\"https://github.com/postcss/postcss\"\u003e\u003cimg src=\"https://postcss.github.io/postcss/logo.svg\" alt=\"PostCSS Logo\" width=\"90\" height=\"90\" align=\"right\"\u003e\u003c/a\u003e\n\n[![NPM Version][npm-img]][npm-url]\n[![Build Status][cli-img]][cli-url]\n[![Licensing][lic-image]][lic-url]\n[![Changelog][log-image]][log-url]\n[![Gitter Chat][git-image]][git-url]\n\n[Space Start Attributes] targets attributes beginning with a certain value in a space separated list in CSS.\n\n```css\n/* before */\n\ndiv[data-thing~^\"starts-with\"] {\n\tbackground-color: red;\n}\n\ndiv:not([data-thing~^\"starts-with\"]) {\n\tbackground-color: blue;\n}\n\n/* after */\n\ndiv[class^=\"starts-with\"],div[class*=\" starts-with\"] {\n\tbackground-color: red;\n}\n\ndiv:not([class^=\"starts-with\"],[class*=\" starts-with\"]) {\n\tbackground-color: blue;\n}\n```\n\nNote: The above example generates a [W3C CSS level 4](https://drafts.csswg.org/selectors-4/#negation) `:not()` selector. I recommend using [Selector Not](https://github.com/postcss/postcss-selector-not) to transpile this to a more compatible CSS level 3 selector.\n\n## Usage\n\nAdd [Space Start Attributes] to your build tool:\n\n```bash\nnpm install postcss-space-start-attrs --save-dev\n```\n\n#### Node\n\n```js\nrequire('postcss-space-start-attrs').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 [Space Start Attributes] as a PostCSS plugin:\n\n```js\npostcss([\n\trequire('postcss-space-start-attrs')({ /* options */ })\n]).process(YOUR_CSS, /* options */);\n```\n\n#### Gulp\n\nAdd [Gulp PostCSS] to your build tool:\n\n```bash\nnpm install gulp-postcss --save-dev\n```\n\nEnable [Space Start Attributes] within your Gulpfile:\n\n```js\nvar postcss = require('gulp-postcss');\n\ngulp.task('css', function () {\n\treturn gulp.src('./src/*.css').pipe(\n\t\tpostcss([\n\t\t\trequire('postcss-space-start-attrs')({ /* options */ })\n\t\t])\n\t).pipe(\n\t\tgulp.dest('.')\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 [Space Start Attributes] within your Gruntfile:\n\n```js\ngrunt.loadNpmTasks('grunt-postcss');\n\ngrunt.initConfig({\n\tpostcss: {\n\t\toptions: {\n\t\t\tuse: [\n\t\t\t\trequire('postcss-space-start-attrs')({ /* options */ })\n\t\t\t]\n\t\t},\n\t\tdist: {\n\t\t\tsrc: '*.css'\n\t\t}\n\t}\n});\n```\n\n[npm-url]: https://www.npmjs.com/package/postcss-space-start-attrs\n[npm-img]: https://img.shields.io/npm/v/postcss-space-start-attrs.svg\n[cli-url]: https://travis-ci.org/jonathantneal/postcss-space-start-attrs\n[cli-img]: https://img.shields.io/travis/jonathantneal/postcss-space-start-attrs.svg\n[lic-url]: LICENSE.md\n[lic-image]: https://img.shields.io/npm/l/postcss-space-start-attrs.svg\n[log-url]: CHANGELOG.md\n[log-image]: https://img.shields.io/badge/changelog-md-blue.svg\n[git-url]: https://gitter.im/postcss/postcss\n[git-image]: https://img.shields.io/badge/chat-gitter-blue.svg\n\n[Space Start Attributes]: https://github.com/jonathantneal/postcss-space-start-attrs\n[PostCSS]: https://github.com/postcss/postcss\n[Gulp PostCSS]: https://github.com/postcss/gulp-postcss\n[Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fpostcss-space-start-attrs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsstools%2Fpostcss-space-start-attrs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fpostcss-space-start-attrs/lists"}