[v4] How to "uncolour" typography plugin in CSS? #15330
Unanswered
radiosilence
asked this question in
Help
Replies: 2 comments
-
Here's a sort of answer, it's also a little unwieldy but I got rid of the config/css and went with this:
<article
class={cx(
"prose",
"prose-sm",
"max-w-screen-lg",
"prose-h1:text-inherit",
"prose-h2:text-inherit",
"prose-h3:text-sm",
"prose-body:text-inherit",
"prose-strong:text-inherit",
"prose-h2:text-inherit",
"prose-h3:text-inherit",
"prose-h4:text-inherit",
"prose-code:text-inherit",
"prose-quotes:text-inherit",
"text-inherit",
cls,
)}
{...rest}>
<slot />
</article>
It would be nice if there was a prose theme that did this though, I couldn't see one in the docs. I've done a PR on the lib to add an |
Beta Was this translation helpful? Give feedback.
0 replies
-
Ok having looked into the generated CSS, it seems like this is more idiomatic: @layer utilities {
.prose {
color: inherit;
--tw-prose-body: inherit;
--tw-prose-headings: inherit;
--tw-prose-lead: inherit;
--tw-prose-links: inherit;
--tw-prose-bold: inherit;
--tw-prose-counters: inherit;
--tw-prose-bullets: inherit;
--tw-prose-hr: inherit;
--tw-prose-quotes: inherit;
--tw-prose-quote-borders: inherit;
--tw-prose-captions: inherit;
--tw-prose-kbd: inherit;
--tw-prose-kbd-shadows: inherit;
--tw-prose-code: inherit;
--tw-prose-pre-code: inherit;
--tw-prose-pre-bg: inherit;
--tw-prose-th-borders: inherit;
--tw-prose-td-borders: inherit;
--tw-prose-invert-body: inherit;
--tw-prose-invert-headings: inherit;
--tw-prose-invert-lead: inherit;
--tw-prose-invert-links: inherit;
--tw-prose-invert-bold: inherit;
--tw-prose-invert-counters: inherit;
--tw-prose-invert-bullets: inherit;
--tw-prose-invert-hr: inherit;
--tw-prose-invert-quotes: inherit;
--tw-prose-invert-quote-borders: inherit;
--tw-prose-invert-captions: inherit;
--tw-prose-invert-kbd: inherit;
--tw-prose-invert-kbd-shadows: inherit;
--tw-prose-invert-code: inherit;
--tw-prose-invert-pre-code: inherit;
--tw-prose-invert-pre-bg: inherit;
--tw-prose-invert-th-borders: inherit;
--tw-prose-invert-td-borders: inherit;
}
} |
Beta Was this translation helpful? Give feedback.
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.
-
In TW3 I had to awkwardly iterate over the various vars in typography to stop it deciding to colour my prose so it inherited from the rest of the website like this:
Which was non-ideal, but it did at least work.
I am trying to do this in TW4 which would logically be:
However this does nothing. Is there a way to strip tailwind typography of its colouring?
Beta Was this translation helpful? Give feedback.
All reactions