summaryrefslogtreecommitdiffstats
path: root/src/scopes/_tables.scss
blob: f72286433e3db1c02f76937ae8e1d982a55e95f9 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
@use 'sass:meta';
@use 'iro-sass/src/iro-sass' as iro;
@use '../functions' as fn;
@use '../mixins' as mx;

@forward 'lists.vars';
@use 'lists.vars' as vars;

@mixin styles {
    @include props.materialize(meta.module-variables('vars'));

    @include iro.bem-scope('tables') {
        table {
            margin-block-start: fn.dim(--margin-bs);
            border-spacing:     0;
            border-collapse:    separate;
        }

        th {
            @include mx.set-font(--standard, (
                --line-height: null,
                --size:        fn.global-dim(--font-size --50),
                --weight:      bold,
                --transform:   uppercase,
                --spacing:     .5px
            ));

            padding-block:  fn.dim(--pad-b);
            padding-inline: fn.dim(--pad-i);
            color:          fn.color(--heading);
            text-align:     start;
        }

        td {
            padding-block:            fn.dim(--pad-b);
            padding-inline:           fn.dim(--pad-i);
            border-color:             fn.color(--border);
            border-style:             solid;
            border-width:             0;
            border-block-start-width: fn.dim(--border);
        }

        tr {
            &:last-child {
                td {
                    border-block-end-width: fn.dim(--border);
                }
            }
        }

        @include iro.bem-modifier('flush') {
            th,
            td {
                &:first-child {
                    padding-inline-start: 0;
                }

                &:last-child {
                    padding-inline-end: 0;
                }
            }
        }

        @include iro.bem-modifier('box') {
            td {
                background-color: fn.color(--box --bg);
            
                &:first-child {
                    border-inline-start-width: fn.dim(--border);
                }
            
                &:last-child {
                    border-inline-end-width: fn.dim(--border);
                }
            }
    
            tr {
                &:first-child {
                    td {
                        &:first-child {
                            border-start-start-radius: fn.dim(--rounding);
                        }
            
                        &:last-child {
                            border-start-end-radius: fn.dim(--rounding);
                        }
                    }
                }
    
                &:last-child {
                    td {
                        &:first-child {
                            border-end-start-radius: fn.dim(--rounding);
                        }
            
                        &:last-child {
                            border-end-end-radius: fn.dim(--rounding);
                        }
                    }
                }
            }
        }
    }
}