designsystemet icon indicating copy to clipboard operation
designsystemet copied to clipboard

Visual inconsistencies between `Popover.Trigger` in Figma and code

Open mrosvik opened this issue 9 months ago • 6 comments

Description: There are visual inconsistencies between how Popover.Trigger is designed in Figma and how it appears in the implemented code. This may lead to confusion for teams trying to align design and development.

Figma:

Image

Code:

Image

mrosvik avatar Apr 04 '25 09:04 mrosvik

There are a few issues with this being blue: We would need to use our info color, we don't know the consumers name on colors. Inherithing from data-color will result in this being neutral 99% of the time, since this is meant for inline text. There is no way around this, unless only the text inside this trigger should have a different text color.

Some other things to keep in mind:

  • Since we need to use our info, it might not fit with the consumers design.
  • No way of changing it unless you use CSS

I suggest going with how it is in code today, since this already supports multiple colors, depending on your text color.

What we can do, is add the background, but this would also need to be our info - or the users closest data-color.

Barsnes avatar Apr 23 '25 13:04 Barsnes

Would it be an option to use main-border-strong? It might not be essential that the color is blue specifically—what matters more is that it aligns with the link color, which also uses main.

We could also use a background color based on main (main-surface-tinted), it doesn’t have to be specifically blue. The important thing is consistency with other elements. Would that approach work? :)

mrosvik avatar Apr 24 '25 08:04 mrosvik

Would it be an option to use main-border-strong? It might not be essential that the color is blue specifically—what matters more is that it aligns with the link color, which also uses main.

We could also use a background color based on main (main-surface-tinted), it doesn’t have to be specifically blue. The important thing is consistency with other elements. Would that approach work? :)

No. main is only a namespace in figma. In code we have no relationship with "main" or "support". In code we only know the names of the colors we supply. Neutral and severity colors.

Barsnes avatar Apr 24 '25 08:04 Barsnes

We’ve decided that the context in which this is placed will determine the color. Unless something else is explicitly set, the default will be neutral.

  • Figma will be updated with a variant using the neutral color (Fixed by @mrosvik)
  • Code will be updated to include a background for the active state, with neutral-subtle as the default. (Fixed by @Barsnes)

mrosvik avatar Apr 24 '25 11:04 mrosvik

Done in Figma:

Image

mrosvik avatar Apr 24 '25 11:04 mrosvik

Done in Figma:

Image

Adding a background is not possible without javascript. The button does not know when it's popover is open.

If we do this with JS, it means that CSS only consumers won't get the same functionality.

Barsnes avatar May 09 '25 09:05 Barsnes