From aefacb0a07a9ef66172dfccb24714717585f86b1 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sun, 6 Feb 2022 11:08:53 +0100 Subject: Added form --- src/layouts/_form.scss | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/layouts/_form.scss (limited to 'src/layouts') diff --git a/src/layouts/_form.scss b/src/layouts/_form.scss new file mode 100644 index 0000000..9e6520f --- /dev/null +++ b/src/layouts/_form.scss @@ -0,0 +1,46 @@ +@use 'iro-sass/src/index' as iro; + +@include iro.props-namespace('form') { + @include iro.props-store(( + --dims: ( + --item-spacing-y: iro.props-get(--dims --spacing --y --md, $global: true), + --label-spacing-x: iro.props-get(--dims --spacing --x --md, $global: true), + --hint-font-size: iro.props-get(--dims --font-size --sm, $global: true), + ), + )); + + @include iro.bem-layout(iro.props-namespace()) { + display: grid; + grid-template-columns: auto 1fr; + grid-template-rows: auto; + align-items: baseline; + gap: iro.props-get(--dims --item-spacing-y) iro.props-get(--dims --label-spacing-x); + + @include iro.bem-elem('item') { + display: contents; + } + + @include iro.bem-elem('item-label') { + grid-column: 1; + } + + @include iro.bem-elem('item-content') { + grid-column: 2; + } + + @include iro.bem-modifier('labels-right') { + @include iro.bem-elem('item-label') { + text-align: right; + } + } + + @include iro.bem-modifier('labels-above') { + display: flex; + flex-direction: column; + + @include iro.bem-elem('item') { + display: block; + } + } + } +} -- cgit v1.2.3-70-g09d2