Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support SideNav of 24.1 #3

Open
mrgreywater opened this issue Jun 9, 2023 · 1 comment
Open

Support SideNav of 24.1 #3

mrgreywater opened this issue Jun 9, 2023 · 1 comment

Comments

@mrgreywater
Copy link

mrgreywater commented Jun 9, 2023

Currently the new SideNav introduced in 24.1 doesn't appear to be styled. It would be nice if this design could be achieved: https://design.gs.com/components/side-panel-menu

@mrgreywater
Copy link
Author

mrgreywater commented Jun 13, 2023

Here is the style I've settled with for now to resemble the Goldman Sachs style:

vaadin-side-nav {
    --vaadin-side-nav-child-indent: calc(var(--lumo-icon-size) + var(--lumo-space-m));
}

vaadin-side-nav-item:not([slot='children']) {
    border-left: 0.16rem solid transparent;
}

vaadin-side-nav-item:has(vaadin-side-nav-item[active]) {
    border-left: 0.16rem solid var(--lumo-primary-color);
}

vaadin-side-nav-item[active]:not([slot='children']):not(:has(vaadin-side-nav-item)) {
    border-left: 0.16rem solid var(--lumo-primary-color);
}

vaadin-side-nav-item[expanded]:has(vaadin-side-nav-item) {
    background-color: var(--lumo-contrast-5pct);
    --side-nav-select-color: var(--lumo-contrast-10pct);
}

vaadin-side-nav-item[active] {
    --side-nav-select-color: var(--lumo-primary-color-30pct);
}

vaadin-side-nav-item::part(item):hover {
    background-color: var(--side-nav-select-color, var(--lumo-contrast-5pct));
}

vaadin-side-nav-item:has(vaadin-side-nav-item[active])::part(item) {
    color: var(--lumo-primary-color);
}

vaadin-side-nav-item vaadin-icon {
    color: unset;
}

vaadin-side-nav-item > vaadin-side-nav-item > [slot="prefix"] {
    display: none;
}

vaadin-side-nav-item::part(item) {
    color: var(--lumo-body-text-color);
    padding: var(--lumo-space-m);
    padding-left: var(--lumo-space-l);
    gap: var(--lumo-space-m);
    padding-inline-start: calc(var(--lumo-space-l) + var(--_child-indent, 0px));
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant