Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Commit 7385c0b

Browse files
authored
fix: focus styles adjustment for buttons, button-group and icon-button (#203)
1 parent 8ecafb6 commit 7385c0b

File tree

5 files changed

+22
-11
lines changed

5 files changed

+22
-11
lines changed

src/govie/components/button-group/_index.scss

+15-7
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,16 @@ $govie-button-group-button-hover-background-colour: govie-tint(
4545
background-color: $govie-button-group-button-hover-background-colour;
4646
border-color: $govie-primary-button-background-colour;
4747
color: govie-colour('black');
48+
}
4849

49-
&:not(:active):not(:hover) {
50-
border-color: $govie-primary-button-background-colour;
51-
}
50+
// Separate selector rule to override `govie-button` original focus styles.
51+
&:focus:not(:active):not(:hover) {
52+
border-color: $govie-input-border-colour;
53+
background-color: transparent;
54+
color: $govie-primary-button-background-colour;
55+
box-shadow: inset 0 0 0 $govie-border-width-form-element
56+
$govie-focus-colour;
57+
outline: unset;
5258
}
5359

5460
&:first-of-type {
@@ -57,10 +63,10 @@ $govie-button-group-button-hover-background-colour: govie-tint(
5763
border-top-right-radius: 4px;
5864
}
5965

60-
&:first-of-type {
61-
border-top-left-radius: 4px;
62-
border-bottom-left-radius: 0;
63-
border-top-right-radius: 4px;
66+
&:last-of-type {
67+
border-bottom-left-radius: 4px;
68+
border-top-left-radius: 0;
69+
border-bottom-right-radius: 4px;
6470
}
6571

6672
&:not(:first-child) {
@@ -110,11 +116,13 @@ $govie-button-group-button-hover-background-colour: govie-tint(
110116
&:first-of-type {
111117
border-top-left-radius: 4px;
112118
border-bottom-left-radius: 4px;
119+
border-top-right-radius: 0px;
113120
}
114121

115122
&:last-of-type {
116123
border-top-right-radius: 4px;
117124
border-bottom-right-radius: 4px;
125+
border-bottom-left-radius: 0px;
118126
}
119127

120128
&:not(:first-child) {

src/govie/components/button/_index.scss

+1
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ $govie-tertiary-button-text-colour: govie-colour('black') !default;
202202

203203
&:focus:not(:active):not(:hover) {
204204
border-color: $govie-focus-colour;
205+
outline: $govie-focus-width solid $govie-input-border-colour;
205206
box-shadow: 0 2px 0 transparent;
206207
}
207208

src/govie/components/icon-button/_index.scss

+4-2
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,10 @@ $govie-icon-button-hover-background-colour: govie-colour('mid-grey') !default;
110110
}
111111

112112
&:focus:not(:active):not(:hover) {
113-
border-color: transparent;
114-
box-shadow: none;
113+
border-color: $govie-input-border-colour;
114+
box-shadow: inset 0 0 0 $govie-border-width-form-element
115+
$govie-focus-colour;
116+
outline: unset;
115117
}
116118

117119
// The following adjustments do not work for <input type="button"> as

storybook/dist/@ogcio/ogcio-ds-ie.min.css

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

storybook/dist/@ogcio/ogcio-ds.min.css

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

0 commit comments

Comments
 (0)