@import CSS at-rules are stripped from global CSS managed in code editor

Created on 4 July 2025, 2 days ago

Overview

When @import CSS at-rules are entered under the code editor's Global CSS tab, they get stripped in the compiled version.

We run the global CSS through the Tailwind CSS build to allow users configuring Tailwind CSS theme variables. We do this via a package we created, tailwindcss-in-browser, where the final CSS for compilation is composed in the following order:

  1. Tailwind Preflight (Tailwind's base styles and CSS reset)
  2. Tailwind's default theme variables
  3. Global CSS entered in code editor
  4. @tailwind utilities – which is the layer to generate the utility classes

Browsers require @import CSS at-rules to be defined before any other rules. If that is not the case, the Tailwind build removes them.

Proposed resolution

Extract @import at-rules from the global CSS and add them before everything else in the CSS composed for the Tailwind build. The work has been done in tailwindcss-in-browser, so this issue is here to update to its 0.3.0 version.

User interface changes

n/a

🐛 Bug report
Status

Active

Version

0.0

Component

Theme builder

Created by

🇳🇱Netherlands balintbrews Amsterdam, NL

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024