Skip to content

Commit

Permalink
feat(style): use common focus mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
dpellier committed Jul 29, 2024
1 parent 7ac8d53 commit 3484013
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
5 changes: 3 additions & 2 deletions packages/ods/src/style/_button.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import './focus';

@mixin ods-button($color, $size, $variant) {
display: inline-flex;
align-items: center;
Expand All @@ -24,8 +26,7 @@

&:not(:disabled) {
&:focus {
outline: solid 2px var(--ods-color-primary-700);
outline-offset: 2px;
@include ods-focus;
}
}

Expand Down
4 changes: 4 additions & 0 deletions packages/ods/src/style/_focus.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@mixin ods-focus() {
outline: var(--ods-outline-style) var(--ods-outline-width) var(--ods-color-primary-700);
outline-offset: var(--ods-outline-offset);
}
5 changes: 3 additions & 2 deletions packages/ods/src/style/_link.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import './focus';

@mixin ods-link() {
display: inline-flex;
align-items: center;
Expand All @@ -18,7 +20,6 @@
}

&:focus-visible {
outline: currentcolor var(--ods-outline-style) var(--ods-outline-width);
outline-offset: var(--ods-outline-offset);
@include ods-focus;
}
}
3 changes: 2 additions & 1 deletion packages/ods/src/style/index.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@forward 'button';
@forward 'focus';
@forward 'link';
@forward 'skeleton';
@forward 'text';
@forward 'tooltip';
@forward 'link';

0 comments on commit 3484013

Please sign in to comment.