summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2022-02-11 17:34:57 +0100
committerVolpeon <git@volpeon.ink>2022-02-11 17:34:57 +0100
commit67722515b4882458547bcbe8ac13e60ba3790a56 (patch)
tree08ffa0f345e1e0074bfbb01466c7d0b0da0edd0b /src
parentUpdate (diff)
downloadiro-design-67722515b4882458547bcbe8ac13e60ba3790a56.tar.gz
iro-design-67722515b4882458547bcbe8ac13e60ba3790a56.tar.bz2
iro-design-67722515b4882458547bcbe8ac13e60ba3790a56.zip
Added backdrop and dialog
Diffstat (limited to 'src')
-rw-r--r--src/_utils.scss8
-rw-r--r--src/index.scss2
-rw-r--r--src/objects/_action-menu.scss10
-rw-r--r--src/objects/_backdrop.scss36
-rw-r--r--src/objects/_dialog.scss57
5 files changed, 105 insertions, 8 deletions
diff --git a/src/_utils.scss b/src/_utils.scss
index 72c1f2f..7525f34 100644
--- a/src/_utils.scss
+++ b/src/_utils.scss
@@ -12,3 +12,11 @@
12 overflow: hidden; 12 overflow: hidden;
13 text-overflow: ellipsis; 13 text-overflow: ellipsis;
14} 14}
15
16@include iro.bem-utility('ps') {
17 position: static;
18}
19
20@include iro.bem-utility('pr') {
21 position: relative;
22}
diff --git a/src/index.scss b/src/index.scss
index 44fba76..3796c18 100644
--- a/src/index.scss
+++ b/src/index.scss
@@ -21,6 +21,8 @@
21@use 'objects/avatar'; 21@use 'objects/avatar';
22@use 'objects/action-menu'; 22@use 'objects/action-menu';
23@use 'objects/menu'; 23@use 'objects/menu';
24@use 'objects/backdrop';
25@use 'objects/dialog';
24 26
25@use 'layouts/form'; 27@use 'layouts/form';
26 28
diff --git a/src/objects/_action-menu.scss b/src/objects/_action-menu.scss
index 1e95b39..3c10604 100644
--- a/src/objects/_action-menu.scss
+++ b/src/objects/_action-menu.scss
@@ -4,8 +4,6 @@
4@include iro.props-namespace('action-menu') { 4@include iro.props-namespace('action-menu') {
5 @include iro.props-store(( 5 @include iro.props-store((
6 --dims: ( 6 --dims: (
7 --x: 0,
8 --y: 0,
9 --pad-x: 0, 7 --pad-x: 0,
10 --pad-y: .3rem, 8 --pad-y: .3rem,
11 --separator: .3rem, 9 --separator: .3rem,
@@ -45,8 +43,8 @@
45 @include iro.bem-object(iro.props-namespace()) { 43 @include iro.bem-object(iro.props-namespace()) {
46 position: absolute; 44 position: absolute;
47 z-index: 10000; 45 z-index: 10000;
48 top: fn.dim(--y); 46 top: var(--y);
49 left: fn.dim(--x); 47 left: var(--x);
50 padding: fn.dim(--pad-y) fn.dim(--pad-x); 48 padding: fn.dim(--pad-y) fn.dim(--pad-x);
51 border: fn.dim(--border) solid fn.color(--border); 49 border: fn.dim(--border) solid fn.color(--border);
52 border-radius: fn.dim(--rounding); 50 border-radius: fn.dim(--rounding);
@@ -54,10 +52,6 @@
54 box-shadow: fn.color(--shadow); 52 box-shadow: fn.color(--shadow);
55 color: fn.global-color(--fg); 53 color: fn.global-color(--fg);
56 54
57 @include iro.bem-modifier('static') {
58 position: static;
59 }
60
61 @include iro.bem-modifier('up-left') { 55 @include iro.bem-modifier('up-left') {
62 transform: translate(0, -100%); 56 transform: translate(0, -100%);
63 } 57 }
diff --git a/src/objects/_backdrop.scss b/src/objects/_backdrop.scss
new file mode 100644
index 0000000..bc63a27
--- /dev/null
+++ b/src/objects/_backdrop.scss
@@ -0,0 +1,36 @@
1@use 'iro-sass/src/index' as iro;
2@use '../functions' as fn;
3
4@include iro.props-namespace('backdrop') {
5 @include iro.props-store((
6 --dims: (
7 --z-index: 10000,
8 --pad-x: iro.fn-px-to-rem(14px),
9 --pad-y: iro.fn-px-to-rem(60px),
10 ),
11 ), 'dims');
12
13 @include iro.props-store((
14 --colors: (
15 --bg: rgba(#000, .3),
16 ),
17 ), 'colors');
18
19 @include iro.props-store((
20 --dims: (
21 --pad-y: iro.fn-px-to-rem(30px),
22 )
23 ), 'sm');
24
25 @include iro.bem-object(iro.props-namespace()) {
26 position: fixed;
27 z-index: fn.dim(--z-index);
28 top: 0;
29 right: 0;
30 bottom: 0;
31 left: 0;
32 box-sizing: border-box;
33 padding: fn.dim(--pad-y) fn.dim(--pad-x);
34 background-color: fn.color(--bg);
35 }
36}
diff --git a/src/objects/_dialog.scss b/src/objects/_dialog.scss
new file mode 100644
index 0000000..453b32b
--- /dev/null
+++ b/src/objects/_dialog.scss
@@ -0,0 +1,57 @@
1@use 'iro-sass/src/index' as iro;
2@use '../functions' as fn;
3
4@include iro.props-namespace('dialog') {
5 @include iro.props-store((
6 --dims: (
7 --pad-x: iro.fn-px-to-rem(40px),
8 --pad-y: iro.fn-px-to-rem(40px),
9 --width-sm: iro.fn-px-to-rem(500px),
10 --width-md: iro.fn-px-to-rem(800px),
11 --width-lg: iro.fn-px-to-rem(1100px),
12 --rounding: 3px,
13 ),
14 ), 'dims');
15
16 @include iro.props-store((
17 --colors: (
18 --shadow: 0 .2em .5em rgba(#000, .2),
19 ),
20 ), 'colors');
21
22 @include iro.bem-object(iro.props-namespace()) {
23 max-width: fn.dim(--width-md);
24 margin: 0 auto;
25 padding: fn.dim(--pad-y) fn.dim(--pad-x);
26 overflow: hidden;
27 border-radius: fn.dim(--rounding);
28 background-color: fn.global-color(--bg);
29 box-shadow: fn.color(--shadow);
30 color: fn.global-color(--fg);
31
32 @include iro.bem-modifier('sm') {
33 max-width: fn.dim(--width-sm);
34 }
35
36 @include iro.bem-modifier('lg') {
37 max-width: fn.dim(--width-lg);
38 }
39
40 @include iro.bem-elem('header') {
41 padding-bottom: .5rem;
42 }
43
44 @include iro.bem-elem('title') {
45 margin-top: 0;
46 }
47
48 @include iro.bem-elem('body') {
49 padding-top: .5rem;
50 }
51
52 @include iro.bem-elem('footer') {
53 padding-top: fn.dim(--pad-y);
54 text-align: right;
55 }
56 }
57}