Replies: 6 comments
-
|
Also, I have noticed the below
|
Beta Was this translation helpful? Give feedback.
-
|
Hello—Thanks for posting this! I tested this feature with a freshly generated theme, and it worked as expected. Here is what I did:
'typography-theme-test': {
css: {
'--tw-prose-body': '#0C0',
// ...
}
}
define(
'TYPOGRAPHY_THEME_TEST_TYPOGRAPHY_CLASSES',
'prose prose-typography-theme-test max-w-none prose-a:text-primary'
);
That resulted in this:
All of the _tw/tailwind/tailwind-theme.css Lines 20 to 26 in de60a04 If you're able to share your repository, I could take a look! I'm not seeing any obvious issues with the screenshot you posted, or in your description of what you did, though. Happy to continue working on this with you if you're able to provide more details! |
Beta Was this translation helpful? Give feedback.
-
|
Hi Thanks so much for your quick response and for testing it on your end — that’s really helpful! At the moment, we’re working on this project locally, so we don’t have a public repository we can share just yet. However, to assist with debugging, we’ll share the following files with you:
you can check this repo which contains the above files:- git repo These should reflect exactly how our typography variant and color mappings are set up. Hopefully that gives more context and helps identify where things might be going wrong on our side — especially with the light mode styles not taking effect despite using prose prose-times-crypto. this is our class, defined on function.php We appreciate your support and will follow up shortly with the files. Best regards, |
Beta Was this translation helpful? Give feedback.
-
|
Hey @gregsullivan We wanted to provide an update based on further testing: We’ve noticed that when defining custom typography styles with hardcoded color values like: Everything works as expected — both light and dark modes apply the correct styles. However, when we switch to using theme() references like: The styles no longer apply correctly. We’ve already defined these color keys (text-one, text-two, etc.) in our theme.json, and the corresponding CSS variables appear correctly in tailwind-theme.css. If you could kindly review whether this is an issue with how the theme tokens (theme('colors.x')) are being resolved in this build setup, that would be super helpful. FYI:- We generated the theme for development in the first week of May. Thanks again for your support — we really appreciate how helpful and responsive you’ve been! Best regards, |
Beta Was this translation helpful? Give feedback.
-
|
Hello Vi, I think your issue is that colors like these: --color-background: var(--wp--preset--color--background);
--color-background-dark: var(--wp--preset--color--background-dark);Create an object like this: background: {
DEFAULT: 'var(--wp--preset--color--background)',
dark: 'var(--wp--preset--color--background-dark)',
}So when you reference them here: '--tw-prose-pre-code': theme('colors.background'),You need to do so like this: '--tw-prose-pre-code': theme('colors.background.DEFAULT'),Please let me know if that works for you! |
Beta Was this translation helpful? Give feedback.
-
|
I'm going to convert this as a discussion for now, but I'm happy to convert it back if there is an issue in _tw that requires a fix! |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I’m currently working on a WordPress theme based on the _tw starter and have encountered an issue with the Tailwind Typography plugin when trying to define a custom variant (e.g., prose-custom-variant).
I’ve added a custom variant following the same structure as the default DEFAULT config, like this:
However, when I apply prose prose-custom-variant classes on the front end, the styles don’t seem to apply.
My suspicion is either:
Could you please confirm:
Theme Colors Source:
I tried adding the class prose prose-custom-variant dark:prose-invert prose-a:text-primary max-w-none but it still applies the default typography styles. I have verified the variant name matches, but it seems the styles for .prose-custom-variant are not present in the compiled CSS, which makes me think my custom typography config may not be loaded or merged correctly.
Thanks for your excellent work on _tw! I’d love to get this resolved and continue building with the theme.
Best regards,
Vi
Beta Was this translation helpful? Give feedback.
All reactions