-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overriding and removing defaults #60
Comments
Same issue, for my use case I need to keep the reset on |
Same sort of issue for me: I'm using a descendant selector to target children of So really I'd just like to set the max-width for prose myself. Thanks. |
@mattradford I set a max-width on the module.exports = {
typography: {
default: {
css: {
maxWidth: '65ch',
},
},
},
plugins: [
require('@tailwindcss/typography'),
],
} |
Hey thanks @StevenGFX, very helpful 👍 |
why is this still an issue... it's normal css just put |
Its not that easy. It is polluting your CSS for no reason with an extra statement that could be avoided. We would prefer clean code, that contains as little overridden statements as possible 🙃 |
One: it's pretty easy. and Two: it's in your config so I don't know how it would be polluting your CSS |
Hey! Thank you for your issue! If you want to override the full typography plugin than you can put it directly in the https://play.tailwindcss.com/cIbKOcLoO9?file=config module.exports = {
theme: {
typography: {
DEFAULT: {
css: {
pre: {
backgroundColor: 'hotpink',
},
},
},
},
},
variants: {},
plugins: [require('@tailwindcss/typography')],
} Notice that nothing "exists" except for the new styles on the If you want to keep most of it, but "remove" some of the parts, then you can put the code inside https://play.tailwindcss.com/2ZyvC8cj9g?file=config module.exports = {
theme: {
extend: {
typography: {
DEFAULT: {
css: {
pre: null
},
},
},
},
},
variants: {},
plugins: [require('@tailwindcss/typography')],
} Notice that everything of the typography styles still exist, except for the Hope this helps! |
It would be awesome if you put this into the docs. It took me a while to find this issue. |
(First reported at tailwindlabs/tailwindcss.com#492.)
I'm not sure how to override the default values and remove (a.k.a. “undefine” or “unset”) them. This is probably just a matter of clarifying the documentation.
I started with the following
tailwind.config.js
:I thought the
a
object would completely replace the.prose a
style. But I discovered that.prose a
still hadtext-decoration: underline
, which I did not want. I tried addingtextDecoration: undefined
to thea
in thetailwind.config.js
above, but that didn't change anything. Then, I addedtextDecoration: null
, and that seems to have removed thetext-decoration
. (textDecoration: false
also seems to work.)This leads to some questions:
default
overrides in thetailwind.config.js
?Maybe you just want to expand on this text in the
README.md
with a bit more detail and an example:Thanks!
The text was updated successfully, but these errors were encountered: