https://github.com/vituum/vite-plugin-juice
⚡🧃 Vite plugin for Juice, inlines css into HTML
https://github.com/vituum/vite-plugin-juice
Last synced: 5 months ago
JSON representation
⚡🧃 Vite plugin for Juice, inlines css into HTML
- Host: GitHub
- URL: https://github.com/vituum/vite-plugin-juice
- Owner: vituum
- License: mit
- Created: 2022-08-21T12:22:12.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-27T15:47:04.000Z (8 months ago)
- Last Synced: 2024-10-01T20:40:05.381Z (7 months ago)
- Language: JavaScript
- Size: 30.3 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- fucking-awesome-vite - @vituum/vite-plugin-juice - Juice support, transforms `.css` to inline styles in `.html`. (Plugins / Framework-agnostic Plugins)
- awesome-vite - @vituum/vite-plugin-juice - Juice support, transforms `.css` to inline styles in `.html`. (Plugins / Framework-agnostic Plugins)
README
# ⚡️🧃 ViteJuice
Inlines CSS code to HTML via [Juice](https://github.com/Automattic/juice). It's handy for creating email templates.
```js
import juice from '@vituum/vite-plugin-juice'export default {
plugins: [
juice({
paths: [],
tables: true,
postcss: {},
doctype: '',
options: {},
juiceLink: async href => href
})
]
}
```Only PostCSS and CSS is supported, you can transform sass or less via `juiceLink()` function. And process it manually.
* Sass - https://sass-lang.com/documentation/js-api/
* Less - https://lesscss.org/usage/#programmatic-usage```html
```
Read the [docs](https://vituum.dev/plugins/juice.html) to learn more about the plugin options.
### Requirements
- [Node.js LTS (16.x)](https://nodejs.org/en/download/)
- [Vite](https://vitejs.dev/)