Skip to content

Commit 1d1006e

Browse files
Merge pull request #596 from nstringham/mixed-sass-declarations
refactor: move nested sass declarations after non-nested declarations
2 parents 69f3dcf + e66b84b commit 1d1006e

File tree

4 files changed

+50
-50
lines changed

4 files changed

+50
-50
lines changed

scss/components/_accordion.scss

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
list-style-type: none;
1616
cursor: pointer;
1717

18-
&:not([role]) {
19-
color: var(#{$css-var-prefix}accordion-close-summary-color);
20-
}
21-
2218
@if $enable-transitions {
2319
transition: color var(#{$css-var-prefix}transition);
2420
}
2521

22+
&:not([role]) {
23+
color: var(#{$css-var-prefix}accordion-close-summary-color);
24+
}
25+
2626
// Reset marker
2727
&::-webkit-details-marker {
2828
display: none;

scss/themes/default/_dark.scss

+21-21
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
// Default: Dark theme
88
@mixin theme {
9+
color-scheme: dark;
910
#{$css-var-prefix}background-color: #{mix($slate-950, $slate-900)};
1011

1112
// Text color
@@ -123,18 +124,6 @@
123124
#{$css-var-prefix}form-element-valid-focus-color: var(
124125
#{$css-var-prefix}form-element-valid-active-border-color
125126
);
126-
127-
// Focus for buttons, radio and select
128-
input:is(
129-
[type="submit"],
130-
[type="button"],
131-
[type="reset"],
132-
[type="checkbox"],
133-
[type="radio"],
134-
[type="file"]
135-
) {
136-
#{$css-var-prefix}form-element-focus-color: var(#{$css-var-prefix}primary-focus);
137-
}
138127
}
139128

140129
// Switch (input[type="checkbox"][role="switch"])
@@ -201,6 +190,26 @@
201190
#{$css-var-prefix}tooltip-color: var(#{$css-var-prefix}contrast-inverse);
202191
}
203192

193+
// Form validation icons
194+
@if map.get($modules, "forms/basics") {
195+
#{$css-var-prefix}icon-valid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='#{functions.display-rgb(mix($jade-450, $slate-600))}' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
196+
#{$css-var-prefix}icon-invalid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='#{functions.display-rgb(mix($red-500, $slate-600))}' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
197+
}
198+
199+
// Focus for buttons, radio and select
200+
@if map.get($modules, "forms/basics") {
201+
input:is(
202+
[type="submit"],
203+
[type="button"],
204+
[type="reset"],
205+
[type="checkbox"],
206+
[type="radio"],
207+
[type="file"]
208+
) {
209+
#{$css-var-prefix}form-element-focus-color: var(#{$css-var-prefix}primary-focus);
210+
}
211+
}
212+
204213
// Chevron icons
205214
@if map.get($modules, "components/accordion") or map.get($modules, "components/dropdown") {
206215
// Change the icon color to black for accordion and dropdown .contrast buttons
@@ -217,12 +226,6 @@
217226
}
218227
}
219228

220-
// Form validation icons
221-
@if map.get($modules, "forms/basics") {
222-
#{$css-var-prefix}icon-valid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='#{functions.display-rgb(mix($jade-450, $slate-600))}' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
223-
#{$css-var-prefix}icon-invalid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='#{functions.display-rgb(mix($red-500, $slate-600))}' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
224-
}
225-
226229
// Loading icon (animated)
227230
@if map.get($modules, "components/loading") {
228231
// Change the icon color to black for .contrast buttons
@@ -242,7 +245,4 @@
242245
}
243246
}
244247
}
245-
246-
// Document
247-
color-scheme: dark;
248248
}

scss/themes/default/_light.scss

+14-14
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
// Default: Light theme
88
@mixin theme {
9+
color-scheme: light;
910
#{$css-var-prefix}background-color: #{$white};
1011

1112
// Text color
@@ -123,18 +124,6 @@
123124
#{$css-var-prefix}form-element-valid-focus-color: var(
124125
#{$css-var-prefix}form-element-valid-active-border-color
125126
);
126-
127-
// Focus for buttons, radio and select
128-
input:is(
129-
[type="submit"],
130-
[type="button"],
131-
[type="reset"],
132-
[type="checkbox"],
133-
[type="radio"],
134-
[type="file"]
135-
) {
136-
#{$css-var-prefix}form-element-focus-color: var(#{$css-var-prefix}primary-focus);
137-
}
138127
}
139128

140129
// Switch (input[type="checkbox"][role="switch"])
@@ -207,6 +196,17 @@
207196
#{$css-var-prefix}icon-invalid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='#{functions.display-rgb(mix($red-500, $zinc-350, 75%))}' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
208197
}
209198

210-
// Document
211-
color-scheme: light;
199+
// Focus for buttons, radio and select
200+
@if map.get($modules, "forms/basics") {
201+
input:is(
202+
[type="submit"],
203+
[type="button"],
204+
[type="reset"],
205+
[type="checkbox"],
206+
[type="radio"],
207+
[type="file"]
208+
) {
209+
#{$css-var-prefix}form-element-focus-color: var(#{$css-var-prefix}primary-focus);
210+
}
211+
}
212212
}

scss/themes/default/_styles.scss

+11-11
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,6 @@
2626
#{$css-var-prefix}font-size: 100%;
2727
#{$css-var-prefix}text-underline-offset: 0.1rem;
2828

29-
// Responsive root font size
30-
@if $enable-responsive-typography {
31-
@each $key, $values in $breakpoints {
32-
@if $values {
33-
@media (min-width: map.get($values, "breakpoint")) {
34-
#{$css-var-prefix}font-size: map.get($values, "root-font-size");
35-
}
36-
}
37-
}
38-
}
39-
4029
// Borders
4130
#{$css-var-prefix}border-radius: 0.25rem;
4231
#{$css-var-prefix}border-width: 0.0625rem;
@@ -143,6 +132,17 @@
143132
// Inspired by https://codepen.io/aleksander351/pen/KzgKPo
144133
#{$css-var-prefix}icon-loading: url("data:image/svg+xml,%3Csvg fill='none' height='24' width='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' %3E%3Cstyle%3E g %7B animation: rotate 2s linear infinite; transform-origin: center center; %7D circle %7B stroke-dasharray: 75,100; stroke-dashoffset: -5; animation: dash 1.5s ease-in-out infinite; stroke-linecap: round; %7D @keyframes rotate %7B 0%25 %7B transform: rotate(0deg); %7D 100%25 %7B transform: rotate(360deg); %7D %7D @keyframes dash %7B 0%25 %7B stroke-dasharray: 1,100; stroke-dashoffset: 0; %7D 50%25 %7B stroke-dasharray: 44.5,100; stroke-dashoffset: -17.5; %7D 100%25 %7B stroke-dasharray: 44.5,100; stroke-dashoffset: -62; %7D %7D %3C/style%3E%3Cg%3E%3Ccircle cx='12' cy='12' r='10' fill='none' stroke='#{functions.display-rgb($zinc-400)}' stroke-width='4' /%3E%3C/g%3E%3C/svg%3E");
145134
}
135+
136+
// Responsive root font size
137+
@if $enable-responsive-typography {
138+
@each $key, $values in $breakpoints {
139+
@if $values {
140+
@media (min-width: map.get($values, "breakpoint")) {
141+
#{$css-var-prefix}font-size: map.get($values, "root-font-size");
142+
}
143+
}
144+
}
145+
}
146146
}
147147

148148
// Responsive spacings

0 commit comments

Comments
 (0)