Layout von Websiten mit Bootstrap und Foundation
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

_list-group.scss 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. // Base class
  2. //
  3. // Easily usable on <ul>, <ol>, or <div>.
  4. .list-group {
  5. display: flex;
  6. flex-direction: column;
  7. // No need to set list-style: none; since .list-group-item is block level
  8. padding-left: 0; // reset padding because ul and ol
  9. margin-bottom: 0;
  10. @include border-radius($list-group-border-radius);
  11. }
  12. // Interactive list items
  13. //
  14. // Use anchor or button elements instead of `li`s or `div`s to create interactive
  15. // list items. Includes an extra `.active` modifier class for selected items.
  16. .list-group-item-action {
  17. width: 100%; // For `<button>`s (anchors become 100% by default though)
  18. color: $list-group-action-color;
  19. text-align: inherit; // For `<button>`s (anchors inherit)
  20. // Hover state
  21. @include hover-focus() {
  22. z-index: 1; // Place hover/focus items above their siblings for proper border styling
  23. color: $list-group-action-hover-color;
  24. text-decoration: none;
  25. background-color: $list-group-hover-bg;
  26. }
  27. &:active {
  28. color: $list-group-action-active-color;
  29. background-color: $list-group-action-active-bg;
  30. }
  31. }
  32. // Individual list items
  33. //
  34. // Use on `li`s or `div`s within the `.list-group` parent.
  35. .list-group-item {
  36. position: relative;
  37. display: block;
  38. padding: $list-group-item-padding-y $list-group-item-padding-x;
  39. color: $list-group-color;
  40. text-decoration: if($link-decoration == none, null, none);
  41. background-color: $list-group-bg;
  42. border: $list-group-border-width solid $list-group-border-color;
  43. &:first-child {
  44. @include border-top-radius(inherit);
  45. }
  46. &:last-child {
  47. @include border-bottom-radius(inherit);
  48. }
  49. &.disabled,
  50. &:disabled {
  51. color: $list-group-disabled-color;
  52. pointer-events: none;
  53. background-color: $list-group-disabled-bg;
  54. }
  55. // Include both here for `<a>`s and `<button>`s
  56. &.active {
  57. z-index: 2; // Place active items above their siblings for proper border styling
  58. color: $list-group-active-color;
  59. background-color: $list-group-active-bg;
  60. border-color: $list-group-active-border-color;
  61. }
  62. & + & {
  63. border-top-width: 0;
  64. &.active {
  65. margin-top: -$list-group-border-width;
  66. border-top-width: $list-group-border-width;
  67. }
  68. }
  69. }
  70. // Horizontal
  71. //
  72. // Change the layout of list group items from vertical (default) to horizontal.
  73. @each $breakpoint in map-keys($grid-breakpoints) {
  74. @include media-breakpoint-up($breakpoint) {
  75. $infix: breakpoint-infix($breakpoint, $grid-breakpoints);
  76. .list-group-horizontal#{$infix} {
  77. flex-direction: row;
  78. > .list-group-item {
  79. &:first-child {
  80. @include border-bottom-left-radius($list-group-border-radius);
  81. @include border-top-right-radius(0);
  82. }
  83. &:last-child {
  84. @include border-top-right-radius($list-group-border-radius);
  85. @include border-bottom-left-radius(0);
  86. }
  87. &.active {
  88. margin-top: 0;
  89. }
  90. & + .list-group-item {
  91. border-top-width: $list-group-border-width;
  92. border-left-width: 0;
  93. &.active {
  94. margin-left: -$list-group-border-width;
  95. border-left-width: $list-group-border-width;
  96. }
  97. }
  98. }
  99. }
  100. }
  101. }
  102. // Flush list items
  103. //
  104. // Remove borders and border-radius to keep list group items edge-to-edge. Most
  105. // useful within other components (e.g., cards).
  106. .list-group-flush {
  107. @include border-radius(0);
  108. > .list-group-item {
  109. border-width: 0 0 $list-group-border-width;
  110. &:last-child {
  111. border-bottom-width: 0;
  112. }
  113. }
  114. }
  115. // Contextual variants
  116. //
  117. // Add modifier classes to change text and background color on individual items.
  118. // Organizationally, this must come after the `:hover` states.
  119. @each $color, $value in $theme-colors {
  120. @include list-group-item-variant($color, theme-color-level($color, -9), theme-color-level($color, 6));
  121. }