Skip to content

[v4] CSS Import and Nesting #15524

Answered by wongjn
dvzrd asked this question in Help
Dec 31, 2024 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

Is it possible to import two separate theme stylesheets and merge them into a single theme layer/reference - both stylesheets have a @theme layer but I'm unable to merge them together into a single theme when importing them

Yes, this should be possible:

/* a.css */
@theme {
  --color-foo: red;
}
/* b.css */
@theme {
  --color-bar: blue;
}
/* input.css */
@import "tailwindcss";
@import "./a.css";
@import "./b.css";

Would compile to something like:

@layer theme, base, components, utilities;
@layer theme {
  :root {
    …
    --color-foo: red;
    --color-bar: blue;
  }
}

Is nesting supposed to work without config now since lightningcss is supposed to handle nested css rule? How does this…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@dvzrd
Comment options

@wongjn
Comment options

@dvzrd
Comment options

Answer selected by dvzrd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants