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

Improve responsive behavior and styling support #2

Open
juuso-vaadin opened this issue Dec 12, 2024 · 0 comments
Open

Improve responsive behavior and styling support #2

juuso-vaadin opened this issue Dec 12, 2024 · 0 comments

Comments

@juuso-vaadin
Copy link

Currently the component can be set to hide elements when viewport hits a fixed breakpoint of 420px.
Currently the component doesn't handle overflowing caused by large number of items or long labels very gracefully.

More common approach could be to set certain items to have overflow ellipsis.
From UX point-of-view it often makes sense to keep the root item and the closest parent item visible while allowing collapsing the rest.
image

Suggested style adjustments

Many of the current styles could be moved from shadowDOM to help overriding them.

Introduce variables to help configuring the separator.

vcf-breadcrumbs {
    --vcf-breadcrumbs-separator-symbol: "/";
    --vcf-breadcrumbs-separator-color: var(--lumo-disabled-text-color);
}

vcf-breadcrumb::part(separator) {
    margin: 0;  /* remove from component */
    padding: 0 var(--lumo-space-s);
}

vcf-breadcrumb::part(separator)::after {
    content: var(--vcf-breadcrumbs-separator-symbol, ">");
    color: var(--vcf-breadcrumbs-separator-color);
}

Repurpose the shift attribute to mark elements that can be clipped.

vcf-breadcrumb::part(link) {
    white-space: nowrap;
}

vcf-breadcrumb[shift]::part(link) {
    overflow: hidden;
    text-overflow: ellipsis;
}

vcf-breadcrumb {
    display: flex;
    align-items: center;
    flex: 0 1 auto;
}

vcf-breadcrumb[shift] {
    overflow: hidden;
}

Remove <iron-media-query> and make an example of same configuration with normal CSS media query

@media screen and (max-width: 420px) {
    vcf-breadcrumb[shift] {
        display: none;
    }
}

Lumo style for anchors

a:where(:any-link) {
    color: var(--lumo-primary-text-color);
}
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