Custom Themes
How to create custom themes with Wedges.
With Wedges you have the option to create a new theme using the default ones as a foundation. In the following example, we’ll create a dark-blue
theme, extending the standard dark
theme.
Define Colors
For optimal results, creating a ten-step graded color scale for your custom themable colors is recommended. You may find these online tools helpful in generating custom color scales: Palettte and Eva Design System.
Let’s define primaryBlue
color scale:
Alternatively, you can use professionally designed colors scales defined in the Wedges color palette. Import wedgesPallette
to start using predefined colors:
Update Tailwind Config
To create a new theme, you need to provide a configuration object to the wedgesTW
plugin in your tailwind.config
file.
In the example above, we’ve created a new theme called dark-blue
that extends the dark
theme. We’ve also replaced the primary
color with our custom primaryBlue
color scale and partially replaced the secondary
color, specifically secondary.900
with a custom color.
Use The New Theme
Now that we’ve created a new theme, we can use it in our application. To do so, we need to add the dark-blue
class to the html
or any parent element of the component we want to use the theme on.