Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wheatjs/unocss-directives
CSS Directive support for UnoCss
https://github.com/wheatjs/unocss-directives
Last synced: 4 days ago
JSON representation
CSS Directive support for UnoCss
- Host: GitHub
- URL: https://github.com/wheatjs/unocss-directives
- Owner: wheatjs
- Created: 2022-02-19T05:42:13.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-02-19T06:16:35.000Z (over 2 years ago)
- Last Synced: 2024-11-02T01:42:28.325Z (11 days ago)
- Language: TypeScript
- Size: 62.5 KB
- Stars: 30
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Unocss Directives
Enables CSS directives in Unocss
## Install
```bash
npm install --save-dev unocss-directives
``````ts
// vite.config.ts
import Unocss from 'unocss/vite'
import UnocssDirectives from 'unocss/directives'export default defineConfig({
plugins: [
// Unocss({ plugins: [...] }), Replace with UnocssDirectives
UnocssDirectives({ plugins: [...] }),
]
})
```## Features
Will automatically convert valid Unocss class names to valid css when used with `@apply`The following
```css
html {
@apply p-4;
}
```
will be converted to
```css
html {
padding: 1rem;
}
```## TODO
[ ] Variants## License
[MIT License](https://github.com/jacobclevenger/vite-plugin-vue-gql/blob/main/LICENSE) © 2021-PRESENT [Jacob Clevenger](https://github.com/jacobclevenger)