diff options
author | Volpeon <git@volpeon.ink> | 2025-03-31 08:10:02 +0200 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2025-03-31 08:10:02 +0200 |
commit | 41f92c31e2c4790d5d3bb92d7262902b6f7ad3f8 (patch) | |
tree | 648a03e9c787de05a5885726242677481614c774 /src | |
parent | Add o-figure (diff) | |
download | iro-design-41f92c31e2c4790d5d3bb92d7262902b6f7ad3f8.tar.gz iro-design-41f92c31e2c4790d5d3bb92d7262902b6f7ad3f8.tar.bz2 iro-design-41f92c31e2c4790d5d3bb92d7262902b6f7ad3f8.zip |
More options for l-button-group
Diffstat (limited to 'src')
-rw-r--r-- | src/layouts/_button-group.scss | 37 | ||||
-rw-r--r-- | src/layouts/_button-group.vars.scss | 14 |
2 files changed, 48 insertions, 3 deletions
diff --git a/src/layouts/_button-group.scss b/src/layouts/_button-group.scss index c51ae7e..25bc2fe 100644 --- a/src/layouts/_button-group.scss +++ b/src/layouts/_button-group.scss | |||
@@ -5,13 +5,46 @@ | |||
5 | 5 | ||
6 | @forward 'button-group.vars'; | 6 | @forward 'button-group.vars'; |
7 | @use 'button-group.vars' as vars; | 7 | @use 'button-group.vars' as vars; |
8 | @use '../objects/action-button.vars' as action-button; | ||
8 | 9 | ||
9 | @mixin styles { | 10 | @mixin styles { |
10 | @include materialize-at-root(meta.module-variables('vars')); | 11 | @include materialize-at-root(meta.module-variables('vars')); |
11 | 12 | ||
12 | @include bem.layout('button-group') { | 13 | @include bem.layout('button-group') { |
13 | display: flex; | 14 | display: inline-flex; |
14 | flex-wrap: wrap; | 15 | flex-wrap: wrap; |
15 | gap: props.get(vars.$spacing); | 16 | gap: props.get(vars.$gap); |
17 | |||
18 | @each $mod, $size in vars.$sizes { | ||
19 | @include bem.modifier($mod) { | ||
20 | gap: props.get($size); | ||
21 | } | ||
22 | } | ||
23 | |||
24 | @include bem.modifier('align-block') { | ||
25 | margin-inline: calc(-1 * props.get(action-button.$pad-i) - props.get(action-button.$border-width)); | ||
26 | |||
27 | @include bem.modifier('pill') { | ||
28 | margin-inline: calc(-1 * props.get(action-button.$pad-i-pill) - props.get(action-button.$border-width)); | ||
29 | } | ||
30 | |||
31 | @include bem.modifier('icon') { | ||
32 | margin-inline: calc(-1 * props.get(action-button.$pad-b) - props.get(action-button.$border-width) - .5em * (props.get(action-button.$line-height) - 1)); | ||
33 | } | ||
34 | |||
35 | @each $mod, $pad-i, $pad-i-label, $pad-i-pill, $pad-b, $font-size in action-button.$fixed-sizes { | ||
36 | @include bem.modifier($mod) { | ||
37 | margin-inline: calc(-1 * props.get($pad-i) - props.get(action-button.$border-width)); | ||
38 | |||
39 | @include bem.modifier('pill') { | ||
40 | margin-inline: calc(-1 * props.get($pad-i-pill) - props.get(action-button.$border-width)); | ||
41 | } | ||
42 | |||
43 | @include bem.modifier('icon') { | ||
44 | margin-inline: calc(-1 * props.get($pad-b) - props.get(action-button.$border-width) - .5em * (props.get(action-button.$line-height) - 1)); | ||
45 | } | ||
46 | } | ||
47 | } | ||
48 | } | ||
16 | } | 49 | } |
17 | } | 50 | } |
diff --git a/src/layouts/_button-group.vars.scss b/src/layouts/_button-group.vars.scss index 95ac8f8..50c1b53 100644 --- a/src/layouts/_button-group.vars.scss +++ b/src/layouts/_button-group.vars.scss | |||
@@ -1,4 +1,16 @@ | |||
1 | @use 'iro-sass/src/props'; | 1 | @use 'iro-sass/src/props'; |
2 | @use '../core.vars' as core; | 2 | @use '../core.vars' as core; |
3 | 3 | ||
4 | $spacing: props.def(--l-button-group--spacing, props.get(core.$size--150)) !default; | 4 | $gap: props.def(--l-button-group--gap, props.get(core.$size--150)) !default; |
5 | |||
6 | $gapless: props.def(--l-button-group--gapless, 0) !default; | ||
7 | $sm: props.def(--l-button-group--sm, props.get(core.$size--100)) !default; | ||
8 | $lg: props.def(--l-button-group--lg, props.get(core.$size--300)) !default; | ||
9 | $xl: props.def(--l-button-group--xl, props.get(core.$size--450)) !default; | ||
10 | |||
11 | $sizes: ( | ||
12 | 'gapless': $gapless, | ||
13 | 'sm': $sm, | ||
14 | 'lg': $lg, | ||
15 | 'xl': $xl, | ||
16 | ) !default; | ||