From 27616aff3eaa1fb8baecfcfec1f0542473d1fb36 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Tue, 15 Feb 2022 18:57:05 +0100 Subject: Added lightbox --- src/_apply-vars.scss | 6 ++++++ src/_objects.scss | 1 + src/_utils.scss | 5 +++++ src/layouts/_container.scss | 5 ----- src/objects/_backdrop.scss | 1 + src/objects/_lightbox.scss | 35 +++++++++++++++++++++++++++++++++++ 6 files changed, 48 insertions(+), 5 deletions(-) create mode 100644 src/objects/_lightbox.scss (limited to 'src') diff --git a/src/_apply-vars.scss b/src/_apply-vars.scss index 10bcb5c..66ad9b7 100644 --- a/src/_apply-vars.scss +++ b/src/_apply-vars.scss @@ -28,3 +28,9 @@ @include iro.props-assign('palette-dark-raised'); } } + +@include iro.bem-theme('dark') { + @include iro.props-assign('colors'); + @include iro.props-assign('colors-dark'); + @include iro.props-assign('palette-dark'); +} diff --git a/src/_objects.scss b/src/_objects.scss index 45415f1..1b23d44 100644 --- a/src/_objects.scss +++ b/src/_objects.scss @@ -14,3 +14,4 @@ @use 'objects/menu'; @use 'objects/backdrop'; @use 'objects/dialog'; +@use 'objects/lightbox'; diff --git a/src/_utils.scss b/src/_utils.scss index 89aabd2..69885ba 100644 --- a/src/_utils.scss +++ b/src/_utils.scss @@ -34,6 +34,11 @@ $dirs: ( position: relative; } +@include iro.bem-utility('themed') { + background-color: fn.global-color(--bg); + color: fn.global-color(--fg); +} + @each $dir, $suffix in $dirs { @include iro.bem-utility('m#{$dir}-auto') { margin#{$suffix}: auto; diff --git a/src/layouts/_container.scss b/src/layouts/_container.scss index b8fc879..26ba16f 100644 --- a/src/layouts/_container.scss +++ b/src/layouts/_container.scss @@ -79,11 +79,6 @@ } } - @include iro.bem-modifier('themed') { - background-color: fn.global-color(--bg); - color: fn.global-color(--fg); - } - @include iro.bem-modifier('in-page') { margin-top: fn.dim(--in-page-spacing-y); margin-bottom: fn.dim(--in-page-spacing-y); diff --git a/src/objects/_backdrop.scss b/src/objects/_backdrop.scss index 5957ffa..9ab140e 100644 --- a/src/objects/_backdrop.scss +++ b/src/objects/_backdrop.scss @@ -40,5 +40,6 @@ flex-direction: column; padding: fn.dim(--pad-y) fn.dim(--pad-x); background-color: fn.color(--bg); + color: fn.global-color(--fg); } } diff --git a/src/objects/_lightbox.scss b/src/objects/_lightbox.scss new file mode 100644 index 0000000..3ba9744 --- /dev/null +++ b/src/objects/_lightbox.scss @@ -0,0 +1,35 @@ +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; + +@include iro.props-namespace('lightbox') { + @include iro.props-store(( + --dims: ( + + ), + ), 'dims'); + + @include iro.bem-object(iro.props-namespace()) { + display: contents; + + @include iro.bem-elem('header') { + display: flex; + box-sizing: border-box; + flex: 0 0 auto; + align-items: center; + width: 100%; + } + + @include iro.bem-elem('img') { + align-self: center; + max-width: 100%; + min-height: 0; + max-height: 100%; + margin-top: auto; + margin-bottom: auto; + } + + @include iro.bem-elem('close-btn') { + margin-left: auto; + } + } +} -- cgit v1.2.3-70-g09d2