From 9c00a5d44df405bc33d0da4e4dfcc91c711922ce Mon Sep 17 00:00:00 2001 From: Volpeon Date: Tue, 25 Mar 2025 18:16:46 +0100 Subject: Add o-figure --- src/objects/_figure.scss | 26 ++++++++++++++++++++++++++ src/objects/_figure.vars.scss | 9 +++++++++ 2 files changed, 35 insertions(+) create mode 100644 src/objects/_figure.scss create mode 100644 src/objects/_figure.vars.scss (limited to 'src/objects') 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 @@ +@use 'sass:meta'; +@use 'iro-sass/src/bem'; +@use 'iro-sass/src/props'; +@use '../props' as *; + +@forward 'figure.vars'; +@use 'figure.vars' as vars; + +@mixin styles { + @include materialize-at-root(meta.module-variables('vars')); + + @include bem.object('figure') { + @include bem.elem('caption') { + padding-block: props.get(vars.$pad-b); + font-size: props.get(vars.$font-size); + color: props.get(vars.$text-color); + border-block-end: props.get(vars.$border-width) solid props.get(vars.$border-color); + + &::before { + display: block; + margin-block: -100em 100em; + content: ''; + } + } + } +} 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 @@ +@use 'iro-sass/src/props'; +@use '../core.vars' as core; + +$pad-b: props.def(--s-figures--pad-b, props.get(core.$size--100)) !default; +$border-width: props.def(--s-figures--border-width, props.get(core.$border-width--thin)) !default; +$font-size: props.def(--s-figures--font-size, props.get(core.$font-size--100)) !default; + +$text-color: props.def(--s-figures--text-color, props.get(core.$theme, --text-mute-more), 'color') !default; +$border-color: props.def(--s-figures--border-color, props.get(core.$theme, --border-mute), 'color') !default; -- cgit v1.2.3-70-g09d2