diff options
-rw-r--r-- | src/_iro-design.scss | 1 | ||||
-rw-r--r-- | src/layouts/_button-group.scss | 37 | ||||
-rw-r--r-- | src/layouts/_button-group.vars.scss | 14 | ||||
-rw-r--r-- | src/objects/_figure.scss | 26 | ||||
-rw-r--r-- | src/objects/_figure.vars.scss | 9 | ||||
-rw-r--r-- | src_demo/index.scss | 1 |
6 files changed, 85 insertions, 3 deletions
diff --git a/src/_iro-design.scss b/src/_iro-design.scss index 2bf1a6c..bad29c5 100644 --- a/src/_iro-design.scss +++ b/src/_iro-design.scss | |||
@@ -54,6 +54,7 @@ $breakpoints: ( | |||
54 | @forward 'objects/checkbox' as o-checkbox--*; | 54 | @forward 'objects/checkbox' as o-checkbox--*; |
55 | @forward 'objects/divider' as o-divider--*; | 55 | @forward 'objects/divider' as o-divider--*; |
56 | @forward 'objects/emoji' as o-emoji--*; | 56 | @forward 'objects/emoji' as o-emoji--*; |
57 | @forward 'objects/figure' as o-figure--*; | ||
57 | @forward 'objects/field-label' as o-field-label--*; | 58 | @forward 'objects/field-label' as o-field-label--*; |
58 | @forward 'objects/heading' as o-heading--*; | 59 | @forward 'objects/heading' as o-heading--*; |
59 | @forward 'objects/icon' as o-icon--*; | 60 | @forward 'objects/icon' as o-icon--*; |
diff --git a/src/layouts/_button-group.scss b/src/layouts/_button-group.scss index c51ae7e..b0a3c8e 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('action-#{$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; | ||
diff --git a/src/objects/_figure.scss b/src/objects/_figure.scss new file mode 100644 index 0000000..38837be --- /dev/null +++ b/src/objects/_figure.scss | |||
@@ -0,0 +1,26 @@ | |||
1 | @use 'sass:meta'; | ||
2 | @use 'iro-sass/src/bem'; | ||
3 | @use 'iro-sass/src/props'; | ||
4 | @use '../props' as *; | ||
5 | |||
6 | @forward 'figure.vars'; | ||
7 | @use 'figure.vars' as vars; | ||
8 | |||
9 | @mixin styles { | ||
10 | @include materialize-at-root(meta.module-variables('vars')); | ||
11 | |||
12 | @include bem.object('figure') { | ||
13 | @include bem.elem('caption') { | ||
14 | padding-block: props.get(vars.$pad-b); | ||
15 | font-size: props.get(vars.$font-size); | ||
16 | color: props.get(vars.$text-color); | ||
17 | border-block-end: props.get(vars.$border-width) solid props.get(vars.$border-color); | ||
18 | |||
19 | &::before { | ||
20 | display: block; | ||
21 | margin-block: -100em 100em; | ||
22 | content: ''; | ||
23 | } | ||
24 | } | ||
25 | } | ||
26 | } | ||
diff --git a/src/objects/_figure.vars.scss b/src/objects/_figure.vars.scss new file mode 100644 index 0000000..357c9dd --- /dev/null +++ b/src/objects/_figure.vars.scss | |||
@@ -0,0 +1,9 @@ | |||
1 | @use 'iro-sass/src/props'; | ||
2 | @use '../core.vars' as core; | ||
3 | |||
4 | $pad-b: props.def(--s-figures--pad-b, props.get(core.$size--100)) !default; | ||
5 | $border-width: props.def(--s-figures--border-width, props.get(core.$border-width--thin)) !default; | ||
6 | $font-size: props.def(--s-figures--font-size, props.get(core.$font-size--100)) !default; | ||
7 | |||
8 | $text-color: props.def(--s-figures--text-color, props.get(core.$theme, --text-mute-more), 'color') !default; | ||
9 | $border-color: props.def(--s-figures--border-color, props.get(core.$theme, --border-mute), 'color') !default; | ||
diff --git a/src_demo/index.scss b/src_demo/index.scss index ba85ec4..5251a05 100644 --- a/src_demo/index.scss +++ b/src_demo/index.scss | |||
@@ -33,6 +33,7 @@ | |||
33 | @include iro.o-checkbox--styles; | 33 | @include iro.o-checkbox--styles; |
34 | @include iro.o-divider--styles; | 34 | @include iro.o-divider--styles; |
35 | @include iro.o-emoji--styles; | 35 | @include iro.o-emoji--styles; |
36 | @include iro.o-figure--styles; | ||
36 | @include iro.o-field-label--styles; | 37 | @include iro.o-field-label--styles; |
37 | @include iro.o-heading--styles; | 38 | @include iro.o-heading--styles; |
38 | @include iro.o-lightbox--styles; | 39 | @include iro.o-lightbox--styles; |