-
-
Notifications
You must be signed in to change notification settings - Fork 184
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
How do I use plugins to set default list style? #120
Comments
Try something like this: module.exports = {
// theme: {},
plugins: [discChildren],
}
function discChildren({ addComponents }) {
addComponents({
'.my-class': {
'ul > li': {
listStyleType: 'disc',
},
},
})
} You'd add the class ( |
@ben-rogerson This worked, but something funny is happening. I tried to add: 'ol > li': {
listStyleType: 'decimal',
} However, it wasn't showing up. Inspecting the CSS in the browser for some reason it's not there. It feels like a caching issue, but with very peculiar behavior because if I change the 'ul' to be decimal it still shows up as disc. I'm restarting my server and I've also tried clearing the browser cache. But I haven't been able to get the 'ol' rule to show up. EDIT: If I create a new class, then it works. something is caching the rule somewhere. this works: function discChildren({ addComponents }) {
addComponents({
'.my-class': {
'ul > li': {
listStyleType: 'disc',
},
'.my-class-2': {
'ol > li': {
listStyleType: 'decimal',
},
},
})
} does not work: function discChildren({ addComponents }) {
addComponents({
'.my-class': {
'ul > li': {
listStyleType: 'disc', // try changing to decimal and it will stay disc
},
'ol > li': {
listStyleType: 'decimal',
},
},
})
} |
There's some Gatsby sized caching happening by the sounds, try making a change in the code to force a recompile if that doesn't work, delete your .cache and restart the server. #11 |
Turns out to be an import issue. I had never used the syntax In either case, I must But when using (Hope that wasn't too confusing) |
You can do |
I recommend having a quick read through the examples in the readme. I'm also working on some guides for the css prop and the styled import. |
I'm using a third-party component which renders
<ul><li>Stuff in here</li></ul>
with no classes or id associated. I wanted to set the default list style that tailwind erases in base style to disc.I tried doing this:
But I must be misunderstanding how to use these methods because this and everything I've tried have not worked.
Am I on the right track or way off? What am I missing? (using 1.7.0)
The text was updated successfully, but these errors were encountered: