diff options
Diffstat (limited to 'src/objects/_tabbar.scss')
| -rw-r--r-- | src/objects/_tabbar.scss | 159 | 
1 files changed, 91 insertions, 68 deletions
| diff --git a/src/objects/_tabbar.scss b/src/objects/_tabbar.scss index 218fe7d..a9daaae 100644 --- a/src/objects/_tabbar.scss +++ b/src/objects/_tabbar.scss | |||
| @@ -9,82 +9,105 @@ | |||
| 9 | @use 'tabbar.vars' as vars; | 9 | @use 'tabbar.vars' as vars; | 
| 10 | 10 | ||
| 11 | @mixin styles { | 11 | @mixin styles { | 
| 12 | @include materialize-at-root(meta.module-variables('vars')); | 12 | @include materialize-at-root(meta.module-variables('vars')); | 
| 13 | 13 | ||
| 14 | @include bem.object('tabbar') { | 14 | @include bem.object('tabbar') { | 
| 15 | min-inline-size: 0; | 15 | min-inline-size: 0; | 
| 16 | block-size: props.get(vars.$block-size); | 16 | block-size: props.get(vars.$block-size); | 
| 17 | overflow-inline: auto; | 17 | overflow: hidden; | 
| 18 | box-shadow: 0 calc(-1 * props.get(vars.$indicator--width)) 0 0 props.get(vars.$railing--bg-color) inset; | ||
| 19 | 18 | ||
| 20 | @include bem.elem('tabs') { | 19 | &::after { | 
| 21 | display: flex; | 20 | display: block; | 
| 22 | gap: props.get(vars.$spacing); | 21 | block-size: props.get(vars.$indicator--width); | 
| 23 | block-size: 100%; | 22 | margin-block-start: calc(-1 * props.get(vars.$indicator--width)); | 
| 24 | padding-inline: calc(.5 * props.get(vars.$spacing)); | 23 | content: ''; | 
| 25 | margin-inline: calc(-.5 * props.get(vars.$spacing)); | 24 | background-color: props.get(vars.$railing--bg-color); | 
| 26 | } | 25 | } | 
| 27 | 26 | ||
| 28 | @include bem.modifier('quiet') { | 27 | @include bem.elem('tabs') { | 
| 29 | box-shadow: none; | 28 | display: flex; | 
| 30 | } | 29 | block-size: 100%; | 
| 30 | margin-inline: calc(-.5 * props.get(vars.$spacing)); | ||
| 31 | overflow-inline: auto; | ||
| 32 | } | ||
| 31 | 33 | ||
| 32 | @include bem.modifier('adapt') { | 34 | @include bem.modifier('quiet') { | 
| 33 | block-size: 100%; | 35 | box-shadow: none; | 
| 34 | } | 36 | } | 
| 35 | 37 | ||
| 36 | @include bem.elem('tab') { | 38 | @include bem.modifier('adapt') { | 
| 37 | position: relative; | 39 | block-size: 100%; | 
| 38 | display: flex; | 40 | } | 
| 39 | align-items: center; | ||
| 40 | color: props.get(vars.$tab--text-color); | ||
| 41 | white-space: nowrap; | ||
| 42 | border-block: props.get(vars.$indicator--width) solid transparent; | ||
| 43 | 41 | ||
| 44 | &::before { | 42 | @include bem.elem('tab') { | 
| 45 | position: absolute; | 43 | position: relative; | 
| 46 | inset-block-start: 50%; | 44 | display: flex; | 
| 47 | inset-inline: calc(-1 * props.get(vars.$tab--pad-i)); | 45 | align-items: center; | 
| 48 | z-index: -10; | 46 | padding-inline: calc(.5 * props.get(vars.$spacing)); | 
| 49 | block-size: 1.5em; | 47 | color: props.get(vars.$tab--text-color); | 
| 50 | content: ''; | 48 | white-space: nowrap; | 
| 51 | border-radius: props.get(vars.$rounding); | ||
| 52 | transform: translateY(-50%); | ||
| 53 | } | ||
| 54 | 49 | ||
| 55 | &:link, | 50 | &::before { | 
| 56 | &:visited { | 51 | position: absolute; | 
| 57 | &:hover, | 52 | inset-block-start: 50%; | 
| 58 | &:active, | 53 | inset-inline: calc(-1 * props.get(vars.$tab--pad-i) + .5 * props.get(vars.$spacing)); | 
| 59 | &:focus-visible { | 54 | z-index: -10; | 
| 60 | color: props.get(vars.$tab--selected--text-color); | 55 | block-size: 1.5em; | 
| 61 | } | 56 | content: ''; | 
| 57 | border-radius: props.get(vars.$rounding); | ||
| 58 | transform: translateY(-50%); | ||
| 59 | } | ||
| 62 | 60 | ||
| 63 | &:focus-visible { | 61 | &::after { | 
| 64 | &::before { | 62 | position: absolute; | 
| 65 | color: props.get(vars.$key-focus--text-color); | 63 | inset-block-end: 0; | 
| 66 | text-decoration: none; | 64 | inset-inline: calc(.5 * props.get(vars.$spacing)); | 
| 67 | outline: props.get(vars.$key-focus--border-color) solid props.get(vars.$key-focus--border-width); | 65 | z-index: 10; | 
| 68 | box-shadow: 0 0 0 | 66 | display: none; | 
| 69 | calc(props.get(vars.$key-focus--border-width) + props.get(vars.$key-focus--outline-width)) | 67 | block-size: props.get(vars.$indicator--width); | 
| 70 | props.get(vars.$key-focus--outline-color); | 68 | content: ''; | 
| 71 | } | 69 | background-color: props.get(vars.$tab--selected--text-color); | 
| 72 | } | 70 | } | 
| 73 | } | ||
| 74 | 71 | ||
| 75 | @include bem.is('selected') { | 72 | &:link, | 
| 76 | color: props.get(vars.$tab--selected--text-color); | 73 | &:visited { | 
| 77 | border-block-end-color: props.get(vars.$tab--selected--text-color); | 74 | &:hover, | 
| 78 | } | 75 | &:active, | 
| 79 | } | 76 | &:focus-visible { | 
| 77 | color: props.get(vars.$tab--selected--text-color); | ||
| 78 | } | ||
| 80 | 79 | ||
| 81 | @include bem.modifier('accent') { | 80 | &:focus-visible { | 
| 82 | @include bem.elem('tab') { | 81 | &::before { | 
| 83 | @include bem.is('selected') { | 82 | color: props.get(vars.$key-focus--text-color); | 
| 84 | color: props.get(vars.$tab--accent--text-color); | 83 | text-decoration: none; | 
| 85 | border-block-end-color: props.get(vars.$tab--accent--text-color); | 84 | outline: props.get(vars.$key-focus--border-color) solid props.get(vars.$key-focus--border-width); | 
| 86 | } | 85 | box-shadow: 0 0 0 | 
| 87 | } | 86 | calc(props.get(vars.$key-focus--border-width) + props.get(vars.$key-focus--outline-width)) | 
| 88 | } | 87 | props.get(vars.$key-focus--outline-color); | 
| 89 | } | 88 | } | 
| 89 | } | ||
| 90 | } | ||
| 91 | |||
| 92 | @include bem.is('selected') { | ||
| 93 | color: props.get(vars.$tab--selected--text-color); | ||
| 94 | |||
| 95 | &::after { | ||
| 96 | display: block; | ||
| 97 | } | ||
| 98 | } | ||
| 99 | } | ||
| 100 | |||
| 101 | @include bem.modifier('accent') { | ||
| 102 | @include bem.elem('tab') { | ||
| 103 | &::after { | ||
| 104 | background-color: props.get(vars.$tab--accent--text-color); | ||
| 105 | } | ||
| 106 | |||
| 107 | @include bem.is('selected') { | ||
| 108 | color: props.get(vars.$tab--accent--text-color); | ||
| 109 | } | ||
| 110 | } | ||
| 111 | } | ||
| 112 | } | ||
| 90 | } | 113 | } | 
