Skip to content

Commit 1a8b7f6

Browse files
author
Stefanie Hein
committed
Merge branch 'focus-outline-v2-77074'
* focus-outline-v2-77074: Add compiled code Colors: separate out blue and blue-light color, so we can use blue for the focused color and blue-light for the tag color. See #77074 Add compiled code Focus: fix focus style for indeterminate checkboxes. See #77074 Add compiled code Focus: remove obsolete mixin. See #77074 Add compiled code Fix code style. List-View: make focus style the same as for buttons and inputs. See #77074 Focus: make focus style customizable by using CSS variables, e.g. for tab or panel buttons. See #77074 Checkbox: fix focus style when checkbox is active. See #77074 Buttons: clearly distinguish focus and hover styles. See #77074 Focus Outline: optimize focus outline to make it more visible, add the same style for list-view rows on focus. See #77074
2 parents 4b455b9 + de05ed1 commit 1a8b7f6

8 files changed

Lines changed: 362 additions & 231 deletions

File tree

public/cui_fylr.css

Lines changed: 282 additions & 205 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/scss/themes/fylr/_variables.scss

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ $grays: map.merge(
7676
$grays
7777
);
7878

79-
$blue: #6bb2bb !default;
79+
$blue: #0261f8 !default;
80+
$blue-light: #8bceec !default;
8081
$indigo: #6610f2 !default;
8182
$purple: #6f42c1 !default;
8283
$pink: #b64b7c !default;
@@ -94,6 +95,7 @@ $colors: () !default;
9495
$colors: map.merge(
9596
(
9697
'blue': $blue,
98+
'blue-light': $blue-light,
9799
'indigo': $indigo,
98100
'purple': $purple,
99101
'pink': $pink,
@@ -121,7 +123,7 @@ $danger-bg-light: color.adjust($danger, $lightness: 39%) !default;
121123
$light: $gray-100 !default;
122124
$dark: $gray-800 !default;
123125
$muted: $gray-600 !default; // used in field-label, block description, empty label
124-
$focused: $cyan !default;
126+
$focused: $blue !default;
125127
$disabled: $muted !default;
126128

127129
$disabled-opacity: 0.5 !default;
@@ -318,9 +320,11 @@ $hr-border-color: rgb($gray-400, 0.5) !default; // make sure hr is visible on
318320
$hr-border-color-dark: $dark !default;
319321
$hr-border-width: 1px !default;
320322

321-
$component-focus-shadow-color: rgb($focused, 0.25) !default;
322-
$component-focus-shadow: inset 0 0 0 2px $component-focus-shadow-color !default;
323-
$component-focus-border-color: rgb($focused, 0.5) !default;
323+
$component-focus-shadow-color: $focused !default;
324+
$component-focus-shadow:
325+
inset 0 0 0 var(--focus-shadow-outer-width, 2px) var(--focus-shadow-outer-color, #{$component-focus-shadow-color}),
326+
inset 0 0 0 var(--focus-shadow-inner-width, 4px) var(--focus-shadow-inner-color, #{$white}) !default;
327+
$component-focus-border-color: $focused !default;
324328

325329
$component-selected-border-width: 1px !default;
326330
$component-selected-border-color: var(--brand-color, #{$primary}) !default;

src/scss/themes/fylr/components/_checkbox.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,12 @@
153153
@include input-focus();
154154
}
155155

156-
&.cui-active {
156+
&.cui-active,
157+
&.cui-indeterminate {
157158
> .cui-button-visual > .cui-button-left span,
158159
> .cui-button-visual > .cui-button-left i {
159160
background-color: $focused; // make more prominent
161+
box-shadow: none !important;
160162
}
161163
}
162164
}

src/scss/themes/fylr/components/_list-view.scss

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@use '../variables' as *;
22
@use '../mixins/clickable' as *;
3+
@use '../mixins/list-view' as *;
34
@use '../mixins/list-view-use-css-grid-layout' as *;
45
@use '../mixins/pane' as *;
56

@@ -185,8 +186,7 @@
185186

186187
// be careful to apply a default select state, it's probably best to do this contextually in the theme
187188
&.cui-selected,
188-
&.cui-selected:hover,
189-
&.cui-selected:focus {
189+
&.cui-selected:hover {
190190
> .cui-lv-tr {
191191
box-shadow: inset 0 0 0 var(--list-view-selected-row-border-width) var(--list-view-selected-row-border-color);
192192
background-color: var(--list-view-selected-row-background);
@@ -209,12 +209,18 @@
209209
}
210210

211211
&.cui-row-invalid,
212-
&.cui-row-invalid:hover,
213-
&.cui-row-invalid:focus {
212+
&.cui-row-invalid:hover {
214213
> .cui-lv-tr {
215214
background-color: var(--list-view-invalid-row-background);
216215
}
217216
}
217+
218+
&.cui-row-invalid:focus {
219+
> .cui-lv-tr {
220+
// todo: do wee need a different focus style here ?
221+
// background-color: var(--list-view-invalid-row-background);
222+
}
223+
}
218224
}
219225

220226
// * Special Header Row
@@ -427,12 +433,17 @@
427433
.cui-lv-tree-node--is-branch {
428434
@include clickable();
429435

430-
&:hover,
431-
&:focus {
436+
&:hover {
432437
> .cui-lv-tr {
433438
background-color: var(--list-view-hover-row-background);
434439
}
435440
}
441+
442+
&:focus-visible {
443+
> .cui-lv-tr {
444+
@include list-view-row-focus();
445+
}
446+
}
436447
}
437448

438449
// Special case, when there is a single column in the quadrant-2 that contains only the drag handle

src/scss/themes/fylr/components/_panel.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@
7373
}
7474
}
7575

76+
&:focus {
77+
.cui-button-visual {
78+
--focus-shadow-outer-width: 3px;
79+
--focus-shadow-inner-width: 5px;
80+
}
81+
}
82+
7683
&.cui-active {
7784
.cui-button-visual {
7885
color: var(--btn-color-active, #{$body-color});

src/scss/themes/fylr/components/_tabs.scss

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -175,15 +175,6 @@
175175
color: var(--btn-color-active, #{$tabs-active-color});
176176
}
177177
}
178-
179-
&:focus {
180-
.cui-button-visual {
181-
// add custom focus style
182-
background-color: rgb($focused, 0.05);
183-
color: var(--btn-color-active, #{$tabs-active-color});
184-
box-shadow: $btn-focus-shadow !important;
185-
}
186-
}
187178
}
188179

189180
// * Overflow Button
@@ -209,8 +200,7 @@
209200
}
210201
}
211202

212-
&:hover,
213-
&:focus {
203+
&:hover {
214204
.cui-button-visual {
215205
background-color: $tabs-overflow-button-background-hover;
216206
color: $tabs-overflow-button-color-hover;
@@ -274,6 +264,16 @@
274264
border-bottom: 1px solid var(--tabs-active-border-color, $tabs-active-border-color);
275265
}
276266
}
267+
268+
&:focus {
269+
.cui-button-visual {
270+
--tabs-active-border-color: #{$component-focus-shadow-color};
271+
--focus-shadow-outer-width: 3px;
272+
--focus-shadow-inner-width: 5px;
273+
274+
border-radius: $btn-border-radius;
275+
}
276+
}
277277

278278
&.cui-active {
279279
.cui-button-visual {

src/scss/themes/fylr/mixins/_buttons.scss

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,7 @@
196196
}
197197

198198
&:not(.cui-disabled) {
199-
&:hover,
200-
&:focus {
199+
&:hover {
201200
.cui-button-visual {
202201
color: var(--btn-color-hover, #{$color-hover});
203202
background-color: var(--btn-background-hover, #{$background-hover});
@@ -207,7 +206,7 @@
207206
&:focus {
208207
outline: none;
209208

210-
.cui-button-visual {
209+
> .cui-button-visual {
211210
@include button-focus();
212211
}
213212
}
@@ -329,6 +328,10 @@
329328
&:hover {
330329
--btn-border-color: #{$btn-inverted-hover-border-color};
331330
}
331+
332+
&:focus {
333+
--focus-shadow-inner-color: transparent;
334+
}
332335
}
333336
}
334337

@@ -444,6 +447,12 @@
444447
box-shadow: none; // reset from button-color()
445448
}
446449
}
450+
451+
&:focus {
452+
.cui-button-visual {
453+
--btn-border-width: 1px;
454+
}
455+
}
447456
}
448457
}
449458

src/scss/themes/fylr/mixins/_list-view.scss

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,27 @@
1818
}
1919
}
2020

21+
@mixin list-view-row-focus() {
22+
position: relative;
23+
24+
&::after {
25+
content: '';
26+
display: block;
27+
position: absolute;
28+
top: 0;
29+
left: 0;
30+
width: 100%;
31+
height: 100%;
32+
pointer-events: none;
33+
34+
@include button-focus();
35+
36+
border-radius: $btn-border-radius;
37+
border-width: 1px;
38+
border-style: solid;
39+
}
40+
}
41+
2142
@mixin list-view-no-border() {
2243
// border
2344
--list-view-border-width: 0;

0 commit comments

Comments
 (0)