|
71 | 71 | } |
72 | 72 |
|
73 | 73 | $theme: digest-schema($time-picker-schema); |
74 | | - $meta: map.get($theme, '_meta'); |
75 | 74 |
|
76 | 75 | @if not($text-color) and $background-color { |
77 | | - $text-color: text-contrast($background-color); |
| 76 | + $text-color: hsla(from adaptive-contrast(var(--background-color)) h s l / 0.7); |
| 77 | + } |
| 78 | + |
| 79 | + @if not($hover-text-color) and $text-color { |
| 80 | + $hover-text-color: hsla(from var(--text-color) h s l / 1); |
| 81 | + } |
| 82 | + |
| 83 | + @if not($header-background) and $selected-text-color { |
| 84 | + $header-background: var(--selected-text-color); |
| 85 | + } |
| 86 | + |
| 87 | + @if not($header-background) and $background-color { |
| 88 | + $header-background: var(--background-color); |
78 | 89 | } |
79 | 90 |
|
80 | 91 | @if not($header-hour-text-color) and $header-background { |
81 | | - $header-hour-text-color: text-contrast($header-background); |
| 92 | + $header-hour-text-color: adaptive-contrast(var(--header-background)); |
82 | 93 | } |
83 | 94 |
|
84 | 95 | @if not($selected-text-color) and $active-item-background { |
85 | | - $selected-text-color: text-contrast($active-item-background); |
| 96 | + $selected-text-color: var(--active-item-background); |
| 97 | + } |
| 98 | + |
| 99 | + @if not($active-item-background) and $selected-text-color { |
| 100 | + $active-item-background: var(--selected-text-color); |
86 | 101 | } |
87 | 102 |
|
88 | 103 | @if not($active-item-background) and $background-color { |
89 | | - @if meta.type-of($background-color) == 'color' { |
90 | | - $active-item-background: rgba(text-contrast($background-color), .12); |
91 | | - } |
| 104 | + $active-item-background: hsla(from adaptive-contrast(var(--background-color)) h s l / .5); |
| 105 | + } |
| 106 | + |
| 107 | + @if not($active-item-foreground) and $active-item-background { |
| 108 | + $active-item-foreground: hsla(from adaptive-contrast(var(--active-item-background)) h s l / 1); |
| 109 | + } |
| 110 | + |
| 111 | + @if not($selected-text-color) and $background-color { |
| 112 | + $selected-text-color: adaptive-contrast(var(--background-color)); |
92 | 113 | } |
93 | 114 |
|
94 | 115 | @if not($disabled-text-color) and $disabled-item-background { |
95 | | - @if meta.type-of($disabled-item-background) == 'color' { |
96 | | - $disabled-text-color: rgba(text-contrast($disabled-item-background), .6); |
97 | | - } |
| 116 | + $disabled-text-color: hsla(from adaptive-contrast(var(--disabled-item-background)) h s l / .6); |
| 117 | + } |
| 118 | + |
| 119 | + @if not($border-color) and $background-color { |
| 120 | + $border-color: hsla(from adaptive-contrast(var(--background-color)) h s l / .6); |
98 | 121 | } |
99 | 122 |
|
100 | 123 | @if not($divider-color) and $border-color { |
101 | | - @if meta.type-of($border-color) == 'color' { |
102 | | - $divider-color: $border-color; |
103 | | - } |
| 124 | + $divider-color: var(--border-color); |
104 | 125 | } |
105 | 126 |
|
106 | 127 | @if not($modal-shadow) { |
|
133 | 154 | divider-color: $divider-color, |
134 | 155 | time-item-size: $time-item-size, |
135 | 156 | active-item-border-radius: $active-item-border-radius, |
136 | | - theme: map.get($schema, '_meta', 'theme'), |
137 | | - _meta: map.merge(if($meta, $meta, ()), ( |
138 | | - variant: map.get($schema, '_meta', 'theme') |
139 | | - )), |
140 | 157 | )); |
141 | 158 | } |
142 | 159 |
|
|
146 | 163 | @mixin time-picker($theme) { |
147 | 164 | @include css-vars($theme); |
148 | 165 |
|
149 | | - $variant: map.get($theme, '_meta', 'variant'); |
| 166 | + $variant: map.get($theme, '_meta', 'theme'); |
150 | 167 | $not-bootstrap-theme: $variant != 'bootstrap'; |
151 | 168 |
|
152 | 169 | $picker-buttons-padding: map.get(( |
|
0 commit comments