| @use "sass:meta"; |
| @use "colors" as *; |
| @use "config" as *; |
| @use "variables" as *; |
| @use "theme" as *; |
| // @use "maps" as *; |
| @use "vendor/rfs" as *; |
| @use "mixins/color-mode" as *; |
| @use "forms/form-variables" as *; |
| |
| // mdo-do: do we need theme? |
| @layer colors, theme, config, root, reboot, layout, content, forms, components, custom, helpers, utilities; |
| |
| :root { |
| color-scheme: light dark; |
| |
| // scss-docs-start root-theme-variables |
| // Generate semantic theme colors |
| @each $color-name, $color-map in $new-theme-colors { |
| @each $key, $value in $color-map { |
| --#{$prefix}#{$color-name}-#{$key}: #{$value}; |
| } |
| } |
| |
| @each $color, $value in $theme-bgs { |
| --#{$prefix}bg-#{$color}: #{$value}; |
| } |
| |
| @each $color, $value in $theme-fgs { |
| --#{$prefix}color-#{$color}: #{$value}; |
| } |
| |
| @each $color, $value in $theme-borders { |
| --#{$prefix}border-#{$color}: #{$value}; |
| } |
| |
| --#{$prefix}black: #{$black}; |
| --#{$prefix}white: #{$white}; |
| // scss-docs-end root-theme-variables |
| } |
| |
| :root, |
| [data-bs-theme="light"] { |
| color-scheme: light; |
| |
| // Note: Custom variable values only support SassScript inside `#{}`. |
| |
| --#{$prefix}white-rgb: #{to-rgb($white)}; |
| --#{$prefix}black-rgb: #{to-rgb($black)}; |
| |
| // Fonts |
| |
| // Note: Use `inspect` for lists so that quoted items keep the quotes. |
| // See https://github.com/sass/sass/issues/2383#issuecomment-336349172 |
| --#{$prefix}font-sans-serif: #{meta.inspect($font-family-sans-serif)}; |
| --#{$prefix}font-monospace: #{meta.inspect($font-family-monospace)}; |
| --#{$prefix}gradient: #{$gradient}; |
| |
| // Root and body |
| // scss-docs-start root-body-variables |
| @if $font-size-root != null { |
| --#{$prefix}root-font-size: #{$font-size-root}; |
| } |
| --#{$prefix}body-font-family: #{meta.inspect($font-family-base)}; |
| |
| // scss-docs-start root-font-size-variables |
| --#{$prefix}font-size-base: #{$font-size-base}; // 14px |
| // --#{$prefix}font-size-sm: calc(#{$font-size-base} * .9285); |
| // --#{$prefix}font-size-lg: calc(#{$font-size-base} * 1.285); |
| |
| --#{$prefix}font-size-xs: clamp(.75rem, .7rem + .25vw, .875rem); |
| --#{$prefix}font-size-sm: clamp(.875rem, .8rem + .375vw, 1rem); |
| --#{$prefix}font-size-md: clamp(1rem, .9rem + .5vw, 1.125rem); |
| --#{$prefix}font-size-lg: clamp(1.25rem, 1rem + .625vw, 1.5rem); |
| --#{$prefix}font-size-xl: clamp(1.5rem, 1.1rem + .75vw, 1.75rem); |
| --#{$prefix}font-size-2xl: clamp(1.75rem, 1.3rem + 1vw, 2.25rem); |
| --#{$prefix}font-size-3xl: clamp(2rem, 1.5rem + 1.875vw, 2.5rem); |
| --#{$prefix}font-size-4xl: clamp(2.25rem, 1.75rem + 2.5vw, 3rem); |
| --#{$prefix}font-size-5xl: clamp(3rem, 2rem + 5vw, 4rem); |
| --#{$prefix}font-size-6xl: clamp(3.75rem, 2.5rem + 6.25vw, 5rem); |
| |
| --#{$prefix}line-height-xs: 1.5; |
| --#{$prefix}line-height-sm: 1.5; |
| --#{$prefix}line-height-md: 1.5; |
| --#{$prefix}line-height-lg: 1.5; |
| --#{$prefix}line-height-xl: calc(2.5 / 1.75); |
| --#{$prefix}line-height-2xl: calc(3 / 2.25); |
| --#{$prefix}line-height-3xl: 1.2; |
| --#{$prefix}line-height-4xl: 1.1; |
| --#{$prefix}line-height-5xl: 1.1; |
| --#{$prefix}line-height-6xl: 1; |
| // scss-docs-end root-font-size-variables |
| |
| @include rfs($font-size-base, --#{$prefix}body-font-size); |
| --#{$prefix}body-font-weight: #{$font-weight-base}; |
| --#{$prefix}body-line-height: #{$line-height-base}; |
| @if $body-text-align != null { |
| --#{$prefix}body-text-align: #{$body-text-align}; |
| } |
| |
| @each $key, $value in $theme-bgs { |
| $key: if($key == null, "", "-" + $key); |
| --#{$prefix}bg#{$key}: #{$value}; |
| } |
| |
| @each $key, $value in $theme-fgs { |
| $key: if($key == null, "", "-" + $key); |
| --#{$prefix}fg#{$key}: #{$value}; |
| } |
| |
| @each $key, $value in $theme-borders { |
| $key: if($key == null, "", "-" + $key); |
| --#{$prefix}border#{$key}: #{$value}; |
| } |
| |
| // --#{$prefix}body-color: #{$body-color}; |
| --#{$prefix}body-color-rgb: #{to-rgb($body-color)}; |
| // --#{$prefix}body-bg: #{$body-bg}; |
| --#{$prefix}body-bg-rgb: #{to-rgb($body-bg)}; |
| |
| // --#{$prefix}emphasis-color: #{$body-emphasis-color}; |
| // --#{$prefix}emphasis-color-rgb: #{to-rgb($body-emphasis-color)}; |
| |
| // --#{$prefix}secondary-color: #{$body-secondary-color}; |
| // --#{$prefix}secondary-color-rgb: #{to-rgb($body-secondary-color)}; |
| // --#{$prefix}secondary-bg: #{$body-secondary-bg}; |
| // --#{$prefix}secondary-bg-rgb: #{to-rgb($body-secondary-bg)}; |
| |
| // --#{$prefix}tertiary-color: #{$body-tertiary-color}; |
| // --#{$prefix}tertiary-color-rgb: #{to-rgb($body-tertiary-color)}; |
| // --#{$prefix}tertiary-bg: #{$body-tertiary-bg}; |
| // --#{$prefix}tertiary-bg-rgb: #{to-rgb($body-tertiary-bg)}; |
| // scss-docs-end root-body-variables |
| |
| --#{$prefix}heading-color: #{$headings-color}; |
| |
| // --#{$prefix}link-color: #{$link-color}; |
| // --#{$prefix}link-color-rgb: #{to-rgb($link-color)}; |
| // --#{$prefix}link-decoration: #{$link-decoration}; |
| |
| // --#{$prefix}link-hover-color: #{$link-hover-color}; |
| // --#{$prefix}link-hover-color-rgb: #{to-rgb($link-hover-color)}; |
| |
| --#{$prefix}link-color: light-dark(var(--#{$prefix}primary-base), var(--#{$prefix}primary-text)); |
| --#{$prefix}link-decoration: #{$link-decoration}; |
| --#{$prefix}link-hover-color: color-mix(in oklch, var(--#{$prefix}link-color) 90%, #000); |
| |
| --#{$prefix}code-color: #{$code-color}; |
| --#{$prefix}highlight-color: #{$mark-color}; |
| --#{$prefix}highlight-bg: #{$mark-bg}; |
| |
| // scss-docs-start root-border-var |
| --#{$prefix}border-width: #{$border-width}; |
| --#{$prefix}border-style: #{$border-style}; |
| --#{$prefix}border-color: #{$border-color}; |
| --#{$prefix}border-color-translucent: #{$border-color-translucent}; |
| // scss-docs-end root-border-var |
| |
| // scss-docs-start root-border-radius-var |
| --#{$prefix}border-radius: #{$border-radius}; |
| --#{$prefix}border-radius-sm: #{$border-radius-sm}; |
| --#{$prefix}border-radius-lg: #{$border-radius-lg}; |
| --#{$prefix}border-radius-xl: #{$border-radius-xl}; |
| --#{$prefix}border-radius-2xl: #{$border-radius-2xl}; |
| --#{$prefix}border-radius-pill: #{$border-radius-pill}; |
| // scss-docs-end root-border-radius-var |
| |
| --#{$prefix}box-shadow: #{$box-shadow}; |
| --#{$prefix}box-shadow-sm: #{$box-shadow-sm}; |
| --#{$prefix}box-shadow-lg: #{$box-shadow-lg}; |
| --#{$prefix}box-shadow-inset: #{$box-shadow-inset}; |
| |
| // Focus styles |
| // scss-docs-start root-focus-variables |
| // --#{$prefix}focus-ring-width: #{$focus-ring-width}; |
| // --#{$prefix}focus-ring-opacity: #{$focus-ring-opacity}; |
| // --#{$prefix}focus-ring-color: #{$focus-ring-color}; |
| |
| --#{$prefix}focus-ring-width: 3px; |
| --#{$prefix}focus-ring-offset: -1px; |
| --#{$prefix}focus-ring-color: var(--#{$prefix}primary-focus-ring); |
| --#{$prefix}focus-ring: var(--#{$prefix}focus-ring-width) solid var(--#{$prefix}focus-ring-color); |
| |
| // scss-docs-end root-focus-variables |
| |
| // scss-docs-start root-form-validation-variables |
| --#{$prefix}form-valid-color: #{$form-valid-color}; |
| --#{$prefix}form-valid-border-color: #{$form-valid-border-color}; |
| --#{$prefix}form-invalid-color: #{$form-invalid-color}; |
| --#{$prefix}form-invalid-border-color: #{$form-invalid-border-color}; |
| // scss-docs-end root-form-validation-variables |
| } |
| |
| @if $enable-dark-mode { |
| @include color-mode(dark, true) { |
| color-scheme: dark; |
| |
| // scss-docs-start root-dark-mode-vars |
| // --#{$prefix}body-color: #{$body-color-dark}; |
| // --#{$prefix}body-color-rgb: #{to-rgb($body-color-dark)}; |
| // --#{$prefix}body-bg: #{$body-bg-dark}; |
| // --#{$prefix}body-bg-rgb: #{to-rgb($body-bg-dark)}; |
| |
| --#{$prefix}emphasis-color: #{$body-emphasis-color-dark}; |
| --#{$prefix}emphasis-color-rgb: #{to-rgb($body-emphasis-color-dark)}; |
| |
| // --#{$prefix}secondary-color: #{$body-secondary-color-dark}; |
| // --#{$prefix}secondary-color-rgb: #{to-rgb($body-secondary-color-dark)}; |
| // --#{$prefix}secondary-bg: #{$body-secondary-bg-dark}; |
| // --#{$prefix}secondary-bg-rgb: #{to-rgb($body-secondary-bg-dark)}; |
| |
| // --#{$prefix}tertiary-color: #{$body-tertiary-color-dark}; |
| // --#{$prefix}tertiary-color-rgb: #{to-rgb($body-tertiary-color-dark)}; |
| // --#{$prefix}tertiary-bg: #{$body-tertiary-bg-dark}; |
| // --#{$prefix}tertiary-bg-rgb: #{to-rgb($body-tertiary-bg-dark)}; |
| |
| --#{$prefix}heading-color: #{$headings-color-dark}; |
| |
| // --#{$prefix}link-color: #{$link-color-dark}; |
| // --#{$prefix}link-hover-color: #{$link-hover-color-dark}; |
| // --#{$prefix}link-color-rgb: #{to-rgb($link-color-dark)}; |
| // --#{$prefix}link-hover-color-rgb: #{to-rgb($link-hover-color-dark)}; |
| |
| // --#{$prefix}code-color: #{$code-color-dark}; // removed in v6 |
| // --#{$prefix}highlight-color: #{$mark-color-dark}; |
| // --#{$prefix}highlight-bg: #{$mark-bg-dark}; |
| |
| --#{$prefix}border-color: #{$border-color-dark}; |
| --#{$prefix}border-color-translucent: #{$border-color-translucent-dark}; |
| |
| --#{$prefix}form-valid-color: #{$form-valid-color-dark}; |
| --#{$prefix}form-valid-border-color: #{$form-valid-border-color-dark}; |
| --#{$prefix}form-invalid-color: #{$form-invalid-color-dark}; |
| --#{$prefix}form-invalid-border-color: #{$form-invalid-border-color-dark}; |
| // scss-docs-end root-dark-mode-vars |
| } |
| } |