Skip to content

Commit

Permalink
Merge pull request #667 from qld-gov-au/QOL-9484-primary-button-links
Browse files Browse the repository at this point in the history
QOLDEV-34 fix underline on hover for footer buttons
  • Loading branch information
ThrawnCA authored Dec 12, 2022
2 parents 9e7c88a + feed5a7 commit be66e0b
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
}
}
button:focus, button.focus {
outline: 2px solid #0096d6 !important;
outline: 2px solid $qg-active-outline !important;
outline-offset: 2px;
z-index: 100;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
@include button-variant($qg-light-green, $qg-light-green, lighten($qg-light-green, 7.5%), $hover-border: $qg-light-green, $active-background:$qg-light-green, $active-border: $qg-light-green);
color: #000;
a, &:focus:not(:disabled), &:hover:not(:disabled), &:link:not(:disabled), &:visited:not(:disabled), &:active:not(:disabled), &.focus:not(:disabled), &.hover:not(:disabled), &.link:not(:disabled), &.visited:not(:disabled), &.active:not(:disabled) {
text-decoration-line: none !important;
color: #000 !important;
}
}
Expand All @@ -89,7 +88,6 @@
color: #fff;
a, &:focus, &:hover, &:link, &:visited, &:active, &.focus, &.hover, &.link, &.visited, &.active {
color: #fff !important;
text-decoration-line: none !important;
}
}

Expand All @@ -98,7 +96,6 @@
color: #fff;
a, &:focus, &:hover, &:link, &:visited, &:active, &.focus, &.hover, &.link, &.visited, &.active {
color: #fff !important;
text-decoration-line: none !important;
}
}

Expand All @@ -110,6 +107,8 @@

.qg-btn {
@extend .btn;
@include qg-button-outline-decoration;

&.btn-outline-dark{
color: $qg-outline-dark;
background-color: transparent !important;
Expand All @@ -133,7 +132,7 @@
}
}

#body .qg-btn, #body .btn, {
#body .qg-btn, #body .btn, body .qg-btn, body .btn, {
// override default .btn styling
@include qg-link-hover-decoration;
}
8 changes: 1 addition & 7 deletions src/assets/_project/_blocks/components/link/_qg-link.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,8 @@
// background: none;
// }
&:not(.btn-link) {
&:active,
&:focus,
&:focus-visible,
&.active,
&.focus {
@include qg-button-outline-decoration {
background-color: transparent;
outline: 3px solid #0096d6;
outline-offset: 2px;
}
}
@content;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
transition: all .3s ease;
white-space: nowrap;
top: 9px;
@include qg-link-hover-decoration;
}

&[aria-expanded=true] {
Expand All @@ -28,12 +29,6 @@
border-radius: 0 0 4px 4px;
}
}

&:hover,&:focus {
.qg-service-centre-set-location__text {
text-decoration-line: underline;
}
}
}

&__link{
Expand Down
15 changes: 15 additions & 0 deletions src/assets/_project/_blocks/scss-general/_qg-variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ $qg-green: #78ba00;
$qg-outline-dark: #00698f;
$qg-outline-dark-hover: #313131;

// ## Active outlines (transient) ##
$qg-active-outline: #0096d6;

// ## Dark grey ##
$qg-dark-grey-lightest: #949494;
$qg-dark-gray-lighter: #8a8f91; // Lightest for large text on white
Expand Down Expand Up @@ -286,3 +289,15 @@ $qg-linkedin: #0077b5;
@content;
}
$text-underline-offset: 5px;

@mixin qg-button-outline-decoration {
// Surround buttons and links with a blue outline when active/focused
&:active, &.active,
&:focus, &.focus, &:focus-visible {
outline-width: 3px;
outline-style: solid;
outline-color: $qg-active-outline;
outline-offset: 2px;
@content;
}
}

0 comments on commit be66e0b

Please sign in to comment.