Themes
How to change the branding of your project from a list of 20+ options by changing one word.
Last updated
Was this helpful?
How to change the branding of your project from a list of 20+ options by changing one word.
Last updated
Was this helpful?
DaisyUI offers a variety of themes that you can easily apply to your Ruby on Rails application. To change the theme, you need to modify the data-theme
attribute in the <body>
tag of your application.html.erb
layout file.
Open your config/meta.yml
file.
Locate the LIGHT_THEME
and DARK_THEME
meta's
Update value with the desired theme name. For example:
You can replace "cupcake" with any theme name provided by DaisyUI.
To see the different themes you can choose from, check the DaisyUI documentation or their themes page below:
In application.html.erb
by changing the data-theme
attribute in the <body>
tag, you can quickly switch between these themes, allowing for a customizable look and feel for your application!
Find a component you like? Just copy/paste it into your LightningRails project.
If you wish to add a custom theme or modify an existing one. We won't be able to do it on the tailwind config file. This is because the Daisyui library doesn't support the configuration of import maps, so Lightning Rails is using CDN instead.
However, you can always create your custom your custom css methods in application.css
.
In application.css, create a custom theme:
Then call the new theme in your meta.yml
To customize the default fonts of your projects, import the custom fonts in application.css
and assign them to your headers and p in that same file.
Most definitely! DaisyUi has a lot of components but frankly lacks pre-designed sections, for us developers who don't want to spend hours creating for scratch. You can easily find more Tailwind components in the library.
See all the DaisyUI variables you can customize in your custom theme .