Theming
Learn how to configure your theme
To configure your theme, you’ll need to use Tailwind Css config file, data-attributes
and css variables to style the overal UI or specific components.
Palette
Tailus Themer provides nine color palettes, each with primary, secondary, accent, success, danger, warning, info, gray, white, black, and transparent colors. Import these from the @tailus/themer
package to use as a foundation for your own palette.
The default palettes are:
trust
oz
mystery
passion
energy
nature
spring
winter
romance
Learn more about customizing the palette on the Palette page.
Border Radius
To set your theme’s border radius, import the rounded
plugin from @tailus/themer
and add it to tailwind.config.ts's
plugins
array. Apply the border radius using the data-rounded
attribute, preferably on the <html>
element.
The data-rounded
attribute accepts the following values :
none
default
small
medium
large
xlarge
2xlarge
3xlarge
full
Learn more about customizing the border radius on the Rounded page.
Shade
Adjust the background and border colors of your components using the data-shade
attribute. This change is more noticeable in dark mode.
Start with importing and adding the shade
plugin your config’s plugins
array
The available shades are:
800
900
925
950
glassy
Shadow
Padding and Typography
You can adjust the padding and text colors of your components using CSS variables. Start with the default settings by importing the components
plugin from @tailus/themer
and adding it to the plugins
array in your configuration file.
Padding variables
Define the padding CSS variables in your CSS file by assigning them values within the :root
selector. Make sure to place these definitions inside the @layer
base block for proper layering.
Text color variables
Define the text colors CSS variables in your CSS file by assigning them values within the :root
selector. Make sure to place these definitions inside the @layer
base block for proper layering.
Although you can assign any values to the CSS variables, we suggest using the theme
function to access values from the theme
object in your tailwind.config.ts
file. This approach promotes consistency across your styles.
Dark mode
Setting text colors in dark mode depends on your chosen implementation.
If you’re using the class
method (now replaced with selector
), create a .dark
class and assign the CSS variables there.
If you’re using the media
method, add the CSS variables within the @media (prefers-color-scheme: dark)
block.
Animations
To add animations to your components, import the animations
plugin from @tailus/themer
and add it to the plugins
array in your configuration file.
This is an alternative to copy-pasting the animations for each component.
Other customizations
You can also customize the colors of the data visualizations components by defining CSS variables in your CSS file.
The default colors are defined in the components
plugin.