1
1
/*!
2
- Copyright 2023 Adobe. All rights reserved.
2
+ Copyright 2025 Adobe. All rights reserved.
3
3
This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
you may not use this file except in compliance with the License. You may obtain a copy
5
5
of the License at http://www.apache.org/licenses/LICENSE-2.0
@@ -11,15 +11,17 @@ governing permissions and limitations under the License.
11
11
*/
12
12
13
13
.spectrum-AppFrameSideNav {
14
- --spectrum-app-side-nav-min-inline-size : 140px ;
15
- --spectrum-app-side-nav-max-inline-size : 260px ;
16
- --spectrum-app-side-nav-padding : var (--spectrum-spacing-200 );
14
+ --spectrum-app-side-nav-min-inline-size : var (--spectrum-app-side-nav-min-inline-size-expanded );
15
+ --spectrum-app-side-nav-max-inline-size : 240px ;
16
+ --spectrum-app-side-nav-padding-inline : var (--spectrum-spacing-200 );
17
+ --spectrum-app-side-nav-padding-block-start : var (--spectrum-spacing-300 );
18
+ --spectrum-app-side-nav-padding-block-end : var (--spectrum-spacing-200 );
17
19
--spectrum-app-side-nav-item-gap : var (--spectrum-spacing-100 );
18
20
--spectrum-app-side-nav-top-button-to-items : var (--spectrum-spacing-300 );
19
- --spectrum-app-side-nav-items- to-end-section : var (--spectrum-spacing-300 );
20
- --spectrum-app-side-nav-label-padding-block : var ( --spectrum-component-top-to-text-100 ) var ( --spectrum-component-bottom-to-text-100 ) ;
21
- --spectrum-app-side-nav-label-padding-inline : var (--spectrum-spacing-100 );
22
- --spectrum-app-side-nav-icon-border-radius : var (--spectrum-corner-radius-medium-default );
21
+ --spectrum-app-side-nav-label-padding-block : var ( --spectrum-component-top- to-text-100 ) var (--spectrum-spacing-100 );
22
+ --spectrum-app-side-nav-label-padding-inline-start : 6 px ;
23
+ --spectrum-app-side-nav-label-padding-inline-end : var (--spectrum-spacing-100 );
24
+ --spectrum-app-side-nav-expand-button-spacing-block-start : var (--spectrum-spacing-300 );
23
25
24
26
--spectrum-app-side-nav-line-height : var (--spectrum-line-height-100 );
25
27
--spectrum-app-side-nav-font-family : var (--spectrum-sans-font-family-stack );
@@ -28,28 +30,39 @@ governing permissions and limitations under the License.
28
30
--spectrum-app-side-nav-font-size : var (--spectrum-font-size-100 );
29
31
30
32
--spectrum-app-side-nav-content-color : var (--spectrum-neutral-content-color-default );
31
- --spectrum-app-side-nav-icon-color : var (--spectrum-neutral-content-color-default );
33
+ --spectrum-app-side-nav-icon-color : var (--spectrum-neutral-subdued- content-color-default );
32
34
--spectrum-app-side-nav-focus-indicator-color : var (--spectrum-focus-indicator-color );
33
35
--spectrum-app-side-nav-icon-background-default : transparent;
34
- --spectrum-app-side-nav-icon-background-focus : var (--spectrum-gray-200 );
35
36
36
- --spectrum-app-side-nav-icon-background-current : # 292929 ;
37
- --spectrum-app-side-nav-icon-color-current : var (--spectrum-white );
37
+ --spectrum-app-side-nav-icon-indicator-color : var (--spectrum-app-side-nav-icon-color );
38
+ --spectrum-app-side-nav-icon-indicator-color-current : var (--spectrum-app-side-nav-content-color );
39
+ --spectrum-app-side-nav-icon-indicator-color-hover : var (--spectrum-gray-400 );
40
+ --spectrum-app-side-nav-icon-indicator-inline-size : 2px ;
41
+ --spectrum-app-side-nav-icon-indicator-block-size : 18px ;
42
+ --spectrum-app-side-nav-expand-icon-color : var (--spectrum-gray-600 );
38
43
39
44
& : lang (ja ),
40
45
& : lang (zh ),
41
46
& : lang (ko ) {
42
47
--spectrum-app-side-nav-line-height : var (--spectrum-cjk-line-height-100 );
43
48
}
44
49
45
- /* To-do: For demo purposes only; would not convert to SWC. Would need a token. This value is just a guesstimate. */
46
- .spectrum--large & {
47
- --spectrum-app-side-nav-min-inline-size : 160px ;
50
+ & .spectrum-AppFrameSideNav--minimized {
51
+ --spectrum-app-side-nav-min-inline-size : var (--spectrum-app-side-nav-min-inline-size-minimized );
52
+ }
53
+
54
+ .spectrum-AppFrameSideNav-list-item-link {
55
+ & : hover {
56
+ --spectrum-app-side-nav-icon-indicator-color : var (--spectrum-app-side-nav-icon-indicator-color-hover );
57
+ }
48
58
}
49
- }
50
59
51
- .spectrum-AppFrameSideNav .spectrum-AppFrameSideNav--minimized {
52
- --spectrum-app-side-nav-min-inline-size : var (--spectrum-component-height-400 );
60
+ /* passthroughs for expand button action button */
61
+ --mod-actionbutton-content-color-default : var (--spectrum-app-side-nav-expand-icon-color );
62
+ --mod-actionbutton-background-color-hover : transparent;
63
+ --mod-actionbutton-background-color-down : transparent;
64
+ --mod-actionbutton-background-color-focus : transparent;
65
+ /* end passthroughs */
53
66
}
54
67
55
68
.spectrum-AppFrameSideNav {
@@ -58,7 +71,8 @@ governing permissions and limitations under the License.
58
71
59
72
box-sizing : border-box;
60
73
margin : 0 ;
61
- padding : var (--spectrum-app-side-nav-padding );
74
+ padding-block : var (--spectrum-app-side-nav-padding-block-start ) var (--spectrum-app-side-nav-padding-block-end );
75
+ padding-inline : var (--spectrum-app-side-nav-padding-inline );
62
76
display : flex;
63
77
flex-direction : column;
64
78
align-items : flex-start;
@@ -67,10 +81,17 @@ governing permissions and limitations under the License.
67
81
max-inline-size : var (--spectrum-app-side-nav-max-inline-size );
68
82
}
69
83
84
+ /* Optional button at the top of the side nav */
70
85
.spectrum-AppFrameSideNav .spectrum-AppFrameSideNav-button {
71
86
margin-block-end : var (--spectrum-app-side-nav-top-button-to-items );
72
87
}
73
88
89
+ /* Expand/collapse button at the bottom of the side nav */
90
+ .spectrum-AppFrameSideNav-expand-button {
91
+ margin-block-start : var (--spectrum-app-side-nav-expand-button-spacing-block-start );
92
+ color : var (--spectrum-app-side-nav-expand-icon-color );
93
+ }
94
+
74
95
.spectrum-AppFrameSideNav-list {
75
96
list-style-type : none;
76
97
margin : 0 ;
@@ -102,8 +123,8 @@ governing permissions and limitations under the License.
102
123
.spectrum-AppFrameSideNav-list-item-icon {
103
124
inline-size : var (--spectrum-component-height-100 );
104
125
block-size : var (--spectrum-component-height-100 );
105
- border-radius : var (--spectrum-app-side-nav-icon-border-radius );
106
126
display : flex;
127
+ flex-shrink : 0 ;
107
128
align-items : center;
108
129
justify-content : center;
109
130
background : var (--_spectrum-app-side-nav-icon-background );
@@ -114,21 +135,35 @@ governing permissions and limitations under the License.
114
135
display : flex;
115
136
flex-direction : row;
116
137
flex-wrap : nowrap;
138
+ align-items : center;
117
139
118
140
text-decoration : none;
119
141
outline : none;
120
142
color : var (--spectrum-app-side-nav-content-color );
121
143
144
+ position : relative;
145
+
122
146
& : focus-visible {
123
147
outline : 2px solid var (--spectrum-app-side-nav-focus-indicator-color );
148
+ border-radius : var (--spectrum-corner-radius-medium-default );
124
149
outline-offset : 2px ;
125
- border-radius : var (--spectrum-app-side-nav-icon-border-radius );
126
150
}
127
151
128
- & : focus-visible ,
129
- & : active ,
152
+ /* Indicator line for hover and current item */
153
+ & ::before {
154
+ position : absolute;
155
+ content : "" ;
156
+ inset-inline-start : calc (var (--spectrum-app-side-nav-icon-indicator-inline-size ) * -1 );
157
+ block-size : var (--spectrum-app-side-nav-icon-indicator-block-size );
158
+ inline-size : var (--spectrum-app-side-nav-icon-indicator-inline-size );
159
+ background : transparent;
160
+ border-radius : var (--spectrum-corner-radius-full );
161
+ }
162
+
130
163
& : hover {
131
- --_spectrum-app-side-nav-icon-background : var (--spectrum-app-side-nav-icon-background-focus );
164
+ & ::before {
165
+ background : var (--spectrum-app-side-nav-icon-indicator-color );
166
+ }
132
167
}
133
168
134
169
& : active {
@@ -138,14 +173,17 @@ governing permissions and limitations under the License.
138
173
}
139
174
140
175
.spectrum-AppFrameSideNav-list-item .spectrum-AppFrameSideNav-list-item--current & {
141
- --_spectrum-app-side-nav-icon-background : var (--spectrum-app-side-nav-icon-background-current );
142
- --_spectrum-app-side-nav-icon-color : var (--spectrum-app-side-nav-icon-color-current );
176
+ --_spectrum-app-side-nav-icon-color : var (--spectrum-app-side-nav-icon-indicator-color-current );
177
+
178
+ & ::before {
179
+ background : var (--spectrum-app-side-nav-icon-indicator-color-current );
180
+ }
143
181
}
144
182
}
145
183
146
184
.spectrum-AppFrameSideNav-list-item-label {
147
185
padding-block : var (--spectrum-app-side-nav-label-padding-block );
148
- padding-inline : var (--spectrum-app-side-nav-label-padding-inline );
186
+ padding-inline : var (--spectrum-app-side-nav-label-padding-inline-start ) var ( --spectrum-app-side-nav-label-padding-inline-end );
149
187
}
150
188
151
189
.spectrum-AppFrameSideNav--minimized .spectrum-AppFrameSideNav-list-item-label {
0 commit comments