-
Notifications
You must be signed in to change notification settings - Fork 96
Expand file tree
/
Copy pathNcAppNavigationItem.scss
More file actions
230 lines (208 loc) Ā· 5.64 KB
/
NcAppNavigationItem.scss
File metadata and controls
230 lines (208 loc) Ā· 5.64 KB
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
/**
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
@use './variables.scss' as *;
.app-navigation-entry {
position: relative;
display: flex;
flex-shrink: 0;
flex-wrap: wrap;
width: 100%;
min-height: var(--default-clickable-area);
transition: background-color var(--animation-quick) ease-in-out;
transition: background-color 200ms ease-in-out;
border-radius: var(--border-radius-element);
&-wrapper {
position: relative;
display: flex;
flex-shrink: 0;
flex-wrap: wrap;
width: 100%;
&.app-navigation-entry--collapsible:not(.app-navigation-entry--opened) > ul {
// NO ANIMATE because if not really hidden, we can still tab through it
display: none;
}
}
// When .active class is applied, change color background of link and utils. The
// !important prevents the focus state to override the active state.
&.active {
background-color: var(--color-primary-element) !important;
&:hover {
background-color: var(--color-primary-element-hover) !important;
}
// overwrite active text color
.app-navigation-entry-link, .app-navigation-entry-button {
color: var(--color-primary-element-text) !important;
}
}
&:focus-within,
&:hover {
background-color: var(--color-background-hover);
}
&.active,
&:focus-within,
&:hover {
.app-navigation-entry__children {
background-color: var(--color-main-background);
}
}
// Show the actions on active
&.active,
// Always show the undo button
&.app-navigation-entry--deleted,
&:focus,
&:focus-within,
&:hover {
.app-navigation-entry__utils .app-navigation-entry__actions {
display: inline-block;
}
}
// ensure the actions have proper hover styles
// because the whole navigation item is highlighted we need a different color if only this part is hovered
.app-navigation-entry__actions:hover :deep(.button-vue) {
background-color: var(--color-background-dark) !important;
}
&.active .app-navigation-entry__actions:hover :deep(.button-vue) {
background-color: var(--color-primary-element) !important;
}
/* hide deletion/collapse of subitems */
&.app-navigation-entry--deleted > ul {
// NO ANIMATE because if not really hidden, we can still tab through it
display: none;
}
&:not(.app-navigation-entry--editing) {
.app-navigation-entry-link, .app-navigation-entry-button {
padding-inline-end: $icon-margin;
}
}
// Main entry link
.app-navigation-entry-link, .app-navigation-entry-button {
z-index: 100; /* above the bullet to allow click*/
display: flex;
overflow: hidden;
flex: 1 1 0;
min-height: var(--default-clickable-area);
padding: 0;
white-space: nowrap;
color: var(--color-main-text);
background-repeat: no-repeat;
background-position: $icon-margin center;
background-size: $icon-size $icon-size;
line-height: var(--default-clickable-area);
.app-navigation-entry-icon {
display: flex;
align-items: center;
flex: 0 0 var(--default-clickable-area);
justify-content: center;
width: var(--default-clickable-area);
height: var(--default-clickable-area);
background-size: $icon-size $icon-size;
background-repeat: no-repeat;
background-position: $icon-margin center;
}
.app-navigation-entry__name {
overflow: hidden;
max-width: 100%;
white-space: nowrap;
text-overflow: ellipsis;
font-weight: var(--font-weight-element, normal);
}
.editingContainer {
width: calc(100% - var(--default-clickable-area));
margin: auto;
}
&:focus-visible {
box-shadow: 0 0 0 4px var(--color-main-background);
outline: 2px solid var(--color-main-text);
border-radius: var(--border-radius-element);
}
}
}
/* Second level nesting for lists */
.app-navigation-entry__children {
--app-navigation-item-child-offset: 10px;
position: relative;
display: flex;
flex: 0 1 auto;
flex-direction: column;
width: 100%;
gap: var(--default-grid-baseline, 4px);
padding-inline-start: var(--app-navigation-item-child-offset);
.app-navigation-entry {
display: inline-flex;
flex-wrap: wrap;
}
& & & & & & & {
--app-navigation-item-child-offset: 0;
}
}
/* Deleted entries */
.app-navigation-entry__deleted {
display: inline-flex;
flex: 1 1 0;
padding-inline-start: calc(var(--default-clickable-area) - $icon-margin) !important;
.app-navigation-entry__deleted-description {
position: relative;
overflow: hidden;
flex: 1 1 0;
white-space: nowrap;
text-overflow: ellipsis;
line-height: var(--default-clickable-area);
}
}
/* counter and actions */
.app-navigation-entry__utils {
display: flex;
min-width: var(--default-clickable-area);
align-items: center;
flex: 0 1 auto;
justify-content: flex-end;
&#{&}--display-actions .action-item.app-navigation-entry__actions {
display: inline-block;
}
/* counter */
.app-navigation-entry__counter-wrapper {
// Add slightly more space to the end of the counter
margin-inline-end: calc(var(--default-grid-baseline) * 2);
display: flex;
align-items: center;
flex: 0 1 auto;
}
/* actions */
.action-item.app-navigation-entry__actions {
display: none;
}
}
// STATES
/* editing state */
.app-navigation-entry--editing {
.app-navigation-entry-edit {
z-index: 250;
opacity: 1;
}
}
/* deleted state */
.app-navigation-entry--deleted {
.app-navigation-entry-deleted {
z-index: 250;
transform: translateX(0);
}
}
/* pinned state */
.app-navigation-entry--pinned {
order: 2;
margin-top: auto;
// only put a marginTop auto to the first one!
~ .app-navigation-entry--pinned {
margin-top: 0;
}
}
// Add more contrast for active entry
[data-themes*='highcontrast'] {
.app-navigation-entry {
&:active {
background-color: var(--color-primary-element-light-hover) !important;
}
}
}