From 3f270d2d9b289f7a157691f6d45620673d841f2c Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Thu, 20 Feb 2025 16:57:16 +0100 Subject: [PATCH] =?UTF-8?q?Allow=20`theme(=E2=80=A6)`=20options=20when=20u?= =?UTF-8?q?sing=20`@import`=20(#16514)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR improves the developer experience when trying to use `theme(…)` options on an import. Today, if you want to use Tailwind CSS, you can import it as: ```css @import "tailwindcss"; ``` But if you want to use any of the `theme(…)` options, like the `static` theme option, then you had to use this instead: ```css @layer theme, base, components, utilities; @import 'tailwindcss/theme' layer(theme) theme(static); @import 'tailwindcss/preflight' layer(base); @import 'tailwindcss/utilities' layer(utilities); ``` In this scenario you have to be careful, because the `layer(…)` _must_ be the first option after an import (according to the spec). So if you use `@import 'tailwindcss/theme' theme(static) layer(theme);` then that's not going to work either. This PR solves that by allowing you to use the `theme(…)` options directly on the `@import` statement: ```css @import 'tailwindcss' theme(static); ``` The only edge case is when you want to use `theme(reference)`. A typical use case is for projects with `