This repository has been archived by the owner on Sep 14, 2024. It is now read-only.
v2.0.0-beta.4
Pre-release
Pre-release
Bug Fixes
- Dark mode config is now respected correctly when generating aliases
Features
Tailwind's theme
function is now used internally when generating aliases, meaning that existing Tailwind color config is respected when calculating the value of an alias.
For example, the following config would previously have always generated the bg
color using the literal gray 1 color from Radix. This can be frustrating when you have an existing alias that you want re-used, because you'd have to either remember to change the bg
alias to also use slate, or pull the value out into a variable.
With this release, we delegate the lookup to Tailwind instead, so gray.1
will be resolved to the slate 1 color from Radix, based on the alias of gray
for slate
.
const { createPlugin } = require("windy-radix-palette");
const colors = createPlugin();
module.exports = {
theme: {
extend: {
gray: colors.alias("slate"),
bg: colors.alias({ light: "white", dark: "gray.1" }),
},
},
plugins: [colors.plugin],
};