-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
lists.scss: reset <ol> without 'type' attr to "decimal" #1420
Conversation
🦋 Changeset detectedLatest commit: 55302dc The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Tried the reproduce this issue and yes... the following
saved as I guess this logic comes from css/src/base/typography-base.scss Lines 49 to 59 in efbd3a6
|
src/markdown/lists.scss
Outdated
@@ -26,6 +26,12 @@ | |||
list-style-type: lower-roman; | |||
} | |||
|
|||
// Reset <ol> style to decimal (HTML default) specifically for AsciiDoc | |||
// <div><ol> construction (doesn't affect MarkDown) | |||
div ol:not([type]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it seems the <div>
as a wrapper is the only thing that differentiates AsciiDoc and MarkDown. @hpalacio Should we use the >
child selector to make it even more specific?
div ol:not([type]) { | |
div > ol:not([type]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely! I missed that.
Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed-up the commit with child selector div > ol
HTML default list-style-type is "decimal" when there is no 'type' attribute. In MarkDown language, you can't specify the style type of a list item, so nested lists *always* represent with decimal numbers at any level. Since this is not user friendly, GitHub CSS styling overrides the HTML standard by setting lower-roman for second-level items and lower-alpha for third-level items. In AsciiDoc language, you can specify the style type of a list item using a tage before the list, for example: Tag Produces [loweralpha] <ol type="a"> [lowerroman] <ol type="i"> [decimal] <ol> The [decimal] tag doesn't generate any 'type' attribute because the HTML standard when there is no type, *is* decimal. If such a [decimal] tag is used on a second-level or third-level item, GitHub CSS for MarkDown overrides HTML standard and you get instead a lowerroman or loweralpha sign. The added CSS resets the list-style-type of <ol> without type to decimal, as it should be in the first place, for the construction div > ol, which is only produced by AsciiDoc files, to avoid any effect on existing MarkDown files. Signed-off-by: Hector Palacios <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I think this is good to go. 🚢 @hpalacio thanks 🙇
HTML default list-style-type is "decimal" when there is no 'type'
attribute.
In MarkDown language, you can't specify the style type of a list
item, so nested lists always represent with decimal numbers at
any level. Since this is not user friendly, GitHub CSS styling
overrides the HTML standard by setting lower-roman for second-level
items and lower-alpha for third-level items.
In AsciiDoc language, you can specify the style type of a list
item using a tage before the list, for example:
The [decimal] tag doesn't generate any 'type' attribute because
the HTML standard when there is no type, is decimal.
If such a [decimal] tag is used on a second-level or third-level
item, GitHub CSS for MarkDown overrides HTML standard and you get
instead a lowerroman or loweralpha sign.
The added CSS resets the list-style-type of
<ol>
without type todecimal, as it should be in the first place, for the construction
div > ol, which is only produced by AsciiDoc files, to avoid any effect
on existing MarkDown files.