Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

This starter kit theme provides a preconfigured development environment for building themes with UnoCSS and Vite. It helps streamline the process of integrating modern frontend tooling into Drupal theme development.

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.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
4
Tracked since
Oct 2024
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 4
Maintenance
Dormant

Release Timeline

Releases

Version Type Core Release date
0.3.x-dev Dev 10–11 Apr 13, 2025
0.2.x-dev Dev 10–11 Oct 14, 2024
0.1.x-dev Dev 10 Oct 14, 2024
0.x-dev Dev 10 Oct 14, 2024