diff options
| author | Mark Otto <[email protected]> | 2013-12-07 14:10:41 -0800 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2013-12-07 14:10:41 -0800 |
| commit | a9b86cbfde788b2ffc066353b4f77c45345c0e78 (patch) | |
| tree | 30e0a34533685043f92f9142e98374cc48428675 /less | |
| parent | a1f737b43632f4615d54ec993dc645f858e3ca8d (diff) | |
| parent | 07de53c644b315852c5f315ab91bfd6d65660d50 (diff) | |
| download | bootstrap-a9b86cbfde788b2ffc066353b4f77c45345c0e78.tar.xz bootstrap-a9b86cbfde788b2ffc066353b4f77c45345c0e78.zip | |
Merge branch 'pr/11138'
Conflicts:
dist/css/bootstrap.min.css
dist/js/bootstrap.min.js
docs-assets/js/raw-files.js
Diffstat (limited to 'less')
| -rw-r--r-- | less/list-group.less | 26 | ||||
| -rw-r--r-- | less/mixins.less | 27 |
2 files changed, 51 insertions, 2 deletions
diff --git a/less/list-group.less b/less/list-group.less index 2cee52973..35fff05d4 100644 --- a/less/list-group.less +++ b/less/list-group.less @@ -2,17 +2,21 @@ // List groups // -------------------------------------------------- + // Base class // // Easily usable on <ul>, <ol>, or <div>. + .list-group { // No need to set list-style: none; since .list-group-item is block level margin-bottom: 20px; padding-left: 0; // reset padding because ul and ol } + // Individual list items -// ------------------------- +// +// Use on `li`s or `div`s within the `.list-group` parent. .list-group-item { position: relative; @@ -41,7 +45,12 @@ } } + // Linked list items +// +// Use anchor elements instead of `li`s or `div`s to create linked list items. +// Includes an extra `.active` modifier class for showing selected items. + a.list-group-item { color: @list-group-link-color; @@ -75,8 +84,21 @@ a.list-group-item { } } + +// Contextual variants +// +// Add modifier classes to change text and background color on individual items. +// Organizationally, this must come after the `:hover` states. + +.list-group-item-variant(success; @state-success-bg; @state-success-text); +.list-group-item-variant(warning; @state-warning-bg; @state-warning-text); +.list-group-item-variant(danger; @state-danger-bg; @state-danger-text); +.list-group-item-variant(info; @state-info-bg; @state-info-text); + + // Custom content options -// ------------------------- +// +// Extra classes for creating well-formatted content within `.list-group-item`s. .list-group-item-heading { margin-top: 0; diff --git a/less/mixins.less b/less/mixins.less index 4d045987e..4c2747268 100644 --- a/less/mixins.less +++ b/less/mixins.less @@ -437,6 +437,33 @@ } } +// List Groups +// ------------------------- +.list-group-item-variant(@state; @background; @color) { + .list-group-item-@{state} { + color: @color; + background-color: @background; + } + a.list-group-item-@{state} { + color: @color; + + .list-group-item-heading { color: inherit; } + + &:hover, + &:focus { + color: @color; + background-color: darken(@background, 5%); + } + &.active, + &.active:hover, + &.active:focus { + color: #fff; + background-color: @color; + border-color: @color; + } + } +} + // Button variants // ------------------------- // Easily pump out default styles, as well as :hover, :focus, :active, |
