Skip to content

Commit

Permalink
feat: add focus als general _init.scss (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
nmerget authored Nov 22, 2022
1 parent c7cdfca commit 5083e91
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
24 changes: 24 additions & 0 deletions scss/_init.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@use "variables" as *;

:root {
--db-focus-outline-offset: 1px;
--db-focus-outline-color: #{$db-colors-information-enabled};
--db-focus-outline-transition-duration: #{$db-transition-duration-ultra-fast};
--db-focus-outline-size: max(2px, 0.08em);
}

// Focus styles
%focus-placeholder,
:is(a, button, input, textarea, summary) {
transition: outline var(--db-focus-outline-transition-duration);

&:focus-visible {
outline: var(--db-focus-outline-size)
var(--db-focus-outline-style, solid)
var(--db-focus-outline-color, currentColor);
outline-offset: var(
--db-focus-outline-offset,
var(--db-focus-outline-size)
);
}
}
1 change: 1 addition & 0 deletions scss/db-ui-base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
@use "variables.global" as *;
@use "color-placeholder" as *;
@use "tonality" as *;
@use "init" as *;

:root {
@extend %db-ui-normal;
Expand Down
4 changes: 4 additions & 0 deletions tokens/transition.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
"fast": {
"value": "0.3s",
"comment": "Consider this as beta for the moment"
},
"ultra-fast": {
"value": "0.06s",
"comment": "Consider this as beta for the moment"
}
},
"emotional": {
Expand Down

0 comments on commit 5083e91

Please sign in to comment.