Skip to content

Commit

Permalink
fix: fixed button outline
Browse files Browse the repository at this point in the history
  • Loading branch information
PKulkoRaccoonGang committed Jun 22, 2023
1 parent 813da66 commit d16e6ed
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/Nav/Nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
border: $nav-pills-link-border-width solid $nav-pills-link-border-color;

&:focus {
@include nav-tabs-link-focus($nav-tabs-link-focus-border-color);
@include nav-tabs-link-focus($nav-tabs-link-focus-border-color, $nav-pills-border-radius);
}

&:hover {
Expand All @@ -58,7 +58,7 @@
border-color: $nav-pills-link-active-border-color;

&:focus {
@include nav-tabs-link-focus($nav-tabs-link-focus-border-color);
@include nav-tabs-link-focus($nav-tabs-link-focus-border-color, $nav-pills-border-radius);
}
}
}
Expand Down
16 changes: 10 additions & 6 deletions src/Nav/_mixins.scss
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
@mixin nav-tabs-link-focus($border-color) {
@mixin nav-tabs-link-focus(
$border-color,
$radius: $nav-tabs-border-radius,
$distance: $nav-tabs-link-distance-to-border
) {
position: relative;
outline: 0;
z-index: map-get($map: $indexes, $key: 1);

&::before {
content: "";
position: absolute;
top: calc(#{$nav-tabs-link-distance-to-border} * -1);
right: calc(#{$nav-tabs-link-distance-to-border} * -1);
bottom: calc(#{$nav-tabs-link-distance-to-border} * -1);
left: calc(#{$nav-tabs-link-distance-to-border} * -1);
top: calc(#{$distance} * -1);
right: calc(#{$distance} * -1);
bottom: calc(#{$distance} * -1);
left: calc(#{$distance} * -1);
border: solid $nav-tabs-border-width $border-color;
border-radius: $nav-tabs-border-radius;
border-radius: $radius;
}
}
11 changes: 6 additions & 5 deletions src/Tabs/Tabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,12 @@
background-color: $tab-inverse-pills-link-dropdown-toggle-active-hover-bg;
}

&:focus::before {
top: calc(#{$tab-inverse-pills-link-dropdown-distance} * -1);
bottom: calc(#{$tab-inverse-pills-link-dropdown-distance} * -1);
right: calc(#{$tab-inverse-pills-link-dropdown-distance} * -1);
left: calc(#{$tab-inverse-pills-link-dropdown-distance} * -1);
&:focus {
@include nav-tabs-link-focus(
$tab-inverse-pills-link-dropdown-toggle-focus-border-color,
$nav-tabs-border-radius,
$tab-inverse-pills-link-dropdown-distance
);
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/Tabs/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ $tab-inverse-pills-link-dropdown-toggle-padding-x: .625rem !default;
$tab-inverse-pills-link-dropdown-toggle-padding-y: $spacer !default;
$tab-inverse-pills-link-dropdown-toggle-focus-bg: $white !default;
$tab-inverse-pills-link-dropdown-toggle-focus-color: $primary-500 !default;
$tab-inverse-pills-link-dropdown-toggle-focus-border-color: $tab-inverse-pills-link-dropdown-toggle-focus-bg !default;
$tab-inverse-pills-link-dropdown-toggle-active-color: $tab-inverse-pills-link-dropdown-toggle-focus-color !default;
$tab-inverse-pills-link-dropdown-toggle-active-hover-color: $tab-inverse-pills-link-dropdown-toggle-focus-bg !default;
$tab-inverse-pills-link-dropdown-toggle-active-hover-bg: $primary-300 !default;
Expand Down

0 comments on commit d16e6ed

Please sign in to comment.