components
components copied to clipboard
Tailwind prose styling causes color issues with callout children elements
When using callout components (<Note> and <Warning>), the styling of children (<strong> and <a>) is being overridden by the prose styles.
For example, the following code:
<Warning>
This is a Warning callout with **bold text** and a
[link](https://www.mintlify.com) to showcase the color issues.
</Warning>
<Note>
This is a Note callout with **bold text** and a
[link](https://www.mintlify.com) to showcase the color issues.
</Note>
produces the following:
The following css, which is prose styling, is responsible for the issue:
/** <strong> **/
.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)) {
color: rgb(var(--gray-900));
font-weight: 600;
}
/** <a> **/
.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)) {
color: var(--tw-prose-links);
text-decoration: none;
font-weight: 600;
border-bottom: 1px solid rgb(var(--primary-light));
}
Ideally the colors match the parent callout, for example:
Because custom css is not an option until the pro plan, I am hoping this can be fixed. There are a couple solutions:
- Remove the
proseclass from callouts (and add additional classes to get the same style, if needed) - Override the
prosestyles directly,.prose :where(strong) { color: inherit; } - Extend the Tailwind config and add
prose-${color}variants to each callout type
I am not sure which would be preferred but I am happy to submit a PR if you would accept!