diff --git a/.changeset/cuddly-panthers-tickle.md b/.changeset/cuddly-panthers-tickle.md new file mode 100644 index 0000000000..8db5e9c392 --- /dev/null +++ b/.changeset/cuddly-panthers-tickle.md @@ -0,0 +1,5 @@ +--- +'@swisspost/design-system-styles': patch +--- + +Extended the `focus-style` mixin by optional parameters to use it together with tokens. diff --git a/packages/styles/src/mixins/_utilities.scss b/packages/styles/src/mixins/_utilities.scss index c84992cd65..b894c0cae0 100644 --- a/packages/styles/src/mixins/_utilities.scss +++ b/packages/styles/src/mixins/_utilities.scss @@ -94,12 +94,17 @@ outline: none; } -@mixin focus-style($additional-selector: '') { +@mixin focus-style( + $additional-selector: '', + $offset: spacing.$size-line, + $width: spacing.$size-line, + $color: var(--post-focus-color) +) { &#{$additional-selector} { outline-style: none !important; // !important is needed to override bootstrap .form-control:focus - outline-offset: spacing.$size-line !important; - outline-width: spacing.$size-line !important; - outline-color: var(--post-focus-color) !important; + outline-offset: $offset !important; + outline-width: $width !important; + outline-color: $color !important; } // :has(:focus-visible) mimic a focus-visible-within pseudo-class