Skip to content

Commit cfdd34b

Browse files
feat(appframesidenav): add styles for dividers and nested items
1 parent cc601cb commit cfdd34b

File tree

1 file changed

+41
-2
lines changed

1 file changed

+41
-2
lines changed

components/appframesidenav/index.css

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ governing permissions and limitations under the License.
4141
--spectrum-app-side-nav-icon-indicator-block-size: 18px;
4242
--spectrum-app-side-nav-expand-icon-color: var(--spectrum-gray-600);
4343

44+
--spectrum-app-side-nav-divider-block-size: var(--spectrum-border-width-200);
45+
--spectrum-app-side-nav-divider-color: var(--spectrum-gray-300);
46+
4447
&:lang(ja),
4548
&:lang(zh),
4649
&:lang(ko) {
@@ -62,6 +65,10 @@ governing permissions and limitations under the License.
6265
--mod-actionbutton-background-color-hover: transparent;
6366
--mod-actionbutton-background-color-down: transparent;
6467
--mod-actionbutton-background-color-focus: transparent;
68+
69+
/* passthroughs for tooltip */
70+
--mod-tooltip-animation-distance: -4px; /* accounts for icon spacing */
71+
6572
/* end passthroughs */
6673
}
6774

@@ -81,6 +88,16 @@ governing permissions and limitations under the License.
8188
max-inline-size: var(--spectrum-app-side-nav-max-inline-size);
8289
}
8390

91+
.spectrum-AppFrameSideNav-divider {
92+
block-size: var(--spectrum-app-side-nav-divider-block-size);
93+
background: var(--spectrum-app-side-nav-divider-color);
94+
inline-size: 100%;
95+
96+
& + .spectrum-AppFrameSideNav-list {
97+
margin-block: calc(var(--spectrum-app-side-nav-top-button-to-items) - var(--spectrum-component-top-to-text-100));
98+
}
99+
}
100+
84101
/* Optional button at the top of the side nav */
85102
.spectrum-AppFrameSideNav .spectrum-AppFrameSideNav-button {
86103
margin-block-end: var(--spectrum-app-side-nav-top-button-to-items);
@@ -109,10 +126,28 @@ governing permissions and limitations under the License.
109126
font-weight: var(--spectrum-app-side-nav-font-weight);
110127
font-style: var(--spectrum-app-side-nav-font-style);
111128
font-size: var(--spectrum-app-side-nav-font-size);
129+
130+
&.spectrum-AppFrameSideNav-list {
131+
margin-block-end: var(--spectrum-app-side-nav-item-gap);
132+
}
112133
}
113134

114135
.spectrum-AppFrameSideNav-list-item {
115136
display: block;
137+
138+
&[data-tier="0"] {
139+
position: relative;
140+
141+
.spectrum-AppFrameSideNav-list-item-disclosureIcon {
142+
transform: rotate(90deg);
143+
padding-block-end: calc(var(--spectrum-app-side-nav-padding-inline) / 2);
144+
padding-inline-start: var(--spectrum-app-side-nav-label-padding-inline-start);
145+
}
146+
}
147+
148+
&[data-tier="1"] {
149+
margin-inline-start: var(--spectrum-app-side-nav-item-gap);
150+
}
116151
}
117152

118153
/* Class to apply to the first nav item that should be aligned at the bottom (end section). Should only be applied to one item. */
@@ -186,6 +221,10 @@ governing permissions and limitations under the License.
186221
padding-inline: var(--spectrum-app-side-nav-label-padding-inline-start) var(--spectrum-app-side-nav-label-padding-inline-end);
187222
}
188223

189-
.spectrum-AppFrameSideNav--minimized .spectrum-AppFrameSideNav-list-item-label {
190-
display: none;
224+
.spectrum-AppFrameSideNav--minimized {
225+
.spectrum-AppFrameSideNav-list-item-label,
226+
.spectrum-AppFrameSideNav-list-item[data-tier="0"] .spectrum-AppFrameSideNav-list-item-link::after,
227+
.spectrum-AppFrameSideNav-list-item[data-tier="1"] {
228+
display: none;
229+
}
191230
}

0 commit comments

Comments
 (0)