CSS Attribute Selector Scoping
All styles target .nav-pattern-library[aria-label="Secondary Navigation"], isolating this component’s CSS so it never conflicts with other navs or lists on the same page.
Website AdministratorAvailable to users with full access to manage site and staff permissions
The Sidebar Links component provides a secondary navigation list for pages related in context to the current page. It renders as a stacked vertical list inside a dark navy container, with each link displayed as a full-width block on a medium-blue background. Hover states are handled through the scoped <style> block, which uses a CSS attribute selector to prevent conflicts with other elements on the page.
CSS Attribute Selector Scoping
All styles target .nav-pattern-library[aria-label="Secondary Navigation"], isolating this component’s CSS so it never conflicts with other navs or lists on the same page.
Block-Level Full-Width Links
Each <a> uses display: block with padding: 12px 16px, creating a large, easy-to-tap target that spans the full width of the nav container.
Smooth Transition Effects
Links include transition: background-color 0.3s, color 0.3s for polished interactions, with an underline applied on hover via the <style> block.
Accessible Landmark Markup
Semantic <nav> element with a descriptive aria-label="Secondary Navigation" identifies the block as a navigation landmark for screen readers.
CSS-Only Collapse (Nested variant)
The nested variant uses native HTML <details>/<summary> elements with ::after pseudo-element icons shwoing + when collapsed and − when expanded—no JavaScript required.
<!-- DEFAULT SIDEBAR LINKS --><style> .nav-pattern-library[aria-label="Secondary Navigation"] { background-color: #003366; } .nav-pattern-library[aria-label="Secondary Navigation"] ul { list-style-type: none; padding: 0; margin: 0; overflow: hidden; } .nav-pattern-library[aria-label="Secondary Navigation"] li { margin: 0; padding: 0; } .nav-pattern-library[aria-label="Secondary Navigation"] a { display: block; padding: 12px 16px; text-decoration: none; color: #ffffff; background-color: #3b5998; font-size: 16px; transition: background-color 0.3s, color 0.3s; } .nav-pattern-library[aria-label="Secondary Navigation"] a:hover { text-decoration: underline; }</style><nav class="nav-pattern-library" aria-label="Secondary Navigation"> <ul> <li> <a href="#"> Link 1 </a> </li> <li> <a href="#"> Link 2 </a> </li> <li> <a href="#"> Link 3 </a> </li> <li> <a href="#"> Link 4 </a> </li> <li> <a href="#"> Link 5 </a> </li> </ul></nav><!-- DEFAULT SIDEBAR LINKS — Active State --><style> .nav-pattern-library[aria-label="Secondary Navigation"] { background-color: #003366; } .nav-pattern-library[aria-label="Secondary Navigation"] ul { list-style-type: none; padding: 0; margin: 0; overflow: hidden; } .nav-pattern-library[aria-label="Secondary Navigation"] li { margin: 0; padding: 0; } .nav-pattern-library[aria-label="Secondary Navigation"] a { display: block; padding: 12px 16px; text-decoration: none; color: #ffffff; background-color: #3b5998; font-size: 16px; transition: background-color 0.3s, color 0.3s; } .nav-pattern-library[aria-label="Secondary Navigation"] a:hover { text-decoration: underline; } /* ACTIVE LINK — current page indicator */ .nav-pattern-library[aria-label="Secondary Navigation"] a[aria-current="page"] { background-color: #002244; }</style><nav class="nav-pattern-library" aria-label="Secondary Navigation"> <ul> <li> <a href="#"> Link 1 </a> </li> <li> <a href="/current-page/" aria-current="page"> Link 2 </a> </li> <li> <a href="#"> Link 3 </a> </li> <li> <a href="#"> Link 4 </a> </li> <li> <a href="#"> Link 5 </a> </li> </ul></nav><!-- NESTED SIDEBAR LINKS (Collapsible with CSS-only Plus/Minus Icons) --><style> .nav-pattern-library[aria-label="Secondary Navigation"] { background-color: #003366; } .nav-pattern-library[aria-label="Secondary Navigation"] ul { list-style-type: none; padding: 0; margin: 0; overflow: hidden; } .nav-pattern-library[aria-label="Secondary Navigation"] li { margin: 0; padding: 0; } .nav-pattern-library[aria-label="Secondary Navigation"] a { display: block; padding: 12px 16px; text-decoration: none; color: #ffffff; background-color: #3b5998; font-size: 16px; transition: background-color 0.3s, color 0.3s; } .nav-pattern-library[aria-label="Secondary Navigation"] a:hover { text-decoration: underline; } /* NESTED DETAILS STYLES */ .nav-pattern-library[aria-label="Secondary Navigation"] details { margin: 0; padding: 0; } .nav-pattern-library[aria-label="Secondary Navigation"] summary { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; text-decoration: none; color: #ffffff; background-color: #3b5998; font-size: 16px; cursor: pointer; list-style: none; user-select: none; transition: background-color 0.3s, color 0.3s; } .nav-pattern-library[aria-label="Secondary Navigation"] details[open] > summary { margin-bottom: 0; } .nav-pattern-library[aria-label="Secondary Navigation"] summary:hover span { text-decoration: underline; } .nav-pattern-library[aria-label="Secondary Navigation"] summary::before { content: none !important; display: none !important; } /* PLUS/MINUS ICONS */ .nav-pattern-library[aria-label="Secondary Navigation"] summary::after { content: "+"; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; font-size: 18px; font-weight: bold; color: #ffffff; margin-left: 12px; flex-shrink: 0; transition: transform 0.3s; border-radius: 5px; outline: 1px solid #ffffff; } .nav-pattern-library[aria-label="Secondary Navigation"] details[open] > summary::after { content: "−"; } .nav-pattern-library[aria-label="Secondary Navigation"] details > ul { background-color: #002d54; margin: 0; padding: 0; } .nav-pattern-library[aria-label="Secondary Navigation"] details > ul > li > a { padding-left: 32px; font-size: 14px; background-color: #2d4a7c; } .nav-pattern-library[aria-label="Secondary Navigation"] details > ul > li > a:hover { text-decoration: underline; }</style><nav class="nav-pattern-library" aria-label="Secondary Navigation"> <ul> <li> <a href="#"> Link 1 </a> </li> <li> <details> <summary> <span>Parent Link</span> </summary> <ul> <li> <a href="#"> Child Link 1 </a> </li> <li> <a href="#"> Child Link 2 </a> </li> </ul> </details> </li> <li> <a href="#"> Link 3 </a> </li> </ul></nav><!-- NESTED SIDEBAR LINKS — Active Child State --><style> .nav-pattern-library[aria-label="Secondary Navigation"] { background-color: #003366; } .nav-pattern-library[aria-label="Secondary Navigation"] ul { list-style-type: none; padding: 0; margin: 0; overflow: hidden; } .nav-pattern-library[aria-label="Secondary Navigation"] li { margin: 0; padding: 0; } .nav-pattern-library[aria-label="Secondary Navigation"] a { display: block; padding: 12px 16px; text-decoration: none; color: #ffffff; background-color: #3b5998; font-size: 16px; transition: background-color 0.3s, color 0.3s; } .nav-pattern-library[aria-label="Secondary Navigation"] a:hover { text-decoration: underline; } /* NESTED DETAILS STYLES */ .nav-pattern-library[aria-label="Secondary Navigation"] details { margin: 0; padding: 0; } .nav-pattern-library[aria-label="Secondary Navigation"] summary { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; text-decoration: none; color: #ffffff; background-color: #3b5998; font-size: 16px; cursor: pointer; list-style: none; user-select: none; transition: background-color 0.3s, color 0.3s; } .nav-pattern-library[aria-label="Secondary Navigation"] details[open] > summary { margin-bottom: 0; } .nav-pattern-library[aria-label="Secondary Navigation"] summary:hover span { text-decoration: underline; } .nav-pattern-library[aria-label="Secondary Navigation"] summary::before { content: none !important; display: none !important; } /* PLUS/MINUS ICONS */ .nav-pattern-library[aria-label="Secondary Navigation"] summary::after { content: "+"; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; font-size: 18px; font-weight: bold; color: #ffffff; margin-left: 12px; flex-shrink: 0; transition: transform 0.3s; border-radius: 5px; outline: 1px solid #ffffff; } .nav-pattern-library[aria-label="Secondary Navigation"] details[open] > summary::after { content: "−"; } .nav-pattern-library[aria-label="Secondary Navigation"] details > ul { background-color: #002d54; margin: 0; padding: 0; } .nav-pattern-library[aria-label="Secondary Navigation"] details > ul > li > a { padding-left: 32px; font-size: 14px; background-color: #2d4a7c; } .nav-pattern-library[aria-label="Secondary Navigation"] details > ul > li > a:hover { text-decoration: underline; } /* ACTIVE CHILD LINK — current page indicator */ .nav-pattern-library[aria-label="Secondary Navigation"] details > ul > li > a[aria-current="page"] { background-color: #002244; }</style><nav class="nav-pattern-library" aria-label="Secondary Navigation"> <ul> <li> <a href="#"> Link 1 </a> </li> <li> <details open> <summary> <span>Parent Link</span> </summary> <ul> <li> <a href="/current-page/" aria-current="page"> Child Link 1 </a> </li> <li> <a href="#"> Child Link 2 </a> </li> </ul> </details> </li> <li> <a href="#"> Link 3 </a> </li> </ul></nav>Update the aria-label — Change aria-label="Secondary Navigation" on the <nav> to a label that describes this specific nav (e.g., "Department Links" or "Related Pages"). You must also update the matching string in all three CSS selectors in the <style> block to keep styles working.
Add a link item — Copy any existing <li>...</li> block, paste it after the last </li>, and replace href="#" with the destination URL and update the link text.
Remove a link item — Delete the entire <li>...</li> block (including the <a> tag inside it) for any link you don’t need.
Update link destinations — Change href="#" on each <a> to the actual page URL or anchor (e.g., href="/departments/hr/" or href="#contact").
Change colors — Update background-color: #003366 on the <nav> rule to change the container color. Update background-color: #3b5998 and color: #ffffff on the <a> rule to change the link tile color and text color.
Adjust link padding — Modify padding: 12px 16px on the <a> rule to make rows taller/shorter or wider/narrower (e.g., padding: 10px 14px for tighter rows).
Add nested items (Nested variant only) — Wrap a parent <summary> in a <details> element, place a <ul> inside the <details> after the </summary>, and populate it with child <li> items containing <a> links. The nested menu is collapsed by default and users click the summary to expand it.
Customize nested colors (Nested variant only) — Update background-color: #002d54 on the .nav-pattern-library[aria-label="Secondary Navigation"] details > ul rule to change the parent container of nested lists. Update background-color: #2d4a7c on the child <a> rules to change the color of nested link tiles.
Change the icons (Nested variant only) — The + and − symbols are defined in the summary::after rules using content: "+" and content: "−". Replace these with any Unicode character or symbol (e.g., content: "▶" for arrow, or emoji for visual interest). Both instances must be updated—the collapsed state and the details[open] expanded state.
| Property | CSS Rule | Value | PUSD Color Name |
|---|---|---|---|
| Nav container background | background-color on nav | #003366 | Navy |
| Link tile background | background-color on a | #3b5998 | Medium Blue |
| Link text color | color on a | #ffffff | White |
| Hover state | text-decoration on a:hover | underline | — |
To align with PUSD brand standards, consider replacing the link tile background with #54c8eb (Light Blue) or keeping #003366 for a fully navy treatment.