diff options
Diffstat (limited to 'src/objects')
| -rw-r--r-- | src/objects/_lightbox.scss | 47 | ||||
| -rw-r--r-- | src/objects/_lightbox.vars.scss | 15 |
2 files changed, 37 insertions, 25 deletions
diff --git a/src/objects/_lightbox.scss b/src/objects/_lightbox.scss index 5ff6d93..7a3a795 100644 --- a/src/objects/_lightbox.scss +++ b/src/objects/_lightbox.scss | |||
| @@ -15,20 +15,22 @@ | |||
| 15 | @include materialize-at-root(meta.module-variables('vars')); | 15 | @include materialize-at-root(meta.module-variables('vars')); |
| 16 | 16 | ||
| 17 | @include bem.object('lightbox') { | 17 | @include bem.object('lightbox') { |
| 18 | box-sizing: border-box; | 18 | box-sizing: border-box; |
| 19 | display: none; | 19 | display: none; |
| 20 | flex: 1 1 auto; | 20 | flex: 1 1 auto; |
| 21 | flex-direction: column; | 21 | grid-template-areas: 'image' 'thumbnails'; |
| 22 | justify-content: flex-end; | 22 | grid-template-rows: 1fr auto; |
| 23 | inline-size: 100%; | 23 | grid-template-columns: 1fr; |
| 24 | max-inline-size: none; | 24 | justify-items: center; |
| 25 | block-size: 100%; | 25 | inline-size: 100%; |
| 26 | min-block-size: 0; | 26 | max-inline-size: none; |
| 27 | max-block-size: none; | 27 | block-size: 100%; |
| 28 | padding: 0; | 28 | min-block-size: 0; |
| 29 | margin: 0; | 29 | max-block-size: none; |
| 30 | background-color: transparent; | 30 | padding: 0; |
| 31 | border: 0; | 31 | margin: 0; |
| 32 | background-color: transparent; | ||
| 33 | border: 0; | ||
| 32 | 34 | ||
| 33 | &::backdrop { | 35 | &::backdrop { |
| 34 | background-color: props.get(backdrop.$bg-color); | 36 | background-color: props.get(backdrop.$bg-color); |
| @@ -36,7 +38,7 @@ | |||
| 36 | } | 38 | } |
| 37 | 39 | ||
| 38 | &[open] { | 40 | &[open] { |
| 39 | display: flex; | 41 | display: grid; |
| 40 | } | 42 | } |
| 41 | 43 | ||
| 42 | @include bem.elem('controls') { | 44 | @include bem.elem('controls') { |
| @@ -45,14 +47,21 @@ | |||
| 45 | inset-inline-end: props.get(vars.$pad); | 47 | inset-inline-end: props.get(vars.$pad); |
| 46 | z-index: 20; | 48 | z-index: 20; |
| 47 | padding: props.get(vars.$controls--pad-y) props.get(vars.$controls--pad-x); | 49 | padding: props.get(vars.$controls--pad-y) props.get(vars.$controls--pad-x); |
| 50 | background-color: props.get(vars.$controls--bg); | ||
| 48 | border-radius: 10em; | 51 | border-radius: 10em; |
| 52 | box-shadow: | ||
| 53 | props.get(vars.$controls--shadow-x) | ||
| 54 | props.get(vars.$controls--shadow-y) | ||
| 55 | props.get(vars.$controls--shadow-blur) | ||
| 56 | props.get(vars.$controls--shadow-grow) | ||
| 57 | props.get(vars.$controls--shadow-color); | ||
| 49 | } | 58 | } |
| 50 | 59 | ||
| 51 | @include bem.elem('img') { | 60 | @include bem.elem('img') { |
| 52 | position: relative; | 61 | position: relative; |
| 53 | z-index: 10; | 62 | z-index: 10; |
| 54 | display: block; | 63 | display: block; |
| 55 | flex: 1 1 auto; | 64 | grid-area: image; |
| 56 | inline-size: auto; | 65 | inline-size: auto; |
| 57 | min-inline-size: 0; | 66 | min-inline-size: 0; |
| 58 | max-inline-size: 100%; | 67 | max-inline-size: 100%; |
| @@ -82,7 +91,7 @@ | |||
| 82 | 91 | ||
| 83 | @include bem.elem('thumbnails') { | 92 | @include bem.elem('thumbnails') { |
| 84 | display: flex; | 93 | display: flex; |
| 85 | flex: 0 0 auto; | 94 | grid-area: thumbnails; |
| 86 | gap: props.get(vars.$thumbnail--spacing); | 95 | gap: props.get(vars.$thumbnail--spacing); |
| 87 | justify-content: center; | 96 | justify-content: center; |
| 88 | padding: props.get(vars.$pad); | 97 | padding: props.get(vars.$pad); |
| @@ -102,10 +111,6 @@ | |||
| 102 | @each $theme in map.keys(props.get(vars.$static-themes)) { | 111 | @each $theme in map.keys(props.get(vars.$static-themes)) { |
| 103 | @include bem.modifier(string.slice($theme, 3)) { | 112 | @include bem.modifier(string.slice($theme, 3)) { |
| 104 | color: props.get(vars.$static-themes, $theme, --text); | 113 | color: props.get(vars.$static-themes, $theme, --text); |
| 105 | |||
| 106 | @include bem.elem('controls') { | ||
| 107 | background-color: props.get(vars.$static-themes, $theme, --controls-bg); | ||
| 108 | } | ||
| 109 | } | 114 | } |
| 110 | } | 115 | } |
| 111 | } | 116 | } |
diff --git a/src/objects/_lightbox.vars.scss b/src/objects/_lightbox.vars.scss index 9f200b0..aea5023 100644 --- a/src/objects/_lightbox.vars.scss +++ b/src/objects/_lightbox.vars.scss | |||
| @@ -8,23 +8,30 @@ $pad: props.def(--o-lightbox--pad, props.get(core.$size--150)) !default; | |||
| 8 | $controls--pad-x: props.def(--o-lightbox--controls--pad-x, props.get(core.$size--150)) !default; | 8 | $controls--pad-x: props.def(--o-lightbox--controls--pad-x, props.get(core.$size--150)) !default; |
| 9 | $controls--pad-y: props.def(--o-lightbox--controls--pad-y, props.get(core.$size--50)) !default; | 9 | $controls--pad-y: props.def(--o-lightbox--controls--pad-y, props.get(core.$size--50)) !default; |
| 10 | 10 | ||
| 11 | $controls--shadow-x: props.def(--o-lightbox--controls--shadow-x, props.get(core.$shadow--l2--x)) !default; | ||
| 12 | $controls--shadow-y: props.def(--o-lightbox--controls--shadow-y, props.get(core.$shadow--l2--y)) !default; | ||
| 13 | $controls--shadow-blur: props.def(--o-lightbox--controls--shadow-blur, props.get(core.$shadow--l2--blur)) !default; | ||
| 14 | $controls--shadow-grow: props.def(--o-lightbox--controls--shadow-grow, props.get(core.$shadow--l2--grow)) !default; | ||
| 15 | |||
| 11 | $thumbnail--width: props.def(--o-lightbox--thumbnail--width, props.get(core.$size--600)) !default; | 16 | $thumbnail--width: props.def(--o-lightbox--thumbnail--width, props.get(core.$size--600)) !default; |
| 12 | $thumbnail--spacing: props.def(--o-lightbox--thumbnail--spacing, props.get(core.$size--100)) !default; | 17 | $thumbnail--spacing: props.def(--o-lightbox--thumbnail--spacing, props.get(core.$size--100)) !default; |
| 13 | $thumbnail--active--width: props.def(--o-lightbox--thumbnail--active--width, props.get(core.$size--1000)) !default; | 18 | $thumbnail--active--width: props.def(--o-lightbox--thumbnail--active--width, props.get(core.$size--1000)) !default; |
| 14 | $thumbnail--active--spacing: props.def(--o-lightbox--thumbnail--active--spacing, props.get(core.$size--250)) !default; | 19 | $thumbnail--active--spacing: props.def(--o-lightbox--thumbnail--active--spacing, props.get(core.$size--250)) !default; |
| 15 | 20 | ||
| 16 | $static-themes: props.def(--o-lightbox, (), 'color'); | ||
| 17 | |||
| 18 | $thumbnail--width--md: props.def(--o-lightbox--thumbnail--width, props.get(core.$size--400), 'md') !default; | 21 | $thumbnail--width--md: props.def(--o-lightbox--thumbnail--width, props.get(core.$size--400), 'md') !default; |
| 19 | $thumbnail--active--width--md: props.def(--o-lightbox--thumbnail--active--width, props.get(core.$size--600), 'md') !default; | 22 | $thumbnail--active--width--md: props.def(--o-lightbox--thumbnail--active--width, props.get(core.$size--600), 'md') !default; |
| 20 | 23 | ||
| 24 | $controls--bg: props.def(--o-lightbox--controls--bg, props.get(core.$transparent-colors, --black, --700), 'color') !default; | ||
| 25 | $controls--shadow-color: props.def(--o-lightbox--controls--shadow-color, props.get(core.$transparent-colors, --black, --300), 'color') !default; | ||
| 26 | |||
| 27 | $static-themes: props.def(--o-lightbox, (), 'color'); | ||
| 28 | |||
| 21 | @each $theme in map.keys(props.get(core.$transparent-colors)) { | 29 | @each $theme in map.keys(props.get(core.$transparent-colors)) { |
| 22 | $lightbox-theme: --static-#{string.slice($theme, 3)}; | 30 | $lightbox-theme: --static-#{string.slice($theme, 3)}; |
| 23 | 31 | ||
| 24 | $static-themes: props.merge($static-themes, ( | 32 | $static-themes: props.merge($static-themes, ( |
| 25 | $lightbox-theme: ( | 33 | $lightbox-theme: ( |
| 26 | --text: props.get(core.$transparent-colors, $theme, --text), | 34 | --text: props.get(core.$transparent-colors, $theme, --text), |
| 27 | --controls-bg: props.get(core.$transparent-colors, $theme, --700), | ||
| 28 | ) | 35 | ) |
| 29 | )); | 36 | )); |
| 30 | } | 37 | } |
