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
[Feature proposal] Prose core plugins #45
Comments
|
This sounds ideal, really. I'm running into the same problem trying to implement Prism. I'm working typography into two different projects and I've found I'm making a lot of overrides in my config file that could be avoided if it was structured more like Tailwind itself. Especially for this use case. I really just want to nuke all code/pre styling. |
|
I'm not sure I understand the proposal, can you provide an example of what you mean? Where do "prose core plugins" live, how are they configured, how does the user interact with the, what is a concrete example of a prose core plugin? To disable the code colors that are fighting with Prism you should just need to do this: |
As I said earlier: if I overwrite This is the code I have for code: {
backgroundColor: defaultTheme.colors.gray[200],
borderRadius: defaultTheme.borderRadius.default,
paddingLeft: defaultTheme.spacing[1],
paddingRight: defaultTheme.spacing[1],
display: 'inline-block',
lineHeight: defaultTheme.lineHeight['snug'],
},Now Prism selectors also have less specificity because they are targeting elements like Core pluginsI will work to improve my proposal as I'm not familiar with the inner working of the
module.exports = {
corePlugins: {
float: false,
objectFit: false,
objectPosition: false,
}
}
theme: {
extend: {},
typography: {
corePlugins: {
code: false,
lists: false,
},
default: {This way I could completely disable all styles related to I'll refine this idea and call back. |
|
Hi everyone! Does anyone found a solution to this issue? |
|
This comment was quite helpful for me: tailwindlabs/tailwindcss#2021 (reply in thread) |
|
Hey all, I am going to close this issue, as it hasn't really gone anywhere. Plus, since this has been posted we've made big changes to this plugin (see here), making it easier than ever to customize the typography styles 💪 That said, reviewing this issue myself, I'm not sure if Adam's point was fully understood. Adam is not suggesting that you overwrite the styles that are applied for the
By setting all the values to |
I'm trying to add Prism to highlight code (using the same package as you guys are using for the blog,
@mapbox/rehype-prismwith Next).The problem I'm facing is that the classes added by the highlight styles are overwritten by
preandcodestyles inside prose.Also, overwriting typography styles in
tailwind.configonly work to certain extent, as code styles leak to other selectors: if I overwritepre codestyles so code boxes have one style, while small snippets using justcodehave another, the styles from the later would be inherited.Edit: as configs are always merged, there isn't a way to completely overwrite a rule without specific styles, as it will be added back again.
Possible solution
I was thinking about "prose core plugins": it's the same concept as Tailwind CSS, but would be applied to certain components like: headings, table, code, lists and text(?)
This way you could easily remove certain styles and provide your own.
Expand Prism theme CSS
The text was updated successfully, but these errors were encountered: