_modulemenu.scss 3.03 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
47
//
// Action
//
.modulemenu-action {
    display: flex;
    padding: 4px;
    margin-top: 1px;
    color: inherit;
    align-items: center;
    width: 100%;
    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;
48
49
    }

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

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

59
60
61
    &.modulemenu-action-active {
        background-color: rgba(255, 255, 255, 0.2);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
62
    }
63
}
64

65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//
// Icon
//
.modulemenu-icon {
    position: relative;
    display: block;
    width: 32px;
    height: 32px;
    border-radius: 2px;
    flex-shrink: 0;
    overflow: hidden;
}

//
// Name
//
.modulemenu-name {
82
83
    @extend .sr-only;

84
85
86
87
88
89
    overflow: hidden;
    flex-grow: 1;
    margin-left: 1em;
    white-space: nowrap;
    text-overflow: ellipsis;
}
90

91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
//
// 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;
114
115
        }

116
117
118
119
        &:before {
            left: 3px;
            transform: rotate(45deg);
        }
120

121
122
123
        &:after {
            right: 3px;
            transform: rotate(-45deg);
124
125
        }
    }
126
}
127

128
129
130
131
132
133
134
135
136
137
//
// Group
//
.modulemenu-group-container {
    list-style: none;
    padding: 0;
    margin: 0;

    > li {
        width: auto !important;
138
    }
139
}
140

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

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

152
153
        &:after {
            transform: rotate(45deg);
154
155
        }
    }
156
}
157

158
159
160
161
162
163
//
// Dropdown
//
.dropdown-menu {
    .modulemenu-name {
        display: block;
164
165
166
    }
}

167
168
169
//
// Scaffold
//
170
.scaffold-modulemenu-expanded {
171
172
173
174
175
176
177
178
179
    .modulemenu-action {
        margin-left: 0;
    }

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

    .modulemenu-name {
180
181
182
183
        position: static;
        margin: 0 0 0 1em;
        width: auto;
        height: auto;
184
185
    }
}