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
  • #11836
Closed
Open
Issue created Dec 11, 2013 by Administrator@rootContributor

contextual states

Created by: tlindig

Inspired by a comment from @mdo in #11731 (closed)

This general idea is what I wanted to do for contextual states—the icons—since I redid all this stuff. Will try to work it into v3.1.

I would suggest a context-depending-show-class. something like this:

.show-on-default,
.show-on-success,
.show-on-danger {
  display: none;
}

.default .show-on-default {
  display: block;
}

.success .show-on-success {
  display: block;
}

.danger .show-on-danger {
  display: block;
}

I have made an example: http://jsbin.com/efExUnO/1/edit?html,css,output

It would get big benefits of simple modifier classes, how I described it here: #11794 (closed)

May be it is necessary to restrict the affected level by adding some child and sibling selectors:

.danger > .show-on-danger,
.danger > * > .show-on-danger, 
.danger ~ .show-on-danger,
.danger ~ * > .show-on-danger {
  display: block;
}

or restrict it to .input-group:

.input-group.danger .show-on-danger {
  display: block;
}

There are so many ways, but which is the best?

Assignee
Assign to
Time tracking