summaryrefslogtreecommitdiffstats
path: root/src/layouts/_form.scss
diff options
context:
space:
mode:
Diffstat (limited to 'src/layouts/_form.scss')
-rw-r--r--src/layouts/_form.scss58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/layouts/_form.scss b/src/layouts/_form.scss
new file mode 100644
index 0000000..824d7ca
--- /dev/null
+++ b/src/layouts/_form.scss
@@ -0,0 +1,58 @@
1@use 'sass:meta';
2@use 'iro-sass/src/iro-sass' as iro;
3@use '../props';
4
5@forward 'form.vars';
6@use 'form.vars' as vars;
7
8@mixin styles {
9 @include props.materialize(meta.module-variables('vars'));
10
11 @include iro.bem-layout('form') {
12 display: flex;
13 flex-direction: column;
14 gap: props.get(vars.$item-spacing-b) props.get(vars.$label-spacing-i);
15
16 @include iro.bem-elem('item') {
17 display: block;
18 }
19
20 @include iro.bem-elem('item-content') {
21 @include iro.bem-modifier('align-start') {
22 align-self: start;
23 }
24 }
25
26 @include iro.bem-modifier('row') {
27 flex-direction: row;
28 align-items: flex-end;
29 }
30
31 @include iro.bem-modifier('labels-start', 'labels-end') {
32 display: grid;
33 grid-template-rows: auto;
34 grid-template-columns: auto 1fr;
35 align-items: baseline;
36
37 @include iro.bem-elem('item') {
38 display: contents;
39 }
40
41 @include iro.bem-elem('item-label') {
42 grid-column: 1;
43 padding-inline-end: 0;
44 }
45
46 @include iro.bem-elem('item-content') {
47 grid-column: 2;
48 margin-block-start: 0;
49 }
50 }
51
52 @include iro.bem-modifier('labels-end') {
53 @include iro.bem-elem('item-label') {
54 text-align: end;
55 }
56 }
57 }
58}