Allow opting out of prose styles (allow class="not-prose")
i
iliana
started a topic
about 1 month ago
Cohost uses tailwindcss-typography to provide default, mostly-sensible styling for posts. However there are situations where it might be nice to opt-out of this styling; for instance, the first and last <p> tag of a <blockquote> get quote marks added around them, and <code> tags get backticks surrounding them. These rules can't be overridden because inline styles cannot control the ::before and ::after pseudoelements.
tailwindcss-typography has a built-in opt-out for all of the added prose rules. Elements with the class "not-prose", and all their children, get opted out of (all? most?) of the CSS rules.
However the class attribute is stripped from elements. My suggestion is to allow the not-prose class to be used in the markdown filter.
(I had initially hoped that ~= meant "contains not-prose", so that you could allow classes as long as they had user-content- prepended to them like the id attribute. Alas. Alternately, I think the name of the selector is configurable.)
21 people like this idea
1 Comment
M
Malnormalulo
said
about 1 month ago
PLEASE. The backticks in particular really irk me. There have been times I've used explicit <code> tags and been aghast to find it inserting backticks where none were ever present.
iliana
Cohost uses tailwindcss-typography to provide default, mostly-sensible styling for posts. However there are situations where it might be nice to opt-out of this styling; for instance, the first and last <p> tag of a <blockquote> get quote marks added around them, and <code> tags get backticks surrounding them. These rules can't be overridden because inline styles cannot control the ::before and ::after pseudoelements.
tailwindcss-typography has a built-in opt-out for all of the added prose rules. Elements with the class "not-prose", and all their children, get opted out of (all? most?) of the CSS rules.
However the class attribute is stripped from elements. My suggestion is to allow the not-prose class to be used in the markdown filter.
(I had initially hoped that ~= meant "contains not-prose", so that you could allow classes as long as they had user-content- prepended to them like the id attribute. Alas. Alternately, I think the name of the selector is configurable.)
21 people like this idea