Skip to content

Commit 58bfd6f

Browse files
authored
Merge pull request #580 from adzhindzhi/bugfix/uepr-594-focus-outline
[UEPR-594] Focus outline
2 parents 99ca1e1 + 489403b commit 58bfd6f

3 files changed

Lines changed: 14 additions & 4 deletions

File tree

packages/scratch-gui/src/components/extension-button/extension-button.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ $fade-out-distance: 15px;
3939
}
4040

4141
.extension-button:focus-visible {
42-
outline: revert;
42+
outline: 0.0625rem auto $ui-black;
4343
}
4444

4545
.extension-button-icon {

packages/scratch-gui/src/components/gui/gui.css

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
box-sizing: border-box;
2020
}
2121

22+
:global(*:focus-visible) {
23+
outline-color: $ui-black;
24+
}
25+
2226
.flex-wrapper {
2327
display: flex;
2428

@@ -159,7 +163,7 @@
159163
}
160164

161165
/* Tab style overrides from react-tabs */
162-
.tab.is-selected:after {
166+
.tab:after {
163167
display: none;
164168
}
165169

@@ -169,8 +173,12 @@
169173
border-color: $ui-black-transparent;
170174
}
171175

172-
.tab.is-selected:focus:after {
173-
display: none;
176+
/* Focus outline for tabs */
177+
.tab:focus-visible,
178+
.tab.is-selected:focus-visible {
179+
outline: 0.0625rem auto $ui-black;
180+
outline-offset: -0.125rem; /* Looks better, otherwise it gets cut off by the canvas below */
181+
z-index: 5; /* Display above tabs */
174182
}
175183

176184
/* Body of the tabs */

packages/scratch-gui/src/css/colors.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ $ui-transparent: hsla(0, 100%, 100%, 0); /* 25% transparent version of ui-white
1313
$ui-black-transparent: hsla(0, 0%, 0%, 0.15); /* 15% transparent version of black */
1414
$ui-black-transparent-10: hsla(0, 0%, 0%, 0.10); /* 10% transparent version of black */
1515

16+
$ui-black: hsla(0, 0%, 0%, 1); /* #000000 */
17+
1618
$ui-green: hsla(163, 85%, 35%, 1); /* #0DA57A */
1719
$ui-green-2: hsla(163, 85%, 40%, 1); /* #0FBD8C */
1820

0 commit comments

Comments
 (0)