Skip to header Skip to main navigation Skip to main content Skip to footer
Cookies UI
Alaa Haddad Offers Exceptional Drupal Custom Theming and Modules in Austin TX Alaa Haddad - Drupal Expert
Main navigation
  • Professional Profile
  • Drupal Services
    • Drupal Development
    • Drupal Developer
    • Drupal Themer
    • Drupal Architect
    • Drupal Consultant
  • My Drupal Modules & Themes
      • Cloudflare Purge
      • Solo Copy Blocks
      • W3CSS Paragraphs
      • Paragraphs Bundles
      • Acquia Purge Varnish
      • Reference Blocked Users
      • Module Matrix
      • Paragraphs Bundles Import
      • Selectify
      • Solo Utilities
      • Utilikit
      • Solo
      • Amun
      • Anhur
      • Amunet
      • W3CSS Theme
      • 3D Carousel
      • 3D FlipBox
      • Accordion
      • Carousel
      • Hero
      • Lightbox
      • Parallax
      • Reveal
      • Slideshow
      • Tabs
  • Blog
  • Videos
  • Contact
  • Hire Me (opens in new tab)
Search form
User login
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
  • Reset your password
User account menu
  • Hire Me (opens in new tab)
  • Drupal Services
  • Blog
Site branding
Alaa Haddad - Drupal Expert
Consultant • Architect • Developer • Themer - Expert Drupal Solutions
Article Title Image - Block 1

UtiliKit: Runtime Utility-First CSS for Drupal 11.2 and 12

Content Info - Article Info
 
  10:55 PM CDT, Sun September 13, 2026
Share

Breadcrumbs

Breadcrumb

  • Home
  • Drupal Layout
  • UtiliKit: Runtime Utility-First CSS for Drupal 11.2 and 12

Main page content

UtiliKit is a Drupal module that generates utility CSS at runtime from the class names it finds in your content, so a content editor can write uk-pd--37 and get 37 pixels of padding without a build step, a deployment, or a developer.

That is the whole idea, and it is a bigger claim than it sounds, because the reason Tailwind and its relatives cannot do this in a WYSIWYG editor is not an oversight. They compile a stylesheet ahead of time from source files. Content is not a source file, and it changes after the build.

What the class syntax is

Every element opts in with the marker class utilikit, then takes utility classes shaped as uk-{prefix}--{value}, with an optional breakpoint segment.

<div class="utilikit uk-pd--20 uk-md-pd--40 uk-bg--f8fafc uk-br--12">
  20px padding on phones, 40px from 768px up, a background and rounded corners
</div>

The prefixes are two letters. Counted directly from UtilikitRules::getRules() in src/Service/UtilikitRules.php on 14 September 2026, there are 50 of them, grouped into twelve families: Flexbox (9), Layout (7), Sizing (6), Box Model (5), Positioning (5), Typography (5), Grid (4), Colors (3), Effects (2), Transform (2), Spacing (1) and Background (1).

Values are not from a scale. uk-pd--247, uk-mg--3d75rem (the d stands in for a decimal point), uk-wd--87vw and uk-ht--73d5pr all resolve, because the value is parsed rather than looked up. The validation pattern in UtilikitConstants is /^uk-(?:(?:sm|md|lg|xl|xxl)-)?[a-z]{2,4}--[a-zA-Z0-9\-_.%]+$/, which is the whole contract in one line.

One deliberate choice worth knowing: the sizing and positioning prefixes map to logical CSS properties — inline-size, block-size, inset-inline-start — not to width, height and left. On a right-to-left site that is the difference between a layout that mirrors correctly and one that does not.

Three rendering modes, and how to choose

UtiliKit rendering modes, read from utilikit.settings.yml and UtilikitSettingsForm.php
ModeWhere the CSS comes fromUse it when
InlineJavaScript generates and applies styles in the browserBuilding and editing. It is the shipped default.
StaticA pre-generated file on disk, public://utilikit/utilikit-static-style.cssProduction, where you want no client-side work.
HeadServer-generated CSS injected into the page head per requestContainers and read-only filesystems where writing a public file is not an option.

The head mode is the one that tells you this module has been run somewhere real. It exists because static mode needs a writable public files directory, and a containerised deployment often does not have one.

Responsive variants

Five breakpoints ship, defined in UtilikitConstants::BREAKPOINT_VALUES as minimum widths: sm 576px, md 768px, lg 992px, xl 1200px and xxl 1400px. Any prefix takes any breakpoint, so uk-lg-gc--repeat-3-1fr is a three-column grid from 992px up. Breakpoints can be switched off individually in settings to keep the generated file smaller.

If you are already comfortable organising CSS by category, this sits beside that discipline rather than replacing it — the argument for keeping structural CSS in the theme is made in the SMACSS-based categorisation write-up.

Whether runtime utilities belong in your build at all is worth settling before you ship — Drupal theming is the conversation.

How the classes get found

In static and head modes something has to know which classes exist before it can generate a file. UtiliKit scans rendered content for the marker class and for bare uk- patterns, and can regenerate automatically when a node, a custom block or a paragraph is saved — those three entity types are listed in AUTO_UPDATE_ENTITY_TYPES, and all three triggers ship switched off, because each one adds work to every entity save.

There is also a queue worker for cron-time processing, a lock so two regenerations cannot collide, and eight Drush commands: utilikit:generate, scan, status, mode, classes, validate, clear and cache-clear. Three permissions separate the roles: access utilikit reference for the class browser, use utilikit update button for the manual regenerate control, and administer utilikit, which is the only one marked restricted.

The failure this module had to design out

Here is the interesting engineering problem, and it is recorded in the source comments with the dates. UtiliKit had the same rules written twice — once in JavaScript for inline mode, once in PHP for static and head mode. When two copies disagree, the class does one thing in development and a different thing in production, and the setting that decides which is a rendering mode nobody associates with validity.

Three cases were measured on 5 September 2026 and fixed. uk-dp--banana emitted display: banana; into the generated stylesheet while the JavaScript engine rejected it. uk-jc--between worked inline and silently produced nothing in the other two modes. uk-wd--auto rendered inline and produced no CSS at all in static and head, because allowAuto was set on different prefixes in each copy — and which properties actually accept auto was settled by asking the browser's own CSS.supports(), not by reading the spec.

PHP now owns the keyword lists and the JavaScript reads them from there. The justify and align shorthand map is still defined in both places, which is the remaining instance of exactly this pattern. That is the class of bug — one rule with two homes — that costs the most to find in a Drupal build, because everything passes in development.

UtiliKit or Tailwind?

Tailwind is the better answer when your markup lives in templates and components, you have a build pipeline, and your team is comfortable in it. Its ecosystem, tooling and documentation are far larger.

UtiliKit is the better answer when the markup that needs styling is written by editors, in the browser, after the build has run. That is the case Tailwind structurally cannot serve, and it is common in Drupal: a landing page assembled in CKEditor or Layout Builder, needing one section at a slightly different width, today.

They are not exclusive. Plenty of sites should keep a compiled framework for the theme and use runtime utilities only for editorial content.

Guardrails

The defaults are conservative and you should read them before going to production. Utility-class processing is capped at 5,000 classes per AJAX request, AJAX is rate-limited to 60 requests per minute, generated CSS is cached for an hour, and use_important ships as true — utilities win by default. That is the opposite of Tailwind, where important is opt-in, so it will surprise anyone expecting either ordinary cascade order or Tailwind's defaults.

Six optional sub-modules ship with it: Help, Playground (a live class tester), Examples, Test Suite, a CKEditor 5 toolbar button, and an AI helper. All of them require the parent, and all match its Drupal range except the AI one, which declares ^11.2 only because its own dependency does.

Requirements

UtiliKit requirements, read from utilikit.info.yml and composer.json
ItemValue
Drupal core^11.2 || ^12
PHP>=8.1
Module dependenciesNone declared
Configuration routeutilikit.settings

Drupal 10 is not supported, and that is deliberate. The info.yml records the reason: renderPlain() was removed in favour of renderInIsolation(), and the REQUIREMENT_* constants were replaced by the RequirementSeverity enum, which does not exist before 11.2. There is no single constraint that covers both 10.x and 12, and advertising a core version the code fatals on is worse than not being offered at all.

Common questions

Do these classes survive the text format filter?

Only if your text format allows class attributes on the elements you are using. On a restricted format such as Drupal's default basic HTML, a class attribute is stripped and the utility never reaches the browser. Check the format before concluding the module is broken.

Does it work with Layout Builder and Paragraphs?

Paragraphs are one of the three entity types with an auto-update trigger, so yes for regeneration purposes. It pairs naturally with Paragraphs Bundles, where the section-level styling comes from the Display tab and per-element tweaks come from utilities.

What happens if I mistype a class?

Nothing renders, which is the correct behaviour and also the confusing one. Run drush utilikit:validate, or use the Playground sub-module, rather than guessing.

Will it fight with my theme's CSS?

With use_important on, utilities win. If your theme is losing arguments it should be winning, that is the first setting to look at — and if the symptom is broader than one rule, the diagnostic sequence in troubleshooting sub-theme CSS applies unchanged.

Where to go next

The UtiliKit project page lists the full class reference. Install it on a development site, turn on the Playground, and try five classes before you commit to it. If you want an opinion on whether runtime utilities belong in your build at all — there are sites where the answer is no — that is a conversation worth having before you ship it: see Drupal theming or Drupal development.

UtiliKit is my module, which is why this page is blunt about the bug it still has. I have worked in web development since 2005 and I am the author of Drupal modules and themes — see my drupal.org profile.

Drupal Layout
Slide 1 of 27
Acquia Purge Varnish - API V2 (Drupal Module)
Slide 2 of 27
Amun - W3CSS Sub-Theme (Drupal Theme)
Slide 3 of 27
Amunet - W3CSS Sub-Theme (Drupal Theme)
Slide 4 of 27
Anhur - W3CSS Sub-Theme (Drupal Theme)
Slide 5 of 27
Cloudflare Purge (Drupal Module)
Slide 6 of 27
Module Matrix (Drupal Module)
Slide 7 of 27
Paragraphs Bundles (Drupal Module)
Slide 8 of 27
Paragraphs Bundles Import (Drupal Module)
Slide 9 of 27
Reference Blocked Users (Drupal Module)
Slide 10 of 27
Selectify (Drupal Module)
Slide 11 of 27
Solo (Drupal Theme)
Slide 12 of 27
Solo Copy Blocks (Drupal Module)
Slide 13 of 27
Solo Utilities (Drupal Module)
Slide 14 of 27
Utilikit (Drupal Module)
Slide 15 of 27
Views 3D Carousel (Drupal Module)
Slide 16 of 27
Views 3D FlipBox (Drupal Module)
Slide 17 of 27
Views Accordion (Drupal Module)
Slide 18 of 27
Views Carousel (Drupal Module)
Slide 19 of 27
Views Hero (Drupal Module)
Slide 20 of 27
Views Lightbox (Drupal Module)
Slide 21 of 27
Views Parallax (Drupal Module)
Slide 22 of 27
Views Reveal (Drupal Module)
Slide 23 of 27
Views Slideshow (Drupal Module)
Slide 24 of 27
Views Tabs (Drupal Module)
Slide 25 of 27
VVJ Core (Drupal Module)
Slide 26 of 27
W3CSS Paragraphs (Drupal Module)
Slide 27 of 27
W3CSS Theme (Drupal Theme)
1 of 27

Our mission is to make Drupal more accessible and user-friendly, empowering businesses of all sizes, especially small enterprises with powerful tools that streamline content customization and enhance digital experiences.

Need help with your Drupal project? Hire Me through Flash Web Center, LLC.

Search

The Drupal 11 Module and Theme Stack, With Versions Checked

ARIA Live Regions in Drupal 11: What Core Does, What You Add

Drupal Architect: The Decisions Expensive to Reverse

Drupal Services: Development, Theming, Upgrades | Austin TX

Paragraphs Bundles

Drupal Module - Paragraphs Bundles

Drupal Theme - Solo

Drupal Theme - Solo

Drupal Work List - Drupal Work

Reference Blocked Users (Drupal Module)

Solo Utilities (Drupal Module)

Views Hero (Drupal Module)

Solo (Drupal Theme)

Paragraphs Bundles Import (Drupal Module)

Drupal Theme - W3CSS Theme

Drupal Theme - W3CSS Theme

Drupal Module - W3CSS Paragraphs

Drupal Module - W3CSS Paragraphs

Inspiration

Inspiration is the fuel that powers our creative engine, often coming from our surroundings, experiences, or the works of others. It's that magical moment when something clicks inside your brain, and you suddenly see a path forward that you hadn't noticed before. Inspiration can strike at any time, providing the motivation and energy needed to explore new possibilities and bring your ideas to life.

Unique Ideas

Unique Ideas

Unique ideas are the seeds of innovation, representing original thoughts or concepts that stand out from the usual. They're the sparks that ignite the process of creating something new and different, often leading to unexpected and groundbreaking solutions or products. Whether in art, science, business, or technology, unique ideas challenge the status quo and pave the way for progress.

Brainstorming

Brainstorming

Brainstorming is a creative group activity designed to generate a large number of ideas or solutions to a problem. It's a free-flowing and open-ended discussion where every suggestion is welcomed and considered, no matter how outlandish it may seem. Brainstorming encourages thinking outside the box, fostering an environment where creativity and collaboration lead to innovative solutions.

Planning

Planning

Planning is the blueprint for turning your ideas into reality. It involves setting goals, outlining steps, and organizing resources in a way that makes achieving your objectives possible. Good planning considers potential challenges and opportunities, making it easier to navigate the journey from concept to completion. It's about preparing the groundwork so that your projects can grow and flourish.

Drupal Developer

A Drupal Developer stands as the technical powerhouse behind dynamic websites, wielding expertise in PHP, custom module development, and Drupal's sophisticated API ecosystem. This role transforms business requirements into functional, secure, and scalable web solutions that power everything from small business sites to enterprise platforms serving millions of users. A Drupal Developer's expertise spans the entire development lifecycle—from architecting custom modules and integrating third-party services to optimizing performance and ensuring security compliance. Discover the complete guide to Drupal Developer skills, career paths, and hiring strategies.

Drupal Themer

A Drupal Themer serves as the artistic craftsperson who transforms wireframes and design mockups into pixel-perfect, accessible, and responsive user experiences using Twig templates, CSS, and JavaScript. This specialized role bridges the gap between design vision and technical implementation, ensuring every website not only looks exceptional but performs flawlessly across all devices and meets WCAG accessibility standards. A Drupal Themer's work encompasses the entire front-end ecosystem—from creating custom theme architectures and optimizing Core Web Vitals to implementing complex responsive designs and ensuring seamless integration with Drupal's rendering system. Explore the comprehensive guide to Drupal Themer expertise, theming best practices, and career advancement.

Drupal Architect

A Drupal Architect emerges as the strategic visionary of web construction, armed with encyclopedic knowledge of enterprise architecture patterns, infrastructure design, and Drupal's extensive technological ecosystem. This senior role operates at the highest technical level, making critical decisions that determine whether complex implementations scale successfully or collapse under real-world demands. A Drupal Architect's responsibilities begin long before development starts—during strategic planning phases where the foundation for secure, performant, and maintainable systems is established through careful evaluation of technology stacks, integration strategies, and scalability requirements. Learn about Drupal Architect skills, enterprise architecture strategies, and career progression to principal roles.

Footer menu

  • Contact
  • Professional Resume
  • Resume Summary
  • Technical Skills
  • Privacy Policy
  • Terms & Conditions
  • Search
  • Login
  • Sitemap

Copyright © 2026 Flash Web Center, LLC - All rights reserved

Developed & Designed by Alaa Haddad