https://github.com/stackcss/postcss-prefix
Prefix CSS selectors
https://github.com/stackcss/postcss-prefix
Last synced: 6 months ago
JSON representation
Prefix CSS selectors
- Host: GitHub
- URL: https://github.com/stackcss/postcss-prefix
- Owner: stackcss
- License: other
- Created: 2015-10-26T22:43:36.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2020-09-19T11:13:46.000Z (over 5 years ago)
- Last Synced: 2025-06-11T22:13:10.888Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 23.4 KB
- Stars: 4
- Watchers: 3
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# postcss-prefix
Replace `:host` elements with a prefix of your choosing
## Usage
```js
const prefix = require('postcss-prefix')
const postcss = require('postcss')
const css = `
:host { color: blue }
.hello { color: black }
`
const newCss = postcss([ prefix('#hello-world') ])
.process(css)
.toString()
console.log(newCss)
// => #hello-world { color: blue }
// => .hello { color: black }
`
```
## See Also
- [sheetify](https://github.com/stackcss/sheetify)
## License
[MIT](https://tldrlegal.com/license/mit-license)