diff options
| author | Volpeon <git@volpeon.ink> | 2024-06-25 17:39:03 +0200 |
|---|---|---|
| committer | Volpeon <git@volpeon.ink> | 2024-06-25 17:39:03 +0200 |
| commit | 4de75e0f305b2cb4a026073440f2bac7c34df817 (patch) | |
| tree | 628f71b6f917bb9357ae14d018149509db655e4e /src/objects/_badge.scss | |
| parent | Update (diff) | |
| download | iro-design-4de75e0f305b2cb4a026073440f2bac7c34df817.tar.gz iro-design-4de75e0f305b2cb4a026073440f2bac7c34df817.tar.bz2 iro-design-4de75e0f305b2cb4a026073440f2bac7c34df817.zip | |
Focus indicator style
Diffstat (limited to 'src/objects/_badge.scss')
| -rw-r--r-- | src/objects/_badge.scss | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/src/objects/_badge.scss b/src/objects/_badge.scss index b9020b6..cc7e500 100644 --- a/src/objects/_badge.scss +++ b/src/objects/_badge.scss | |||
| @@ -12,7 +12,8 @@ $static-themes: 'black' 'white' !default; | |||
| 12 | &:link, | 12 | &:link, |
| 13 | &:visited, | 13 | &:visited, |
| 14 | &:enabled { | 14 | &:enabled { |
| 15 | &:hover { | 15 | &:hover, |
| 16 | &:focus-visible { | ||
| 16 | background-color: fn.color(--#{$theme} --hover --bg); | 17 | background-color: fn.color(--#{$theme} --hover --bg); |
| 17 | color: fn.color(--#{$theme} --hover --label); | 18 | color: fn.color(--#{$theme} --hover --label); |
| 18 | } | 19 | } |
| @@ -30,7 +31,8 @@ $static-themes: 'black' 'white' !default; | |||
| 30 | &:link, | 31 | &:link, |
| 31 | &:visited, | 32 | &:visited, |
| 32 | &:enabled { | 33 | &:enabled { |
| 33 | &:hover { | 34 | &:hover, |
| 35 | &:focus-visible { | ||
| 34 | background-color: fn.color(--#{$theme}-quiet --hover --bg); | 36 | background-color: fn.color(--#{$theme}-quiet --hover --bg); |
| 35 | color: fn.color(--#{$theme}-quiet --hover --label); | 37 | color: fn.color(--#{$theme}-quiet --hover --label); |
| 36 | } | 38 | } |
| @@ -47,10 +49,8 @@ $static-themes: 'black' 'white' !default; | |||
| 47 | &:visited, | 49 | &:visited, |
| 48 | &:enabled { | 50 | &:enabled { |
| 49 | &:focus-visible { | 51 | &:focus-visible { |
| 50 | border-color: fn.color(--#{$theme} --key-focus --border); | 52 | outline: fn.color(--#{$theme} --key-focus --border) solid fn.dim(--key-focus --border); |
| 51 | outline: fn.color(--#{$theme} --key-focus --outline) solid fn.dim(--key-focus --outline); | 53 | box-shadow: 0 0 0 calc(fn.dim(--key-focus --border) + fn.dim(--key-focus --outline)) fn.color(--#{$theme} --key-focus --outline); |
| 52 | background-color: fn.color(--#{$theme} --key-focus --bg); | ||
| 53 | color: fn.color(--#{$theme} --key-focus --label); | ||
| 54 | } | 54 | } |
| 55 | } | 55 | } |
| 56 | } | 56 | } |
| @@ -85,8 +85,9 @@ $static-themes: 'black' 'white' !default; | |||
| 85 | ), | 85 | ), |
| 86 | 86 | ||
| 87 | --key-focus: ( | 87 | --key-focus: ( |
| 88 | --border: fn.global-dim(--border --medium), | 88 | --border: fn.global-dim(--key-focus --border), |
| 89 | --outline: fn.global-dim(--key-focus --border), | 89 | --border-offset: fn.global-dim(--key-focus --border-offset), |
| 90 | --outline: fn.global-dim(--key-focus --outline), | ||
| 90 | ), | 91 | ), |
| 91 | ), | 92 | ), |
| 92 | --colors: ( | 93 | --colors: ( |
| @@ -99,10 +100,9 @@ $static-themes: 'black' 'white' !default; | |||
| 99 | --bg: fn.global-color(--heading), | 100 | --bg: fn.global-color(--heading), |
| 100 | ), | 101 | ), |
| 101 | --key-focus: ( | 102 | --key-focus: ( |
| 102 | --bg: fn.global-color(--base --50), | 103 | --label: fn.global-color(--focus --text), |
| 103 | --label: fn.global-color(--heading), | 104 | --border: fn.global-color(--focus --border), |
| 104 | --border: fn.global-color(--focus --1100), | 105 | --outline: fn.global-color(--focus --outline), |
| 105 | --outline: fn.global-color(--focus --400), | ||
| 106 | ), | 106 | ), |
| 107 | 107 | ||
| 108 | --quiet: ( | 108 | --quiet: ( |
| @@ -190,11 +190,13 @@ $static-themes: 'black' 'white' !default; | |||
| 190 | 190 | ||
| 191 | @include iro.bem-object(iro.props-namespace()) { | 191 | @include iro.bem-object(iro.props-namespace()) { |
| 192 | display: inline-block; | 192 | display: inline-block; |
| 193 | padding-block: calc(fn.dim(--pad-b) - fn.dim(--key-focus --border)); | 193 | margin: calc(-1 * fn.dim(--key-focus --border)); |
| 194 | padding-inline: calc(fn.dim(--pad-i) - fn.dim(--key-focus --border)); | 194 | padding-block: fn.dim(--pad-b); |
| 195 | padding-inline: fn.dim(--pad-i); | ||
| 195 | border: fn.dim(--key-focus --border) solid transparent; | 196 | border: fn.dim(--key-focus --border) solid transparent; |
| 196 | border-radius: fn.dim(--rounding); | 197 | border-radius: calc(fn.dim(--rounding) + fn.dim(--key-focus --border)); |
| 197 | background-color: fn.color(--bg); | 198 | background-color: fn.color(--bg); |
| 199 | background-clip: padding-box; | ||
| 198 | color: fn.color(--label); | 200 | color: fn.color(--label); |
| 199 | font-size: fn.dim(--font-size); | 201 | font-size: fn.dim(--font-size); |
| 200 | line-height: fn.global-dim(--font --standard --line-height); | 202 | line-height: fn.global-dim(--font --standard --line-height); |
| @@ -204,7 +206,8 @@ $static-themes: 'black' 'white' !default; | |||
| 204 | &:link, | 206 | &:link, |
| 205 | &:visited, | 207 | &:visited, |
| 206 | &:enabled { | 208 | &:enabled { |
| 207 | &:hover { | 209 | &:hover, |
| 210 | &:focus-visible { | ||
| 208 | background-color: fn.color(--hover --bg); | 211 | background-color: fn.color(--hover --bg); |
| 209 | } | 212 | } |
| 210 | 213 | ||
| @@ -220,7 +223,8 @@ $static-themes: 'black' 'white' !default; | |||
| 220 | &:link, | 223 | &:link, |
| 221 | &:visited, | 224 | &:visited, |
| 222 | &:enabled { | 225 | &:enabled { |
| 223 | &:hover { | 226 | &:hover, |
| 227 | &:focus-visible { | ||
| 224 | background-color: fn.color(--quiet --hover --bg); | 228 | background-color: fn.color(--quiet --hover --bg); |
| 225 | } | 229 | } |
| 226 | 230 | ||
| @@ -240,10 +244,8 @@ $static-themes: 'black' 'white' !default; | |||
| 240 | &:visited, | 244 | &:visited, |
| 241 | &:enabled { | 245 | &:enabled { |
| 242 | &:focus-visible { | 246 | &:focus-visible { |
| 243 | border-color: fn.color(--key-focus --border); | 247 | outline: fn.color(--key-focus --border) solid fn.dim(--key-focus --border); |
| 244 | outline: fn.color(--key-focus --outline) solid fn.dim(--key-focus --outline); | 248 | box-shadow: 0 0 0 calc(fn.dim(--key-focus --border) + fn.dim(--key-focus --outline)) fn.color(--key-focus --outline); |
| 245 | background-color: fn.color(--key-focus --bg); | ||
| 246 | color: fn.color(--key-focus --label); | ||
| 247 | } | 249 | } |
| 248 | } | 250 | } |
| 249 | 251 | ||
| @@ -260,8 +262,8 @@ $static-themes: 'black' 'white' !default; | |||
| 260 | 262 | ||
| 261 | @each $size in sm lg xl { | 263 | @each $size in sm lg xl { |
| 262 | @include iro.bem-modifier($size) { | 264 | @include iro.bem-modifier($size) { |
| 263 | padding-block: calc(fn.dim(--#{$size} --pad-b) - fn.dim(--key-focus --border)); | 265 | padding-block: fn.dim(--#{$size} --pad-b); |
| 264 | padding-inline: calc(fn.dim(--#{$size} --pad-i) - fn.dim(--key-focus --border)); | 266 | padding-inline: fn.dim(--#{$size} --pad-i); |
| 265 | font-size: fn.dim(--#{$size} --font-size); | 267 | font-size: fn.dim(--#{$size} --font-size); |
| 266 | 268 | ||
| 267 | @include iro.bem-modifier('pill') { | 269 | @include iro.bem-modifier('pill') { |
