[Bug]: Unordered list item markers extend beyond list bounds
See original GitHub issuePackage
carbon-components
Browser
Chrome
Package version
v10.47.1
Description
The top level elements of an unordered list have –
markers that end up outside the bounding box of the list.
The marker is added via :before
:
.bx--list--unordered>.bx--list__item:before {
content: "\002013";
left: -1rem;
position: absolute;
}
Maybe the list should have some left padding to offset the marker placement?
Screenshots
From live demo page:
Steps to reproduce
- Create an unordered list component with items in it or go to live demo page and set variant selector to
Unordered list
- Inspect DOM element layout of list
ul.bx--list--unordered
element
Code of Conduct
- I agree to follow this project’s Code of Conduct
- I checked the current issues for duplicate problems
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
hidden` hides list counter/point - why/is this a bug? - ...
Your understanding is correct; the list number (known in CSS as a list marker) should exist outside the p , not inside it....
Read more >list-style-position - CSS - MDN Web Docs
The list-style-position CSS property sets the position of the ::marker relative to a list item.
Read more >CSS Lists and Counters Module Level 3
Abstract. This module contains CSS features related to list counters: styling them, positioning them, and manipulating their value.
Read more >List Markers and String Styles
Other times, we choose from a very limited set of unordered list markers, such as disc , circle , or square ; or...
Read more >The Ultimate Guide to Bullet Points in HTML Email
Adding bulleted lists in emails can be trickier than you think. ... <ul> indicates an unordered list, or a bulleted list of items....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This one is interesting because I’m not really sure why the bounding box was intentionally excluding the dashes from a design perspective. I don’t think it’s a grid thing. In the original duo spec the dashes and numbers are aligned to the paragraph and title next not the list text like suggested.
So im not sure where the weird indenting came from. Might need to check some old issues.
Even on the grid the dashes shouldn’t be hanging in the gutter. That’s not typographically correct and I don’t think design would have recommended that. The dash or numbers are considered typographic elements and therefor aligning them to the other type is correct. You also need the intend for proper typographic hierarchy between a list and header or body copy. Seems like this is just a normal bug and not an intended design feature.
With that in mind, I think the original suggestion seems reasonable to explore as a fix: