---
title: "CSS for Drupal Themes: Best Practices 2026"
lang: en
type: knowledge
canonical: https://www.arocom.de/en/knowledge/development/css
alternate: https://www.arocom.de/wissen/entwicklung/css
author: "Axel Roth"
last_updated: 2026-10-31
---

# CSS for Drupal Themes: Best Practices 2026

CSS defines the visual appearance of your Drupal website. Modern CSS with
Custom Properties, Container Queries and Cascade Layers makes Drupal themes
maintainable and performant. Since 2012, arocom has developed CSS
architectures for over 160 Drupal projects that are responsive, accessible
and scalable for teams. A well-thought-out CSS strategy reduces load times,
simplifies redesigns and gives editors consistent layout options in the
backend.

## CSS for Drupal Themes: Best Practices 2026

CSS is the language that gives your Drupal website its appearance.
Fonts, colors, layouts, spacing, animations: everything is
controlled via CSS. While HTML defines the structure and PHP
provides the logic, CSS is responsible for the presentation.

In Drupal projects, CSS is more than styling: it affects load
times, accessibility and your team's ability to evolve the theme.

## CSS 2026: What Has Changed

CSS has evolved massively in recent years. Features that previously
required preprocessors like Sass are now natively available:

Custom Properties (CSS variables) enable a central design token
system. Colors, font sizes and spacing are defined once and
referenced everywhere.

Container Queries allow components to respond to the size of
their container, not just the viewport width. This makes
component-based design more flexible than Media Queries.

Cascade Layers organize specificity in layers. Base styles,
theme styles and utility classes are prioritized without
specificity conflicts.

These features make CSS more powerful and reduce dependency on
build tools. For Drupal themes, this means: less complexity in
tooling, more control in the stylesheet.

## CSS Architecture in Drupal Projects

Drupal comes with its own asset management. CSS files are defined
as libraries and loaded only where needed. This is the foundation
for performant stylesheets.

At arocom, we structure CSS by components: each UI component has
its own stylesheet, included via Drupal's library system. The
result: only the CSS needed on a page is loaded there.

Naming conventions like BEM (Block, Element, Modifier) create
clarity in the team. Every developer knows where a style is
defined and what impact a change will have.

Critical CSS for the above-the-fold area is delivered inline.
The rest is loaded asynchronously. This improves the Largest
Contentful Paint (LCP) and thus the Core Web Vitals.

### Your next step

Is your CSS architecture scalable? The [Drupal Future Check](https://www.arocom.de/en/future-check)
analyzes theme structure and performance, and identifies
CSS-related optimizations.

**From arocom projects:**

- For [d&b audiotechnik](https://www.arocom.de/en/references/db-audiotechnik) (Backnang) we built several configurators, process tools, and intranet solutions on/with Drupal, the architecture we put in place back in 2018 still holds today without refactoring and keeps up with every new major version.
- Sometimes 'less Drupal' is the right answer: for d&b's venues DB we deliberately wrote only 4 custom modules and leaned on standard ones (Entity Browser, Imagemagick). Today the platform is near maintenance-free and survives each Drupal major version with minimal effort.

### Do we still need Sass for Drupal themes?

Not necessarily. Custom Properties, nesting and Container Queries cover most use cases that previously required Sass. arocom uses native CSS with Custom Properties and forgoes preprocessors in new projects when requirements allow.

### How do we reduce CSS file size?

Drupal's asset aggregation combines and minifies CSS files. Component-based CSS architecture loads only required styles. Critical CSS inline, the rest asynchronous. PurgeCSS removes unused rules. These measures reduce the CSS payload by 60-80%.

### What are Container Queries and do we need them?

Container Queries allow a component to adapt its layout to the size of its container, not the viewport width. This is particularly useful in Drupal, where the same component is used in different layouts (sidebar, main area, grid).

## Read more

- [Frontend Development with Drupal](https://www.arocom.de/en/knowledge/development/frontend): Theming, JavaScript and components
- [UX Design for Drupal](https://www.arocom.de/en/knowledge/development/ux-design): Design as user experience
- [Domain Strategy](https://www.arocom.de/en/knowledge/development/domain): Technical foundations before the relaunch
