list-group.less 1.8 KB
Newer Older
A
azhi 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
//
// 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
// -------------------------

.list-group-item 
{
  position: relative;
  display: block;
  padding: 10px 15px;
  // Place the border on the list items and negative margin up for better styling
  margin-bottom: -1px;
  background-color: @list-group-bg;
  border: 1px solid @list-group-border;

  // Round the first and last items
  &:first-child { .border-top-radius(@list-group-border-radius); }
  &:last-child  { margin-bottom: 0; .border-bottom-radius(@list-group-border-radius); }

  // Align badges within list items
C
Catouse 已提交
33 34
  > .label-badge { float: right; }
  > .label-badge + .label-badge { margin-right: 5px; }
A
azhi 已提交
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51

  // Linked list items
  a& 
  {
    color: @list-group-link-color;
    .list-group-item-heading { color: @list-group-link-heading-color; }
    // Hover state
    &:hover,
    &:focus { text-decoration: none; background-color: @list-group-hover-bg; }
  }

  // Active class on item itself, not parent
  &.active,
  &.active:hover,
  &.active:focus 
  {
    z-index: 2; // Place active items above their siblings for proper border styling
C
Catouse 已提交
52 53 54
    background-color: @component-active-bg;
    border-color: @component-active-bg;
    color: @component-active-color;
A
azhi 已提交
55 56

    // Force color to inherit for custom content
C
Catouse 已提交
57 58
    .list-group-item-heading { color: @color-fore; }
    .list-group-item-text { color: darken(@color-fore, 10%); }
A
azhi 已提交
59 60 61 62 63 64
  }
}

// Custom content options
// -------------------------

C
Catouse 已提交
65
.list-group-item-heading { margin-top: 0; margin-bottom: 5px; color: @color-gray-dark; }
A
azhi 已提交
66
.list-group-item-text { margin-bottom: 0; line-height: 1.3; }