-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
<ol> style type based on type
attribute
#7542
Comments
I have gone and deleted the comment because it seemed to contain a link to a dodgy website hidden behind a blt.ly link. The text around the link does not seem to have anything to do with the question, so, um, a bot? @joapuiib, perhaps also remove the link from our last comment so no one clicks on it? |
I've removed my comment as well. Thanks! |
On the substance of your question: I see that this is getting factored into |
It is definitely something I am exploring. A simple override is all that is required to get them working. I don't think lists anywhere are getting I am still playing around with things, but I imagine if I pull the trigger on this extension some people may disable extra list types or not use the extension. It wouldn't surprise if some people don't opt-in to extra list types because they don't want to add another plugin, they use some other list plugin for some other feature, or simply don't want to use it because their editor won't automatically highlight the new list types in Markdown. It's an interesting idea for those who want list control, but not everyone has this need. The plan would be to only support the additional list types of both uppercased and lowercased alphatically sorted lists (a-z) and Roman numeral lists. |
I guess if people want to override it now, all they need is: .md-typeset {
/* Override Material's list type preference. */
ol ol[type]{
// Nested ordered list
list-style-type: revert-layer;
// Triply nested ordered list
ol[type] {
list-style-type: revert-layer;
}
}
} |
Actually, it is even easier (I didn't account for /* Override Material's list type preference. */
.md-typeset {
ol[type]{
// Nested ordered list
list-style-type: revert-layer;
}
} |
Thanks for reporting. As mentioned, we could probably defensively scope our styles to Would somebody like to propose a PR? |
I'll try in the next few days! Thanks you all for your feedback! |
I was working on other issues and also fixed this in 68b6758. In this commit, I've also added the same fix to the list style type of |
Note that I used |
I didn't even notice that was what I used...either way, looks great! |
Released as part of 9.5.36. |
@squidfunk this doesn't actually end up working so great. What this fix does is reverts all list items to numerical, but it does so in a way where browsers do not register that an While it may have been an accident on my part, Anyway, I'm not sure how Material wants to handle this, but I'll at least let you know my direction as I need to have this feature just work for people, and luckily there are things I can do to make this happen. Browsers have a problem that for some reason they are dragging their feet on fixing. Only Firefox seems to support the case-senstive Because of the poor browser support, though it looks like
|
Maybe a misunderstanding then? It worked when I've tested it and resets to numerical formatting because of the caveats mentioned in #7542 (comment). Could you please provide examples that showcase how it does not work?
I tried to make it as backward compatible as possible, and if we'd scope to |
Here is an example that illustrates what I'm talking about. https://codepen.io/facelessuser/pen/rNbZGQZ It's possible it works as you intend, it doesn't work at least how I thought it would or I needed. Either way, I'll have a workaround. I guess with your approach, That's okay, maybe the intention is the user can just add the CSS they want, but if you use CSS to target the lists, you are limited as you can target
That leaves me with either forcing the style and/or generating classes so users can target the elements with CSS. Either of these are okay. In short, the recent fix does not give the full flexibility that I would want or expect, but that may be a limitation that we are stuck with in Material until browsers can finish doing things like give us the |
You know, you are absolutely right. I'm not sure why I didn't catch this, but yes, we need |
Reopening until released. |
Excellent! That will give a better experience. If there are some browsers that don't support |
Released as part of 9.5.37. |
Context
I'm using a Markdown extension that allows writing different types of lists.
<ol type="a">
<ol type="A">
<ol type="i">
<ol type="I">
Description
The following CSS overrides the default list styles, so the first nested
<ol>
will always be rendered as alphabetic regarding thetype
attribute.mkdocs-material/src/templates/assets/stylesheets/main/_typeset.scss
Lines 331 to 339 in c6286de
Could this be set only if
<ol>
doesn't have a specifictype
?Related links
Use Cases
For example, writing:
Will result on:
Instead of:
Which might not always be desirable.
Visuals
No response
Before submitting
The text was updated successfully, but these errors were encountered: