swisspost / design-system

The Swiss Post Design System pattern library for a consistent and accessible user experience across the web platform.
https://design-system.post.ch
Apache License 2.0
120 stars 14 forks source link

[foundations]: Labels #3417

Closed Cian77 closed 1 month ago

Cian77 commented 2 months ago

Description

Open issues:

Design:

Tokens:

Design

https://www.figma.com/design/JIT5AdGYqv6bDRpfBPV8XR/Foundations-%26-Components-Next-Level?node-id=26-49

Tokens

DEVs proposal Base styles: body Token set name: Element/Label

Tasks

### 💻 Tasks
- [ ] Review Design (All states present? Possible to implement?)
- [ ] https://github.com/swisspost/design-system/issues/3496
- [ ] Use generic typography tokens from the elements collection
- [ ] HTML/CSS implementation
- [ ] Check if documentation is still ok
- [ ] Visual regression tests
- [ ] Design review
gfellerph commented 2 months ago

Default label styles can be inherited from the body. Other label variants are used in specific contexts, so the context should provide the overrides. Do we even need specific label styles or is it pure overhead?

-> If we define default label styles using the tokens, we'd get style changes to the default label without any change from our side, but as long as the label has the same styles as default text, we'd ship code that does not do anything.

gfellerph commented 2 months ago

@oliverschuerch please add information about what's needed from token side

oliverschuerch commented 1 month ago

We will not create tokens to use in code for this. As @gfellerph described, these text styles are used in different contexts (buttons, inputs, etc.). and will be tokenized there, per component.

There might be some FigmaOnly typography tokens for this, to simplify things in Figma, but that's all.

@Cian77 we will also not provide the possibility to use those styles through utility css-classes, because we don't think this should be possible. Do you agree?

If @Cian77 agrees to the above question, we can close this issue.

Vandapanda commented 1 month ago

@oliverschuerch @gfellerph @Cian77 Task unclear, can we close the ticket now or is there more needed? Ticket seems not ready for tokenization.

Vandapanda commented 1 month ago

Closed according to discussion, no specific label tokens will exist. Instead each Component uses its own token.