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

v4: Simplify button states

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Mark Otto requested to merge button-states into v4-dev Dec 26, 2016
  • Overview 0
  • Commits 8
  • Pipelines 0
  • Changes 3

This PR drastically simplifies our button states to address #19189 (closed), #21235 (closed), and #21415 (closed). My hope is we can simplify the selectors, reduce the number of selectors overall, and make it easier to customize our buttons. Here's a rundown of what's changed and why.

  • Moved active state after the disabled state. This way, disabled active buttons automatically inherit the proper changes to visual styles and simply modifies the opacity. Previously we had to reset the background-color and border-color across all states.

  • Unchains the focus state from active state. There's no need to add extra selectors to the original focus state within &, &:active, &.active { ... }—we just need to set the focus styles.

  • Removes all hover, focus, and disabled styles from the active states. Now that active is after disabled in Sass, we can easily inherit the proper styles. Similarly, hover and focus will inherit automatically as well. This does remove the ability to see a hover on active, but I'm okay with that as it's more akin to native behaviors.

See the new CSS in action at https://output.jsbin.com/homiyos.

/cc @cvrebert @patrickhlauke

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: button-states