_index.scss 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. //
  2. // Clearfix
  3. //
  4. .clearfix {
  5. @include clearfix();
  6. }
  7. //
  8. // Text truncation
  9. //
  10. .text-truncate {
  11. @include text-truncate();
  12. }
  13. //
  14. // Vertical rule
  15. //
  16. .vr {
  17. display: inline-block;
  18. align-self: stretch;
  19. width: $vr-border-width;
  20. min-height: 1em;
  21. background-color: currentcolor;
  22. opacity: $hr-opacity;
  23. }
  24. //
  25. // Stretched link
  26. //
  27. .stretched-link {
  28. &::#{$stretched-link-pseudo-element} {
  29. position: absolute;
  30. top: 0;
  31. right: 0;
  32. bottom: 0;
  33. left: 0;
  34. z-index: $stretched-link-z-index;
  35. content: "";
  36. }
  37. }
  38. //
  39. // Visually hidden
  40. //
  41. .visually-hidden,
  42. .visually-hidden-focusable:not(:focus):not(:focus-within) {
  43. @include visually-hidden();
  44. }
  45. //
  46. // Stacks
  47. //
  48. .hstack {
  49. display: flex;
  50. flex-direction: row;
  51. align-items: center;
  52. align-self: stretch;
  53. }
  54. .vstack {
  55. display: flex;
  56. flex: 1 1 auto;
  57. flex-direction: column;
  58. align-self: stretch;
  59. }
  60. //
  61. // Position
  62. //
  63. // Shorthand
  64. .fixed-top {
  65. position: fixed;
  66. top: 0;
  67. right: 0;
  68. left: 0;
  69. z-index: $zindex-fixed;
  70. }
  71. .fixed-bottom {
  72. position: fixed;
  73. right: 0;
  74. bottom: 0;
  75. left: 0;
  76. z-index: $zindex-fixed;
  77. }
  78. // Responsive sticky top and bottom
  79. @each $breakpoint in map-keys($grid-breakpoints) {
  80. @include media-breakpoint-up($breakpoint) {
  81. $infix: breakpoint-infix($breakpoint, $grid-breakpoints);
  82. .sticky#{$infix}-top {
  83. position: sticky;
  84. top: 0;
  85. z-index: $zindex-sticky;
  86. }
  87. .sticky#{$infix}-bottom {
  88. position: sticky;
  89. bottom: 0;
  90. z-index: $zindex-sticky;
  91. }
  92. }
  93. }
  94. //
  95. // Aspect ratio
  96. //
  97. .ratio {
  98. position: relative;
  99. width: 100%;
  100. &::before {
  101. display: block;
  102. padding-top: var(--#{$prefix}aspect-ratio);
  103. content: "";
  104. }
  105. > * {
  106. position: absolute;
  107. top: 0;
  108. left: 0;
  109. width: 100%;
  110. height: 100%;
  111. }
  112. }
  113. @each $key, $ratio in $aspect-ratios {
  114. .ratio-#{$key} {
  115. --#{$prefix}aspect-ratio: #{$ratio};
  116. }
  117. }
  118. //
  119. // Focus ring
  120. //
  121. .focus-ring:focus {
  122. outline: 0;
  123. // By default, there is no `--bs-focus-ring-x`, `--bs-focus-ring-y`, or `--bs-focus-ring-blur`, but we provide CSS variables with fallbacks to initial `0` values
  124. box-shadow: var(--#{$prefix}focus-ring-x, 0) var(--#{$prefix}focus-ring-y, 0) var(--#{$prefix}focus-ring-blur, 0) var(--#{$prefix}focus-ring-width) var(--#{$prefix}focus-ring-color);
  125. }