-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Focus iteration #1245
Focus iteration #1245
Changes from all commits
5d58b5e
e539d25
02ed643
722b000
8871a6e
9fb29f8
937a8fa
3913b96
6b176d6
b52ec9a
e3c357b
51d737c
a3587a9
e3de618
ac54e29
1beddce
5df9cd0
5c66727
39bb90f
df60ec5
9bb5e1b
f75c406
094ef10
17813ee
fc65516
ceeb493
279d5c4
393f7c4
2bf65e3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,11 @@ | |
// Underline is provided by a bottom border | ||
text-decoration: none; | ||
|
||
|
||
&:focus { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We may be able to close #1236 with the focus state change here. |
||
border-bottom: 1px solid govuk-colour("yellow"); | ||
} | ||
|
||
// Prepend left pointing arrow | ||
&:before { | ||
@include govuk-shape-arrow($direction: left, $base: 10px, $height: 6px); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
|
||
@include govuk-exports("govuk/component/button") { | ||
|
||
$govuk-button-colour: #00823b; | ||
$govuk-button-colour: govuk-colour("green"); | ||
$govuk-button-hover-colour: darken($govuk-button-colour, 5%); | ||
$govuk-button-shadow-colour: darken($govuk-button-colour, 15%); | ||
$govuk-button-text-colour: govuk-colour("white"); | ||
|
@@ -27,6 +27,7 @@ | |
padding: (govuk-spacing(2) - $govuk-border-width-form-element - ($button-shadow-size / 2)) govuk-spacing(2); // s1 | ||
border: $govuk-border-width-form-element solid transparent; | ||
border-radius: 0; | ||
outline: $govuk-focus-width solid transparent !important; | ||
color: $govuk-button-text-colour; | ||
background-color: $govuk-button-colour; | ||
box-shadow: 0 $button-shadow-size 0 $govuk-button-shadow-colour; // s0 | ||
|
@@ -69,14 +70,29 @@ | |
border: 0; | ||
} | ||
|
||
&:hover, | ||
&:focus { | ||
padding-bottom: 5px; | ||
color: govuk-colour("black"); | ||
background-color: govuk-colour("yellow"); | ||
box-shadow: 0 4px 0 govuk-colour("black"); | ||
} | ||
|
||
&:hover { | ||
color: govuk-colour("white"); | ||
background-color: $govuk-button-hover-colour; | ||
} | ||
|
||
&:active { | ||
top: $button-shadow-size; | ||
box-shadow: none; | ||
padding-bottom: 8px; | ||
border: $govuk-border-width-form-element solid govuk-colour("yellow"); | ||
color: govuk-colour("white"); | ||
background-color: $govuk-button-hover-colour; | ||
box-shadow: inset 0 0 0 1px govuk-colour("yellow"); | ||
|
||
&:before { | ||
box-shadow: none; | ||
} | ||
|
||
@include govuk-if-ie8 { | ||
border-bottom-width: 0; | ||
|
@@ -95,9 +111,9 @@ | |
position: absolute; | ||
|
||
top: -$govuk-border-width-form-element; | ||
right: -$govuk-border-width-form-element; | ||
right: -5px; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if these changes are required or not. |
||
bottom: -($govuk-border-width-form-element + $button-shadow-size); | ||
left: -$govuk-border-width-form-element; | ||
left: -5px; | ||
|
||
background: transparent; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,6 +125,7 @@ | |
// Since box-shadows are removed when users customise their colours, we set | ||
// a transparent outline that is shown instead. | ||
// https://accessibility.blog.gov.uk/2017/03/27/how-users-change-colours-on-websites/ | ||
border: 4px solid govuk-colour("black"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Think this can just be |
||
outline: $govuk-focus-width solid transparent; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This might not be required any more, with the border-width change. |
||
outline-offset: $govuk-focus-width; | ||
box-shadow: 0 0 0 $govuk-focus-width $govuk-focus-colour; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ | |
margin-bottom: govuk-spacing(1); | ||
|
||
// Allow for absolutely positioned marker and align with disclosed text | ||
padding-left: govuk-spacing(4) + $govuk-border-width; | ||
padding-left: govuk-spacing(3) + $govuk-border-width; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
// Style the summary to look like a link... | ||
color: $govuk-link-colour; | ||
|
@@ -39,13 +39,16 @@ | |
} | ||
|
||
.govuk-details__summary:focus { | ||
@include govuk-focusable-text; | ||
|
||
// -1px offset fixes gap between background and outline in Firefox | ||
outline: ($govuk-focus-width + 1px) solid $govuk-focus-colour; | ||
outline: ($govuk-focus-width + 1px) solid transparent; | ||
outline-offset: -1px; | ||
// When focussed, the text colour needs to be darker to ensure that colour | ||
// contrast is still acceptable | ||
color: $govuk-focus-text-colour; | ||
background: $govuk-focus-colour; | ||
|
||
// remove underline on link | ||
.govuk-details__summary-text { | ||
text-decoration: none; | ||
} | ||
} | ||
|
||
// Remove the default details marker so we can style our own consistently and | ||
|
@@ -59,7 +62,7 @@ | |
content: ""; | ||
position: absolute; | ||
|
||
top: 0; | ||
top: -1px; | ||
bottom: 0; | ||
left: 0; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From talking to @dashouse, this is removing the user agent default styling.