summaryrefslogtreecommitdiffstats
path: root/src/objects/_dialog.scss
blob: 453b32b28c9dd0955589f86d835ab10780d55afa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
@use 'iro-sass/src/index' as iro;
@use '../functions' as fn;

@include iro.props-namespace('dialog') {
    @include iro.props-store((
        --dims: (
            --pad-x:     iro.fn-px-to-rem(40px),
            --pad-y:     iro.fn-px-to-rem(40px),
            --width-sm:  iro.fn-px-to-rem(500px),
            --width-md:  iro.fn-px-to-rem(800px),
            --width-lg:  iro.fn-px-to-rem(1100px),
            --rounding:  3px,
        ),
    ), 'dims');

    @include iro.props-store((
        --colors: (
            --shadow: 0 .2em .5em rgba(#000, .2),
        ),
    ), 'colors');

    @include iro.bem-object(iro.props-namespace()) {
        max-width:        fn.dim(--width-md);
        margin:           0 auto;
        padding:          fn.dim(--pad-y) fn.dim(--pad-x);
        overflow:         hidden;
        border-radius:    fn.dim(--rounding);
        background-color: fn.global-color(--bg);
        box-shadow:       fn.color(--shadow);
        color:            fn.global-color(--fg);

        @include iro.bem-modifier('sm') {
            max-width: fn.dim(--width-sm);
        }

        @include iro.bem-modifier('lg') {
            max-width: fn.dim(--width-lg);
        }

        @include iro.bem-elem('header') {
            padding-bottom: .5rem;
        }

        @include iro.bem-elem('title') {
            margin-top: 0;
        }

        @include iro.bem-elem('body') {
            padding-top: .5rem;
        }

        @include iro.bem-elem('footer') {
            padding-top: fn.dim(--pad-y);
            text-align:  right;
        }
    }
}