-
Notifications
You must be signed in to change notification settings - Fork 294
How to remove backquote around inline code? #18
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
Comments
Can you create a GitHub repo that reproduces this? I just tried it on our blog and was able to override it no problem with your exact code. |
Hi @dpyzo0o, if you add typography: {
default: {
css: {
code: {
'&::before': {
content: '"" !important',
},
'&::after': {
content: '"" !important',
},
}
// ...
},
},
}, I was able to reproduce your issue though, I think the problem is that the new class gets added before the typography plugin class and thus overwriting it. |
@vincentdoerig Yes, adding // tailwind.config.js
module.exports = {
theme: {
typography: {
default: {
css: {
code: {
'&::before': {
display: 'none',
},
'&::after': {
display: 'none',
},
}
// ...
},
},
},
},
plugins: [
require('@tailwindcss/typography'),
// ...
],
} @adamwathan I'm sure this issue is reproducible, here is a minimal repo that reproduces the issue, https://github.com/dpyzo0o/tailwindcss-bug-reproduce |
@adamwathan some findings... Writing in this way will correctly overwrite the original style. Seems like using // tailwind.config.js
module.exports = {
theme: {
typography: {
default: {
css: {
'code::before': {
content: '""',
},
'code::after': {
content: '""',
}
// ...
},
},
},
},
plugins: [
require('@tailwindcss/typography'),
// ...
],
} |
Ah yeah you know what I think I wrote it that way when I was testing things out, so I was wrong when I said I used your code exactly 🤦 It looks like this is due to a particular detail of how deep merging works in lodash, which causes object properties to be merged in a different order than I'd expect (overrides are added as earlier keys in the object being merged to, not later). For now I would recommend mimicking the exact selector we use in the EDIT: Actually doesn't seem like a lodash issue, not sure where this order issue pops up, might be in postcss-js. Will explore. |
Actually I know exactly what is happening now, sorry. Your changes are being merged with our existing Here's our code:
When you're code is merged in, it creates this object:
So when it's all flattened out, our existing Going to close this for now since there's a solution (use our keys) and I can't say for sure we are going to take action on it. |
Hello, we have the same problem in that all our inline code is showing backticks, which we don't want. You mentioned that you have a solution: use our keys. Please can you explain this? I've gone through all the above and we still see backticks everywhere. |
Apologies, I made a mistake in the // tailwind.config.js
module.exports = {
theme: {
typography: {
default: {
css: {
'code::before': {
content: '""',
},
'code::after': {
content: '""',
},
},
},
},
},
plugins: [require("@tailwindcss/typography")],
}; |
@Waterdrips ☝️ this should do the trick? |
This did not work for me (TW2.0) - when I was adding this to my tailwind config, it completely broke all styles. // tailwind.config.js
module.exports = {
theme: {
extend: {
typography: {
DEFAULT: {
css: {
'code::before': {
content: '""'
},
'code::after': {
content: '""'
}
}
}
},
},
},
plugins: [require("@tailwindcss/typography")],
}; |
For v3, this works for me. |
I know, I'm a little bit late to the party. But in case someone is interested in this. You can suppress the backticks with |
By default taiwind css surounds inline code with backticks. In order to have a more GitHub-like experience, as suggested by @MisterDA in #612 the tailwind configuration needs to be changed as explained here: tailwindlabs/tailwindcss-typography#18
* Remove backticks around inline code fragments By default, TailwindCSS surrounds inline code with backticks. In order to have a more GitHub-like experience, as suggested by @MisterDA in #612 the tailwind configuration needs to be changed as explained here: tailwindlabs/tailwindcss-typography#18 Co-authored-by: Cuihtlauac ALVARADO <cuihtmlauac@tarides.com> Co-authored-by: Thibaut Mattio <thibaut.mattio@gmail.com>
But not too late! Thanks! |
This did the trick! Thank you! |
See here for solution: tailwindlabs/tailwindcss-typography#18 (comment)
This worked! Thank you so much!!!! |
Thanks, you save my life |
These classes didn't work for me in v4. Here is what I used instead to kill it from the root: @utility prose {
code {
&::before,
&::after {
content: none;
}
}
} |
Perfect, @kerryj89. I'm using v4 too, it worked well. |
The default style of inline code has backquotes which I do not want. I tried to override it with the following configuration but it does not work.
The text was updated successfully, but these errors were encountered: