Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

A starterkit theme with UnoCSS and Vite preconfigured for development.

Intro video
https://drupal.tv/external-video/2024-10-13/drupal-theming-sdc-vite-and-...

Blog post
https://www.drupalarchitect.info/projects/unocss-starter-theme/updates/u...

Setup

Copy UnoCSS Starter Minimal for a minimal setup, or UnoCSS Starter Demo for a more complete example.
[lando|ddev] php web/core/scripts/drupal generate-theme --starterkit unocss_starter THEME_NAME
*See complete example below.

Install Vite module.

Configure vite devServerUrl in settings.php.
$settings['vite']['devServerUrl'] = 'https://vite.SITENAME.[lando|ddev].site';

Install npm packages.
[lando|ddev] npm i -D

Build assets.
[lando|ddev] npm run build

Build a theme! Use unocss/tailwind classes in template files, or use them with @apply in css.

Vite dev server

Run vite dev server and experiment in index.html or work on your twig/css files.
[lando|ddev] npm run dev

*Included .lando.yml file has tooling for npm and vite. Edit the path to your theme and run lando vite to start the dev server.

You should see the following in your browser console.
[vite] connecting...
[vite] connected.

Please post any questions or issues in the queue.

Generate subtheme
php core/scripts/drupal generate-theme --path=themes/custom --starterkit=unocss_starter --name="New Theme" --description="UnoCSS starter theme." new_theme

Versions

0.1.x is a bare minimum UnoCSS/Vite setup.
0.2.x is a starting point with a modified directory structure.
0.3.x supports the Wind4 preset (Tailwind 4).

Global CSS
Global css is moved into /libraries/global/component, since they are all in the component layer. Base, layout, theme, and state directories and empty css files are added. Each of these directories is bundled by vite into base.css, layout.css, etc., which are loaded into those css layers in the global library instead of listing the individual files in there. This makes it easier to know where the files are being loaded as you edit them.

Component CSS
Component libraries are loaded individually in templates with {{ attach_library }}.
These are moved into /libraries/components, where they are bundled individually for separate loading when needed. It may make sense to replace these libraries with components.

Requirements

Vite module.

TODO

Testing, documentation and usage examples.
Opinionated starter theme.
Subtheming/update process.
Design System/Storybook integration.
Hot reloading twig files.
Convert component libraries to SDC.
Provide layouts.

Activity

Total releases
1
First release
Apr 2025
Latest release
1 year ago
Release cadence
Stability
0% stable

Releases

Version Type Release date
0.3.x-dev Dev Apr 13, 2025