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
  • !31676

Make `.list-group-item-action` in `.list-group-item` fill their conta…

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/goulvench/patch-1 into main Sep 16, 2020
  • Overview 1
  • Commits 9
  • Pipelines 0
  • Changes 2

Created by: goulvench

List-groups can either contain <li class="list-group-item"> or links, but not both. The proposed change allows using either text or links in a <ul class="list-group">, by moving padding from the containing <li class="list-group-item"> to the contained <a class="list-group-item-action"> when it is the only direct child.

This allows the following HTML to display nicely:

<ul class="list-group">
   <li class="list-group-item">Some text here</li>
   <li class="list-group-item">
      <a href="#" class="list-group-item-action">A link that spans the entire `<li>`</a>
   </li>
</ul>

I'm using this in a project, and thought it might serve others as well.

Any improvement to make? For instance, I'm wondering if the :only-child selector covers all likely use cases.

As an aside, this would help with issue #21755 (closed)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/goulvench/patch-1