question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: Unordered list item markers extend beyond list bounds

See original GitHub issue

Package

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:

image

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

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
aagonzalescommented, Jan 21, 2022

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.

image

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.

image

0reactions
tay1orjonescommented, Oct 13, 2022

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:

Maybe the list should have some left padding to offset the marker placement?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found