summaryrefslogtreecommitdiffstats
path: root/src/objects/_dialog.scss
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2022-03-08 22:00:33 +0100
committerVolpeon <git@volpeon.ink>2022-03-08 22:00:33 +0100
commitbdd534a2fea536f4143d29dd26138a4705c1f825 (patch)
tree3ff5dbc4f9de8e3c77918f444a1bc20550db764d /src/objects/_dialog.scss
parentDialog (diff)
downloadiro-design-bdd534a2fea536f4143d29dd26138a4705c1f825.tar.gz
iro-design-bdd534a2fea536f4143d29dd26138a4705c1f825.tar.bz2
iro-design-bdd534a2fea536f4143d29dd26138a4705c1f825.zip
Improved dialog
Diffstat (limited to 'src/objects/_dialog.scss')
-rw-r--r--src/objects/_dialog.scss115
1 files changed, 73 insertions, 42 deletions
diff --git a/src/objects/_dialog.scss b/src/objects/_dialog.scss
index d5b6ed9..9c61e93 100644
--- a/src/objects/_dialog.scss
+++ b/src/objects/_dialog.scss
@@ -4,13 +4,15 @@
4@include iro.props-namespace('dialog') { 4@include iro.props-namespace('dialog') {
5 @include iro.props-store(( 5 @include iro.props-store((
6 --dims: ( 6 --dims: (
7 --pad-x: fn.global-dim(--size --300), 7 --pad-x: fn.global-dim(--size --300),
8 --pad-y: fn.global-dim(--size --300), 8 --pad-y: fn.global-dim(--size --300),
9 --width-sm: iro.fn-px-to-rem(500px), 9 --width-sm: iro.fn-px-to-rem(500px),
10 --width-md: iro.fn-px-to-rem(800px), 10 --width-md: iro.fn-px-to-rem(800px),
11 --width-lg: iro.fn-px-to-rem(1100px), 11 --width-lg: iro.fn-px-to-rem(1100px),
12 --rounding: 3px, 12 --rounding: 3px,
13 --title-body-spacing: fn.global-dim(--size --200), 13 --sidebar: (
14 --pad-x: fn.global-dim(--size --150),
15 )
14 ), 16 ),
15 ), 'dims'); 17 ), 'dims');
16 18
@@ -24,24 +26,40 @@
24 @include iro.props-store(( 26 @include iro.props-store((
25 --colors: ( 27 --colors: (
26 --shadow: 0 .2em .5em rgba(#000, .2), 28 --shadow: 0 .2em .5em rgba(#000, .2),
29 --sidebar: (
30 --bg: fn.global-color(--bg),
31 --border: fn.global-color(--obj),
32 )
27 ), 33 ),
28 ), 'colors'); 34 ), 'colors');
29 35
36 @include iro.props-store((
37 --colors: (
38 --sidebar: (
39 --bg: fn.global-color(--bg-hi),
40 --border: fn.global-color(--bg-hi),
41 ),
42 ),
43 ), 'colors-dark');
44
30 @include iro.bem-object(iro.props-namespace()) { 45 @include iro.bem-object(iro.props-namespace()) {
31 display: grid; 46 display: grid;
32 grid-template-rows: auto auto 1fr auto; 47 grid-template-rows: auto 1fr auto;
33 grid-template-areas: 'header' 'rule' 'body' 'footer'; 48 grid-template-columns: auto 1fr;
34 position: relative; 49 grid-template-areas:
35 box-sizing: border-box; 50 'sidebar header'
36 width: 100%; 51 'sidebar body'
37 max-width: fn.dim(--width-md); 52 'sidebar footer';
38 margin: 0 auto; 53 position: relative;
39 padding: fn.dim(--pad-y) fn.dim(--pad-x); 54 box-sizing: border-box;
40 overflow: hidden; 55 width: 100%;
41 border-radius: fn.dim(--rounding); 56 max-width: fn.dim(--width-md);
42 background-color: fn.global-color(--bg); 57 margin: 0 auto;
43 box-shadow: fn.color(--shadow); 58 overflow: hidden;
44 color: fn.global-color(--fg); 59 border-radius: fn.dim(--rounding);
60 background-color: fn.global-color(--bg);
61 box-shadow: fn.color(--shadow);
62 color: fn.global-color(--fg);
45 63
46 @include iro.bem-modifier('sm') { 64 @include iro.bem-modifier('sm') {
47 max-width: fn.dim(--width-sm); 65 max-width: fn.dim(--width-sm);
@@ -51,39 +69,52 @@
51 max-width: fn.dim(--width-lg); 69 max-width: fn.dim(--width-lg);
52 } 70 }
53 71
54 @include iro.bem-elem('header') { 72 @include iro.bem-elem('sidebar') {
55 grid-area: header; 73 grid-area: sidebar;
56 margin-bottom: fn.dim(--title-body-spacing); 74 padding: fn.dim(--pad-y) fn.dim(--sidebar --pad-x);
75 border-right: 1px solid fn.color(--sidebar --border);
76 background-color: fn.color(--sidebar --bg);
57 } 77 }
58 78
59 @include iro.bem-elem('close-btn') { 79 @include iro.bem-elem('header') {
60 position: absolute; 80 grid-area: header;
61 top: iro.fn-px-to-rem(12px); 81 margin: fn.dim(--pad-y) fn.dim(--pad-x) 0;
62 right: iro.fn-px-to-rem(12px);
63 font-size: fn.global-dim(--font-size --150);
64 }
65 82
66 @include iro.bem-elem('rule') { 83 @include iro.bem-sibling-elem('body') {
67 grid-area: rule; 84 &::before {
68 margin: 0; 85 display: none;
86 }
87 }
69 } 88 }
70 89
71 @include iro.bem-elem('title') { 90 @include iro.bem-elem('body') {
72 margin-top: 0; 91 grid-area: body;
92 min-height: 0;
93 margin: fn.dim(--pad-y) fn.dim(--pad-x);
94
95 &::before {
96 content: '';
97 width: fn.global-dim(--size --500);
98 height: fn.global-dim(--size --500);
99 float: right;
100 }
73 } 101 }
74 102
75 @include iro.bem-elem('body') { 103 @include iro.bem-elem('close-btn') {
76 grid-area: body; 104 position: absolute;
77 min-height: 0; 105 top: fn.global-dim(--size --150);
78 margin-top: fn.dim(--title-body-spacing); 106 right: fn.global-dim(--size --150);
79 overflow: auto; 107 font-size: fn.global-dim(--font-size --150);
80 scrollbar-color: fn.global-color(--obj-lo) transparent;
81 } 108 }
82 109
83 @include iro.bem-elem('footer') { 110 @include iro.bem-elem('footer') {
84 grid-area: footer; 111 grid-area: footer;
85 justify-content: flex-end; 112 justify-content: flex-end;
86 margin-top: fn.dim(--pad-y); 113 margin: fn.dim(--pad-y) fn.dim(--pad-x);
114 }
115
116 @include iro.bem-elem('title') {
117 margin-top: 0;
87 } 118 }
88 } 119 }
89} 120}