Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
unocss-themes
Advanced tools
An unocss variant generator that generates variants for multiple color themes.
This is an unocss variant generator that generates variants for multiple color themes. It's similar to the tailwind-themes plugin, but for unocss.
To use it, install the package:
# using npm
npm install unocss-themes
# using yarn
yarn add unocss-themes
The package will generate variants, which you'll need to add to your unocss config. To generate variants, pass in a themes
object. For example,
import unocssThemes from "unocss-themes"
const variants = unocssThemes({
themes: {
blue: ".blue",
purple: ".theme-purple",
},
})
Each key is the name of the variant (so a key of blue
would create classes such as blue:text-blue-900
) and each value is the selector that activates the variant (a value of ".theme-purple"
means that the purple variant will be activated if a class of .theme-purple
exists earlier in the HTML tree). In addition, attributify mode is enabled so class="blue:text-blue-900"
and blue="text-blue-900
will both work.
The function will return a variant that you should add to your unocss config like so:
unocss({
variants: [
unocssThemes({
themes: {
blue: ".blue",
purple: ".theme-purple",
},
}),
// add your custom variants here
],
})
To see an example of unocss-themes in action, check out the unocss-themes demo.
FAQs
An unocss variant generator that generates variants for multiple color themes.
The npm package unocss-themes receives a total of 1 weekly downloads. As such, unocss-themes popularity was classified as not popular.
We found that unocss-themes demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.