_modulemenu.scss 3.08 KB
Newer Older
1
//
2
3
// Module Menu
// ===========
4
5
//

6
7
8
9
10
11
12
//
// Component
//
.modulemenu {
    margin: 0;
    padding: 1em;
    list-style: none;
13

14
15
    > ul > .modulemenu-group {
        margin: 1em 0;
16

17
18
19
20
21
22
23
        &:first-child {
            margin-top: 0;
        }

        &:last-child {
            margin-bottom: 0;
        }
24
25
26
    }
}

27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
// Action
//
.modulemenu-action {
    display: flex;
    padding: 4px;
    margin-top: 1px;
    color: inherit;
    align-items: center;
    overflow: hidden;
    border: none;
    border-radius: 3px;
    background-color: transparent;
    text-align: left;

    &:not(:disabled):focus,
    &:not(:disabled):hover {
        color: inherit;
        text-decoration: none;
        outline: none;
47
48
    }

49
50
51
    &:not(:disabled):focus {
        background-color: rgba(255, 255, 255, 0.05);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
52
53
    }

54
55
    &:not(:disabled):hover {
        background-color: rgba(255, 255, 255, 0.2);
56
57
    }

58
59
60
    &.modulemenu-action-active {
        background-color: rgba(255, 255, 255, 0.2);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
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
//
// Icon
//
.modulemenu-icon {
    position: relative;
    display: block;
    width: 32px;
    height: 32px;
    border-radius: 2px;
    flex-shrink: 0;
    overflow: hidden;
}

//
// Name
//
.modulemenu-name {
    overflow: hidden;
    flex-grow: 1;
    margin-left: 1em;
    white-space: nowrap;
    text-overflow: ellipsis;
}
87

88
89
90
91
92
93
.modulemenu {
    .modulemenu-name {
        @extend .sr-only;
    }
}

94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
//
// Indicator
//
.modulemenu-group > button:not(:disabled) {
    .modulemenu-indicator {
        display: none;
        position: relative;
        flex-grow: 0;
        flex-shrink: 0;
        height: 16px;
        width: 16px;
        margin: 8px;
        color: inherit;

        &:before,
        &:after {
            content: '';
            position: absolute;
            top: 50%;
            height: 0;
            width: 6px;
            border-top: 1px solid currentColor;
            transition: transform 0.25s ease-in-out;
117
118
        }

119
120
121
122
        &:before {
            left: 3px;
            transform: rotate(45deg);
        }
123

124
125
126
        &:after {
            right: 3px;
            transform: rotate(-45deg);
127
128
        }
    }
129
}
130

131
132
133
134
135
136
137
138
139
140
//
// Group
//
.modulemenu-group-container {
    list-style: none;
    padding: 0;
    margin: 0;

    > li {
        width: auto !important;
141
    }
142
}
143

144
145
146
147
.modulemenu-group-spacer {
    margin: 1.5em 0;
    border-top: 1px dashed rgba(255, 255, 255, 0.15);
}
148

149
150
151
152
153
button[aria-expanded="true"]:not(:disabled) {
    .modulemenu-indicator {
        &:before {
            transform: rotate(-45deg);
        }
154

155
156
        &:after {
            transform: rotate(45deg);
157
158
        }
    }
159
}
160

161
162
163
164
165
166
//
// Dropdown
//
.dropdown-menu {
    .modulemenu-name {
        display: block;
167
168
169
    }
}

170
171
172
//
// Scaffold
//
173
.scaffold-modulemenu-expanded {
174
175
    .modulemenu-action {
        margin-left: 0;
176
        width: 100%;
177
178
179
180
181
182
183
    }

    .modulemenu-indicator {
        display: block !important;
    }

    .modulemenu-name {
184
185
186
187
        position: static;
        margin: 0 0 0 1em;
        width: auto;
        height: auto;
188
189
    }
}