Skip to content

Commit 6c3e126

Browse files
committed
style: selection and focus color
1 parent dfa4041 commit 6c3e126

13 files changed

+52
-39
lines changed

css/pico.classless.css

+15-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/pico.classless.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/pico.classless.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/pico.css

+15-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/pico.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/pico.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scss/components/_accordion.scss

+2
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@
7070

7171
&:focus-visible {
7272
&:not([role]) {
73+
outline: var(#{$✨}outline-width) solid var(#{$✨}primary-focus);
74+
outline-offset: calc(var(#{$✨}spacing, 1rem) * 0.5);
7375
color: var(#{$✨}primary);
7476
}
7577
}

scss/components/_dropdown.scss

+5
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@
104104
box-shadow: 0 0 0 var(#{$✨}outline-width) var(#{$✨}form-element-focus-color);
105105
}
106106

107+
// Reset focus visible from accordion component
108+
&:focus-visible {
109+
outline: none;
110+
}
111+
107112
// Aria-invalid
108113
&[aria-invalid="false"] {
109114
#{$✨}form-element-border-color: var(#{$✨}form-element-valid-border-color);

scss/content/_code.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
display: block;
5656
padding: var(#{$✨}spacing);
5757
background: none;
58-
font-size: 14px;
58+
font-size: inherit;
5959
line-height: var(#{$✨}line-height);
6060
}
6161
}

scss/content/_link.scss

+1-9
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
}
3131

3232
&:focus-visible {
33-
#{$✨}background-color: var(#{$✨}primary-focus);
33+
box-shadow: 0 0 0 var(#{$✨}outline-width) var(#{$✨}primary-focus);
3434
}
3535

3636
@if $enable-classes {
@@ -43,10 +43,6 @@
4343
#{$✨}color: var(#{$✨}secondary-hover);
4444
#{$✨}underline: var(#{$✨}secondary-underline-hover);
4545
}
46-
47-
&:focus-visible {
48-
#{$✨}background-color: var(#{$✨}secondary-focus);
49-
}
5046
}
5147

5248
// Contrast
@@ -58,10 +54,6 @@
5854
#{$✨}color: var(#{$✨}contrast-hover);
5955
#{$✨}underline: var(#{$✨}contrast-underline-hover);
6056
}
61-
62-
&:focus-visible {
63-
#{$✨}background-color: var(#{$✨}contrast-focus);
64-
}
6557
}
6658
}
6759
}

scss/content/_typography.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,6 @@
210210

211211
// selection
212212
::selection {
213-
background-color: var(#{$✨}primary-focus);
213+
background-color: var(#{$✨}text-selection-color);
214214
}
215215
}

scss/themes/default/_dark.scss

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
// Text color
1212
#{$✨}color: #{$zinc-200};
1313

14+
// Text selection color
15+
#{$✨}text-selection-color: #{rgba($azure-350, 0.1875)};
16+
1417
// Muted colors
1518
#{$✨}muted-color: #{$zinc-450};
1619
#{$✨}muted-border-color: #{$slate-850};
@@ -24,7 +27,7 @@
2427
#{$✨}primary-background-hover: #{$azure-500};
2528
#{$✨}primary-border: var(#{$✨}primary-background);
2629
#{$✨}primary-border-hover: var(#{$✨}primary-background-hover);
27-
#{$✨}primary-focus: #{rgba($azure-350, 0.25)};
30+
#{$✨}primary-focus: #{rgba($azure-350, 0.375)};
2831
#{$✨}primary-inverse: #{$white};
2932

3033
// Secondary colors

scss/themes/default/_light.scss

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
// Text color
1212
#{$✨}color: #{$zinc-750};
1313

14+
// Text selection color
15+
#{$✨}text-selection-color: #{rgba($azure-400, 0.25)};
16+
1417
// Muted colors
1518
#{$✨}muted-color: #{$zinc-550};
1619
#{$✨}muted-border-color: #{mix($slate-100, $slate-50)};
@@ -24,7 +27,7 @@
2427
#{$✨}primary-background-hover: #{$azure-600};
2528
#{$✨}primary-border: var(#{$✨}primary-background);
2629
#{$✨}primary-border-hover: var(#{$✨}primary-background-hover);
27-
#{$✨}primary-focus: #{rgba($azure-400, 0.25)};
30+
#{$✨}primary-focus: #{rgba($azure-400, 0.5)};
2831
#{$✨}primary-inverse: #{$white};
2932

3033
// Secondary colors

0 commit comments

Comments
 (0)