Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !32244

Tweak `list-group` to show numbers on list items when used on an `<ol>`

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Patrick H. Lauke requested to merge patrickhlauke-issue26202 into main Nov 24, 2020
  • Overview 1
  • Commits 5
  • Pipelines 0
  • Changes 2

Closes #26202 (closed)

Per my comment there, I'm not sure which approach would be best/most palatable to take. This PR goes for the simplest/most surgical one, but I know this goes against the grain of targetting specific elements and using child selectors. Then again, the alternative becomes overly verbose...

the simplest would be modifying the list-group css styles to special-case if they're applied to <ol> rather than <ul>...something like

ol.list-group > .list-group-item {
  display: list-item;
  list-style-position: inside;
}

but i know we've been keen to avoid modifying the styles of bootstrap's classes based on which element they've been applied to. so...do we instead propose a whole separate set of styles? .list-group-ordered ? which replicates all the styles of .list-group, but then overrides this aspect?

.list-group-ordered > .list-group-item {
 display: list-item;
 list-style-position: inside;
}

or do we do a modifier hanging off of .list-group-item? .list-group-item-ordered? to be used perhaps in conjunction with .list-group-item, so you'd end up with lengthy constructs like <li class="list-group-item list-group-item-ordered"> ?

.list-group-item-ordered {
 display: list-item;
 list-style-position: inside;
}

basically, there's variations on how we want to get to it. depends on the philosophical approach you want to take (purity of the CSS no referencing elements/special casing based on markup? a whole new set of classes? a modifier?)

Preview: https://deploy-preview-32244--twbs-bootstrap.netlify.app/docs/5.0/components/list-group/#basic-example

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: patrickhlauke-issue26202