Decathlon / vitamin-web

Decathlon Design System UI components for web applications
https://decathlon.github.io/vitamin-web
Apache License 2.0
279 stars 77 forks source link

bug(@vtmn/svelte): `VtmnNavbarLink` is not SSR compliant #1424

Closed Tlahey closed 1 year ago

Tlahey commented 1 year ago

On the current component the VtmnNavbarLink has a label and a toggle in order to display or not the label.

image

With this solution, we have flickering effects. The label must be hide / displayed with css.

The solution here is to add a specific slot on the component

<VtmnNavbarLink icon="xxx">
  <VtmnBadge slot="badge" />
  <span slot="label">Label</span>
</VtmnNavbarLink>

With this solution, it's possible to add css in order process css rules on the span.

Tlahey commented 1 year ago

link to #1425