|
| 1 | +@use 'sass:map'; |
| 2 | +@use 'theme' as daff-theme; |
| 3 | +@use 'utilities' as daff; |
| 4 | + |
| 5 | +// stylelint-disable selector-class-pattern |
| 6 | +@mixin type-theming($color, $opacity: 0.1) { |
| 7 | + background: rgba($color, $opacity); |
| 8 | + color: $color; |
| 9 | +} |
| 10 | + |
| 11 | +@mixin daffio-api-item-label-theme($theme) { |
| 12 | + $primary: daff-theme.daff-map-get($theme, primary); |
| 13 | + $secondary: daff-theme.daff-map-get($theme, secondary); |
| 14 | + $tertiary: daff-theme.daff-map-get($theme, tertiary); |
| 15 | + $critical: daff-theme.daff-map-get($theme, critical); |
| 16 | + $base: daff-theme.daff-map-get($theme, 'core', 'base'); |
| 17 | + $base-contrast: daff-theme.daff-map-get( |
| 18 | + daff-theme.$theme, |
| 19 | + 'core', |
| 20 | + 'base-contrast' |
| 21 | + ); |
| 22 | + $type: daff-theme.daff-map-get($theme, 'core', 'type'); |
| 23 | + |
| 24 | + .daffio-docs-api-item-label { |
| 25 | + &.class { |
| 26 | + @include type-theming(daff-theme.daff-color($primary)); |
| 27 | + } |
| 28 | + |
| 29 | + &.type-alias { |
| 30 | + @include type-theming(daff-theme.daff-color($secondary)); |
| 31 | + } |
| 32 | + |
| 33 | + &.interface { |
| 34 | + @include type-theming(daff-theme.daff-color($tertiary)); |
| 35 | + } |
| 36 | + |
| 37 | + &.const { |
| 38 | + @include type-theming( |
| 39 | + daff-theme.daff-illuminate($base-contrast, $secondary, 3) |
| 40 | + ); |
| 41 | + } |
| 42 | + |
| 43 | + &.enum { |
| 44 | + @include type-theming( |
| 45 | + daff-theme.daff-illuminate($base-contrast, $primary, 3) |
| 46 | + ); |
| 47 | + } |
| 48 | + |
| 49 | + &.package { |
| 50 | + @include type-theming( |
| 51 | + daff-theme.daff-illuminate($base-contrast, daff-theme.$daff-yellow, 3) |
| 52 | + ); |
| 53 | + } |
| 54 | + |
| 55 | + &.function { |
| 56 | + @include type-theming( |
| 57 | + daff-theme.daff-illuminate($base-contrast, $tertiary, 3) |
| 58 | + ); |
| 59 | + } |
| 60 | + |
| 61 | + &.deprecated { |
| 62 | + @include daff-theme.light($type) { |
| 63 | + @include type-theming(daff-theme.daff-color($critical, 70)); |
| 64 | + } |
| 65 | + |
| 66 | + @include daff-theme.dark($type) { |
| 67 | + @include type-theming(daff-theme.daff-color($critical, 40), 0.15); |
| 68 | + } |
| 69 | + } |
| 70 | + } |
| 71 | +} |
0 commit comments