Skip to content

Commit

Permalink
Improve backwards-compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
pastelcyborg committed Sep 2, 2024
1 parent 10d329d commit 0da9fb0
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 17 deletions.
2 changes: 1 addition & 1 deletion scss/_base_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

%vf-button-base {
@include vf-transition(#{background-color, border-color}, snap, in);
@include vf-focus;
@include vf-focus-themed;

border-style: solid;
border-width: $input-border-thickness;
Expand Down
2 changes: 1 addition & 1 deletion scss/_base_details.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

summary {
@extend %common-default-text-properties;
@include vf-focus;
@include vf-focus-themed;

margin-bottom: $spv-nudge; //push subsequent text onto baseline
max-width: $text-max-width;
Expand Down
4 changes: 2 additions & 2 deletions scss/_base_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// Default form input element styles
%vf-input-elements {
@extend %bordered-text-vertical-padding;
@include vf-focus($has-validation: true);
@include vf-focus-themed($has-validation: true);
@include vf-animation(#{background-color}, fast);

// stylelint-disable property-no-vendor-prefix
Expand Down Expand Up @@ -145,7 +145,7 @@

[type='file'] {
@extend %bordered-text-vertical-padding;
@include vf-focus;
@include vf-focus-themed;

margin-bottom: $input-margin-bottom;
width: 100%;
Expand Down
2 changes: 1 addition & 1 deletion scss/_base_links.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
}

%vf-link-base {
@include vf-focus;
@include vf-focus-themed;

color: $colors--theme--link-default;
text-decoration: none;
Expand Down
8 changes: 7 additions & 1 deletion scss/_global_functions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

// Adds visual focus to elements on :focus-visible or :focus if the browser
// doesn't support the former
@mixin vf-focus($light-color: $colors--light-theme--focus, $dark-color: $colors--dark-theme--focus, $width: $bar-thickness, $has-validation: false) {
@mixin vf-focus-themed($light-color: $colors--light-theme--focus, $dark-color: $colors--dark-theme--focus, $width: $bar-thickness, $has-validation: false) {
--vf-focus-outline-color: #{$light-color};

.is-dark & {
Expand Down Expand Up @@ -99,6 +99,12 @@
}
}

// This mixin is deprecated and will be removed in a future version of Vanilla.
// Please use vf-focus-themed instead.
@mixin vf-focus($color: $colors--theme--focus, $width: $bar-thickness, $has-validation: false) {
@include vf-focus-themed($light-color: $color, $width: $width, $has-validation: $has-validation);
}

// Raises a number to a power (https://css-tricks.com/snippets/sass/power-function/)
@function pow($number, $exponent) {
$value: 1;
Expand Down
2 changes: 1 addition & 1 deletion scss/_patterns_accordion.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

.p-accordion__tab {
@extend %single-border-text-vpadding--scaling;
@include vf-focus;
@include vf-focus-themed;

background-color: inherit;
border: 0;
Expand Down
2 changes: 1 addition & 1 deletion scss/_patterns_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
$button-disabled-border-color: $colors--theme--button-positive-default,
$button-text-color: $colors--theme--button-positive-text
);
@include vf-focus($light-color: $color-focus-positive);
@include vf-focus-themed($light-color: $color-focus-positive);
}
}

Expand Down
2 changes: 1 addition & 1 deletion scss/_patterns_chip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ $chip-border-thickness: 1px;
%vf-chip {
@extend %small-text;
@include vf-transition(#{background-color, border-color}, snap, out);
@include vf-focus;
@include vf-focus-themed;

align-items: baseline;
border-radius: 1rem;
Expand Down
2 changes: 1 addition & 1 deletion scss/_patterns_contextual-menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
}

.p-contextual-menu__link {
@include vf-focus;
@include vf-focus-themed;

border: 0;
clear: both;
Expand Down
2 changes: 1 addition & 1 deletion scss/_patterns_links.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
top: -999px;

&:focus {
@include vf-focus;
@include vf-focus-themed;

left: 0;
padding: $spv--x-small;
Expand Down
4 changes: 2 additions & 2 deletions scss/_patterns_list-tree.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
}

.p-list-tree__item {
@include vf-focus;
@include vf-focus-themed;

margin-top: $sp-xx-small;
padding-left: 0.8rem;
Expand All @@ -69,7 +69,7 @@
}

.p-list-tree__toggle {
@include vf-focus;
@include vf-focus-themed;

background: transparent;
border: 0;
Expand Down
6 changes: 3 additions & 3 deletions scss/_patterns_navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ $navigation-height: calc(map-get($line-heights, default-text) + 2 * $spv--large)
@extend %navigation-link-text;
@extend %vf-navigation-separator;
@include vf-transition($properties, snap);
@include vf-focus;
@include vf-focus-themed;

// override button styles
background-color: transparent;
Expand Down Expand Up @@ -327,7 +327,7 @@ $navigation-height: calc(map-get($line-heights, default-text) + 2 * $spv--large)
margin: 0 $sph--large 0 0;

.p-navigation__item {
@include vf-focus;
@include vf-focus-themed;

display: flex;
}
Expand Down Expand Up @@ -478,7 +478,7 @@ $navigation-height: calc(map-get($line-heights, default-text) + 2 * $spv--large)
@extend %navigation-link-responsive-padding-horizontal;
@extend %navigation-link-responsive-padding-vertical;
@extend %navigation-link-text;
@include vf-focus;
@include vf-focus-themed;

margin: 0 0 auto 0;
}
Expand Down
2 changes: 1 addition & 1 deletion scss/_patterns_side-navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@
}

%side-navigation__link {
@include vf-focus;
@include vf-focus-themed;

&,
&:visited {
Expand Down

0 comments on commit 0da9fb0

Please sign in to comment.