-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix(list): correct list alignment and numbering #4485
fix(list): correct list alignment and numbering #4485
Conversation
Deploy preview for carbon-elements failed. Built with commit 43c42b3 https://app.netlify.com/sites/carbon-elements/deploys/5dba141aeac0160008ad8df5 |
Deploy preview for carbon-components-react ready! Built with commit 43c42b3 https://deploy-preview-4485--carbon-components-react.netlify.com |
Deploy preview for the-carbon-components ready! Built with commit 43c42b3 https://deploy-preview-4485--the-carbon-components.netlify.com |
} | ||
|
||
.#{$prefix}--list--nested { | ||
margin-bottom: rem(4px); | ||
margin-left: $carbon--spacing-07; | ||
margin-top: #{$carbon--spacing-02}; |
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.
Do these values need to be interpolated like this?
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.
no I think I carried it over from the old code and copied it in several places
&::before { | ||
position: absolute; | ||
left: -#{$carbon--spacing-05}; | ||
content: '\002013'; // – en dash |
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.
Thanks for the comment here 🙏
c6f7a53
to
8bbbf2d
Compare
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.
👍
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.
LGTM basically, just one thing to double-check - Does existing list markup work with the new style? Thanks!
as long as the correct classes are applied ( previously in our docs we were inconsistent about which |
OK let me change my question a bit... When an existing application upgrades |
yes, and the solution would be to ensure the classes are consistently applied in the list (every |
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 thanks a lot @emyarod for clarifying!
Closes #4433
Closes #3133
This PR adjusts ordered and unordered list spacing according to the updated spec and resolves a spacing issue for ordered lists with many list items. Previously we were using CSS counters and pseudo elements to replace the ordered list numbers, but since the spacing of these numbers was fixed they would overlap with the list item content if the number became large. We are no longer using pseudo elements for ordered lists and rely on the default implementation for ordered list numbering and spacing. (This may cause downstream changes for the Gatsby theme, website, and IDL site ref carbon-design-system/design-language-website#229, carbon-design-system/gatsby-theme-carbon#189)
Changelog
Changed
Removed
Testing / Reviewing
Ensure the components match the latest spec (ordered, unordered, nested, etc)
Ensure that no content overlaps with the numbers for long ordered lists