Skip to content

[v4] Split theming across multiple files #17827

Answered by adamwathan
severinlandolt asked this question in Help
Discussion options

You must be logged in to vote

In my mental model, I should be able to split this up like this for example:

Yep this looks like it should work to me — is there any specific thing you're trying that doesn't work?

Don't really have any "best practices" per se, can really just split things up however you like.

You should be able to simplify what you have though to this:

@import "tailwindcss";
@import "./theme.css" layer(theme);
@import "./custom-preflight.css" layer(base);
@import "./animation.css" layer(base);
@import "./utilities.css" layer(utilities);

:root {
  --ds-gray-100: oklch(0.961 0 0);
}

.dark {
  --ds-gray-100: oklch(0.218 0 0);
}

Our main CSS export will define all the layers and stuff for you 👍

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@severinlandolt
Comment options

@dvzrd
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by severinlandolt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants