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
  • Issues
  • #28691
Closed
Open
Issue created Apr 25, 2019 by Administrator@rootContributor

.sr-only should use !important

Created by: Jakobud

It seems like .sr-only should explicitly use !important for all attributes. If you are using .sr-only anywhere, you want ALL of it's attributes to take priority no matter what. There are no exceptions to this.

There are many cases where server side templating logic would add the sr-only class to an element depending on various conditions. The problem here is that if that element has, for example padding on it, and this style is defined AFTER you added your Bootstrap CSS to a page, then the sr-only class is never going to have priority in the cascade, so therefore the padding: 0 that is part of the sr-only class is going to get overwritten by the padding on the element that you defined elsewhere. Does that make sense?

Assignee
Assign to
Time tracking