Skip to content

Commit

Permalink
Revert "fix: use blue focus color everywhere"
Browse files Browse the repository at this point in the history
This reverts commit 15c538c.
  • Loading branch information
kkmch committed Oct 3, 2023
1 parent 6c6e935 commit 28ebc66
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/blocks/Slider/Arrow/Arrow.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ $block: '.#{$ns}slider-block-arrow';
}

&__button {
--g-color-line-focus: var(--g-color-text-brand);
@include reset-button-style();
@include shadow();
@extend %flex;
Expand Down
9 changes: 9 additions & 0 deletions src/components/Button/Button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ $block: '.#{$ns}button-block';
&_monochrome {
@include monochrome-button();
}

&_normal-contrast,
&_raised {
--yc-button-outline-color: var(--yc-button-background-color);

&:focus::before {
outline-offset: 1px;
}
}
}

&_size {
Expand Down
6 changes: 6 additions & 0 deletions src/components/ButtonTabs/ButtonTabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ $block: '.#{$ns}button-tabs';

#{$block} {
&__item {
--g-color-line-focus: var(--g-color-text-brand);

@include add-specificity(&) {
margin-right: $indentXXXS;
margin-bottom: $indentXXS;
Expand All @@ -16,13 +18,17 @@ $block: '.#{$ns}button-tabs';
);

&_active {
--g-color-line-focus: var(--pc-selected-tab-item-background-color);
pointer-events: none;

@include button(
var(--pc-selected-tab-item-color),
var(--pc-selected-tab-item-background-color),
$hoverBackgroundColor: var(--pc-selected-tab-item-background-color-hover)
);
&:focus::before {
outline-offset: 1px;
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/components/FullscreenImage/FullscreenImage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ $closeButtonSize: 36px;
}

&__icon-wrapper {
--g-color-line-focus: var(--g-color-text-brand);
@include reset-button-style();
@include focusable();

Expand Down
1 change: 1 addition & 0 deletions src/components/Link/Link.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ $block: '.#{$ns}link-block';
display: inline-flex;

&__link {
--g-color-line-focus: currentColor;
@include link();

display: flex;
Expand Down
1 change: 1 addition & 0 deletions src/components/Title/TitleItem.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ $block: '.#{$ns}title-item';
}

&__link {
--g-color-line-focus: var(--g-color-text-link);
@include reset-link-style();
@include reset-link-hover();
@include focusable();
Expand Down
7 changes: 7 additions & 0 deletions src/sub-blocks/BannerCard/BannerCard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ $block: '.#{$ns}banner-card';
color: var(--g-color-text-light-primary);
}
}

#{$class}__button {
--g-color-line-focus: var(--g-color-text-light-primary);
&:focus::before {
outline-offset: 1px;
}
}
}
}

Expand Down
1 change: 1 addition & 0 deletions src/sub-blocks/BasicCard/BasicCard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ $block: '.#{$ns}basic-card';
#{$block} {
$iconSizePositionTop: 32px;
$iconSizePositionLeft: 22px;
--g-color-line-focus: var(--g-color-text-brand);

@include add-specificity(&) {
min-height: auto;
Expand Down
3 changes: 2 additions & 1 deletion src/sub-blocks/HubspotForm/HubspotForm.scss
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,9 @@ $block: '.#{$ns}hubspot-form';
}

.hs-button.primary {
--g-color-line-focus: var(--g-color-base-brand);
@include button-reset();
@include focusable();
@include focusable(1px);
display: inline-block;
position: relative;
overflow: visible;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ $settingsIndentBetweenTitleAndDescriptionHeight: 2px;
}

&__foldable_title {
--g-color-line-focus: currentColor;
@include text-size(body-2);
@include reset-button-style();
@include focusable();
Expand Down
3 changes: 2 additions & 1 deletion styles/mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
line-height: var(--g-text-#{$name}-line-height);
}

@mixin focusable() {
@mixin focusable($offset: 0) {
&:focus {
outline: 2px solid var(--g-color-line-focus);
outline-offset: $offset;
}
&:focus:not(:focus-visible) {
outline: 0;
Expand Down
1 change: 0 additions & 1 deletion styles/root.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
@include pc-colors-social;

--g-text-accent-font-weight: 500;
--g-color-line-focus: #3277ff;

// cross-browser transparent color
--pc-transparent: rgba(255, 255, 255, 0);
Expand Down
1 change: 1 addition & 0 deletions styles/yfm.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
}

a {
--g-color-line-focus: currentColor;
@include link();
}

Expand Down

0 comments on commit 28ebc66

Please sign in to comment.