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.

174 lines
5.9 KiB

7 months ago
  1. // Re-assigned maps
  2. //
  3. // Placed here so that others can override the default Sass maps and see automatic updates to utilities and more.
  4. // scss-docs-start theme-colors-rgb
  5. $theme-colors-rgb: map-loop($theme-colors, to-rgb, "$value") !default;
  6. // scss-docs-end theme-colors-rgb
  7. // scss-docs-start theme-text-map
  8. $theme-colors-text: (
  9. "primary": $primary-text-emphasis,
  10. "secondary": $secondary-text-emphasis,
  11. "success": $success-text-emphasis,
  12. "info": $info-text-emphasis,
  13. "warning": $warning-text-emphasis,
  14. "danger": $danger-text-emphasis,
  15. "light": $light-text-emphasis,
  16. "dark": $dark-text-emphasis,
  17. ) !default;
  18. // scss-docs-end theme-text-map
  19. // scss-docs-start theme-bg-subtle-map
  20. $theme-colors-bg-subtle: (
  21. "primary": $primary-bg-subtle,
  22. "secondary": $secondary-bg-subtle,
  23. "success": $success-bg-subtle,
  24. "info": $info-bg-subtle,
  25. "warning": $warning-bg-subtle,
  26. "danger": $danger-bg-subtle,
  27. "light": $light-bg-subtle,
  28. "dark": $dark-bg-subtle,
  29. ) !default;
  30. // scss-docs-end theme-bg-subtle-map
  31. // scss-docs-start theme-border-subtle-map
  32. $theme-colors-border-subtle: (
  33. "primary": $primary-border-subtle,
  34. "secondary": $secondary-border-subtle,
  35. "success": $success-border-subtle,
  36. "info": $info-border-subtle,
  37. "warning": $warning-border-subtle,
  38. "danger": $danger-border-subtle,
  39. "light": $light-border-subtle,
  40. "dark": $dark-border-subtle,
  41. ) !default;
  42. // scss-docs-end theme-border-subtle-map
  43. $theme-colors-text-dark: null !default;
  44. $theme-colors-bg-subtle-dark: null !default;
  45. $theme-colors-border-subtle-dark: null !default;
  46. @if $enable-dark-mode {
  47. // scss-docs-start theme-text-dark-map
  48. $theme-colors-text-dark: (
  49. "primary": $primary-text-emphasis-dark,
  50. "secondary": $secondary-text-emphasis-dark,
  51. "success": $success-text-emphasis-dark,
  52. "info": $info-text-emphasis-dark,
  53. "warning": $warning-text-emphasis-dark,
  54. "danger": $danger-text-emphasis-dark,
  55. "light": $light-text-emphasis-dark,
  56. "dark": $dark-text-emphasis-dark,
  57. ) !default;
  58. // scss-docs-end theme-text-dark-map
  59. // scss-docs-start theme-bg-subtle-dark-map
  60. $theme-colors-bg-subtle-dark: (
  61. "primary": $primary-bg-subtle-dark,
  62. "secondary": $secondary-bg-subtle-dark,
  63. "success": $success-bg-subtle-dark,
  64. "info": $info-bg-subtle-dark,
  65. "warning": $warning-bg-subtle-dark,
  66. "danger": $danger-bg-subtle-dark,
  67. "light": $light-bg-subtle-dark,
  68. "dark": $dark-bg-subtle-dark,
  69. ) !default;
  70. // scss-docs-end theme-bg-subtle-dark-map
  71. // scss-docs-start theme-border-subtle-dark-map
  72. $theme-colors-border-subtle-dark: (
  73. "primary": $primary-border-subtle-dark,
  74. "secondary": $secondary-border-subtle-dark,
  75. "success": $success-border-subtle-dark,
  76. "info": $info-border-subtle-dark,
  77. "warning": $warning-border-subtle-dark,
  78. "danger": $danger-border-subtle-dark,
  79. "light": $light-border-subtle-dark,
  80. "dark": $dark-border-subtle-dark,
  81. ) !default;
  82. // scss-docs-end theme-border-subtle-dark-map
  83. }
  84. // Utilities maps
  85. //
  86. // Extends the default `$theme-colors` maps to help create our utilities.
  87. // Come v6, we'll de-dupe these variables. Until then, for backward compatibility, we keep them to reassign.
  88. // scss-docs-start utilities-colors
  89. $utilities-colors: $theme-colors-rgb !default;
  90. // scss-docs-end utilities-colors
  91. // scss-docs-start utilities-text-colors
  92. $utilities-text: map-merge(
  93. $utilities-colors,
  94. (
  95. "black": to-rgb($black),
  96. "white": to-rgb($white),
  97. "body": to-rgb($body-color)
  98. )
  99. ) !default;
  100. $utilities-text-colors: map-loop($utilities-text, rgba-css-var, "$key", "text") !default;
  101. $utilities-text-emphasis-colors: (
  102. "primary-emphasis": var(--#{$prefix}primary-text-emphasis),
  103. "secondary-emphasis": var(--#{$prefix}secondary-text-emphasis),
  104. "success-emphasis": var(--#{$prefix}success-text-emphasis),
  105. "info-emphasis": var(--#{$prefix}info-text-emphasis),
  106. "warning-emphasis": var(--#{$prefix}warning-text-emphasis),
  107. "danger-emphasis": var(--#{$prefix}danger-text-emphasis),
  108. "light-emphasis": var(--#{$prefix}light-text-emphasis),
  109. "dark-emphasis": var(--#{$prefix}dark-text-emphasis)
  110. ) !default;
  111. // scss-docs-end utilities-text-colors
  112. // scss-docs-start utilities-bg-colors
  113. $utilities-bg: map-merge(
  114. $utilities-colors,
  115. (
  116. "black": to-rgb($black),
  117. "white": to-rgb($white),
  118. "body": to-rgb($body-bg)
  119. )
  120. ) !default;
  121. $utilities-bg-colors: map-loop($utilities-bg, rgba-css-var, "$key", "bg") !default;
  122. $utilities-bg-subtle: (
  123. "primary-subtle": var(--#{$prefix}primary-bg-subtle),
  124. "secondary-subtle": var(--#{$prefix}secondary-bg-subtle),
  125. "success-subtle": var(--#{$prefix}success-bg-subtle),
  126. "info-subtle": var(--#{$prefix}info-bg-subtle),
  127. "warning-subtle": var(--#{$prefix}warning-bg-subtle),
  128. "danger-subtle": var(--#{$prefix}danger-bg-subtle),
  129. "light-subtle": var(--#{$prefix}light-bg-subtle),
  130. "dark-subtle": var(--#{$prefix}dark-bg-subtle)
  131. ) !default;
  132. // scss-docs-end utilities-bg-colors
  133. // scss-docs-start utilities-border-colors
  134. $utilities-border: map-merge(
  135. $utilities-colors,
  136. (
  137. "black": to-rgb($black),
  138. "white": to-rgb($white)
  139. )
  140. ) !default;
  141. $utilities-border-colors: map-loop($utilities-border, rgba-css-var, "$key", "border") !default;
  142. $utilities-border-subtle: (
  143. "primary-subtle": var(--#{$prefix}primary-border-subtle),
  144. "secondary-subtle": var(--#{$prefix}secondary-border-subtle),
  145. "success-subtle": var(--#{$prefix}success-border-subtle),
  146. "info-subtle": var(--#{$prefix}info-border-subtle),
  147. "warning-subtle": var(--#{$prefix}warning-border-subtle),
  148. "danger-subtle": var(--#{$prefix}danger-border-subtle),
  149. "light-subtle": var(--#{$prefix}light-border-subtle),
  150. "dark-subtle": var(--#{$prefix}dark-border-subtle)
  151. ) !default;
  152. // scss-docs-end utilities-border-colors
  153. $utilities-links-underline: map-loop($utilities-colors, rgba-css-var, "$key", "link-underline") !default;
  154. $negative-spacers: if($enable-negative-margins, negativify-map($spacers), null) !default;
  155. $gutters: $spacers !default;