UnoCSS Starter Theme - Subthemes

You can use UnoCSS Starter to generate a base theme to use with additional subthemes.

When you generate a theme, it copies all the files, and uses stable9 as the base theme by default.

Let's say you have a generated base theme shared across several projects. One of those projects wants to customize the page layout. So you create a subtheme and copy the page.html.twig template. Now you need to include any additional utility classes added to the template.

If you have a new vite project in the subtheme, the default config doesn't know about the base theme. If this page template has a few new classes the base doesn't, the subtheme output will duplicate the common ones. This could be removed with postcss, but the subtheme would need to rebundle the base libraries, or use the dist from the base.

If you are developing code in both themes at the same time, how do you run both vite servers? The module lets you define a dev server url for different modules/themes/libraries, so it is possible.

Maybe the base theme and modules could bundle output as a library that could be imported into the subtheme.

Tags