DEV Community

Discussion on: Background images in TailwindCSS - the clean and easy way

Collapse
jfbrennan profile image
Jordan Brennan

Why wouldn't you just do:

.bg-hero { background-image: url(../images/home/hero.jpg) }
Enter fullscreen mode Exit fullscreen mode
Collapse
pavelloz profile image
Paweł Kowalski Author

Because with TailwindCSS (and especially when doing six different themes with one set of CSS files) I want to keep my CSS untouched as much as possible - having those definitions in config means those definitions will be generated per theme and included only the one needed for particular theme.
So two reasons: It's tailwind way and themes constrains make it easier to mantain later.