Custom heading colors #13034
Closed
ivan-kleshnin
started this conversation in
Ideas
Replies: 1 comment
|
Solved like this: typography(theme) {
return {
slate: {
css: {
"--tw-prose-body": theme("colors.black"),
"--tw-prose-650": theme("colors.slate.650"), // ! reducing 'blackness' for very large headings
"--tw-prose-700": theme("colors.slate.700"),
"--tw-prose-750": theme("colors.slate.750"), // ! added new color steps to TW defaults
"--tw-prose-800": theme("colors.slate.800"),
"--tw-prose-850": theme("colors.slate.850"), // !
"--tw-prose-900": theme("colors.slate.900"),
},
},
invert: {
css: {
"--tw-prose-body": theme("colors.white"), // 'dark' bg is usually non-black so requires pure 'white'
"--tw-prose-650": theme("colors.white"), // for good constrast
"--tw-prose-700": theme("colors.white"),
"--tw-prose-750": theme("colors.white"),
"--tw-prose-800": theme("colors.white"),
"--tw-prose-850": theme("colors.white"),
"--tw-prose-900": theme("colors.white"),
},
},
base: {
css: {
h1: {
color: "var(--tw-prose-800)",
},
h2: {
color: "var(--tw-prose-850)",
},
h3: {
color: "var(--tw-prose-900)",
},
h4: {
color: "var(--tw-prose-950)",
}
}
}
}
} |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
1) I'd like to assign unique colors for H1-H4. For example:
slate-800for H1,slate-750for H2 and so on.2) I'd like to keep it working with
darkmodifier. It seems that both aims at the same time are currently not achievable.Builtin functionality, e.g. customization of:
satisfies 2) but not 1).
If, instead, I do this:
it achieves 1) but breaks 2).
Is there a way to assign
lightanddarkmode colors unique per H1, H2, etc?All reactions