Page MenuHomePhabricator

Define the system's box shadow styles
Closed, ResolvedPublic

Description

Background/Goal

Our system needs to document the different allowed shadow styles.
Once defined, the system's shadow values will be documented as tokens, which will ensure the application of system-compliant shadows in various contexts.

User stories

As a designer, I need to have access to the system's shadow values, so I can apply the right shadows when creating system compliant designs.

Figma

You can view the Figma spec sheet with all shadow tokens here.

Developer notes

box-shadows are a bit more complex in backwards-compatibility.

WikimediaUI Base v0.19.0OOUI
@box-shadow-base--focus: inset 0 0 0 1px @wmui-color-accent50;
@box-shadow-primary--focus: inset 0 0 0 1px @color-primary, inset 0 0 0 2px @color-base--inverted;
@box-shadow-destructive--focus: inset 0 0 0 1px @color-destructive, inset 0 0 0 2px @color-base--inverted;
@box-shadow-progressive--focus: inset 0 0 0 1px @color-primary, inset 0 0 0 2px @color-base--inverted;
@box-shadow-frameless-indicator--focus: 0 0 0 2px @color-primary;

As @box-shadow-base--focus will become @box-shadow-progressive--focus and @box-shadow-progressive--focus will become box-shadow.progressive-filled--focus we will need to rename variables downstream in order to carry on with the unchanged values in the right places.

Acceptance criteria (or Done)

Design

  • Define global shadows (drop & insets)
  • Define decision shadow tokens
  • Add tokens as styles in our Figma library

Codex

  • Add shadow tokens in Codex

Related Objects

StatusSubtypeAssignedTask
Duplicate STH
InvalidNone
ResolvedVolker_E
ResolvedNone
Resolvedbmartinezcalvo
ResolvedVolker_E
ResolvedVolker_E
ResolvedVolker_E
ResolvedVolker_E
Resolvedldelench_wmf
ResolvedVolker_E
Resolved EUdoh-WMF
ResolvedSarai-WMDE
Resolved DAbad
ResolvedVolker_E
Resolvedbmartinezcalvo
Resolved KieranMcCann
OpenNone
DuplicateNone
ResolvedVolker_E
Resolved DAbad
ResolvedVolker_E
Resolved DAbad
ResolvedSarai-WMDE
ResolvedCatrope
OpenNone
Resolvedovasileva
ResolvedBUG REPORTVolker_E
ResolvedVolker_E
ResolvedVolker_E
ResolvedVolker_E
ResolvedVolker_E
ResolvedSarai-WMDE
ResolvedVolker_E
Resolvedbmartinezcalvo
ResolvedCatrope
Resolved DAbad
ResolvedVolker_E

Event Timeline

Working in different explorations and iterations and talking in some meetings with @Volker_E and @Sarai-WMDE I move forward with this proposal for the Shadow tokens (Globals and Decisions).

Shadows.png (1×3 px, 224 KB)

The following tokens have been defined:

Global shadows:

  • Drop shadows
  • Inset shadows

Decision tokens:

  • Elevation
  • Focus

👇Decision: Do we want to call the drop shadows decision tokens "Elevations"? I have been thinking in more options but I think it's the best name since what it really does is raise the cards or popups.

@iamjessklein we need your confirmation to close this task.

You can view the Figma file here.

Are the elevations actually 1 line descriptions of the title of the shadow type? If so, I am not sure that it's a term that designers usually associate with drop shadows (so it adds unnecessary complexity).

After reviewing all our tokens nomenclature I have done some updates in the shadows:

  • All the Global tokens have numerical nomenclature.
  • All the Decision tokens have names related with their use cases.
  • Updated the shadow values for shadow-drop-80, trying to make it more subtle (it was too big).

Here you can view the final proposal.

Box-Shadow.png (1×4 px, 177 KB)

The “Drop” and “Inset” names are currently hindering final implementation. From a multi-theme perspective it's hindering to already define the drop/inset attribute on the theme-level token name.

@Volker_E can you clarify what you mean here? Do you have a proposal for renaming the tokens?

The “Drop” and “Inset” names are currently hindering final implementation. From a multi-theme perspective it's hindering to already define the drop/inset attribute on the theme-level token name.

@Volker_E I don't understand what you are mean. Could you clarify or give me an example of how should we name shadows?

The current proposal (v6 2022-02-16) features names like “Drop 500” or “Inset 200” as theme option tokens. Those two attributes already carries a quality of the token value. But we can't know if in a different theme the Inset 200 is really turning inset.
Hence we should call them something like Shadow 1000-1900 for outset/drop and Shadow 0-900 for inset or similar.

The current proposal (v6 2022-02-16) features names like “Drop 500” or “Inset 200” as theme option tokens. Those two attributes already carries a quality of the token value. But we can't know if in a different theme the Inset 200 is really turning inset.
Hence we should call them something like Shadow 1000-1900 for outset/drop and Shadow 0-900 for inset or similar.

@Volker_E updated option tokens from drop and inset to simply shadow with numbers from 100-900 and from 100-0 for inset (I've used 0-900 instead of 0-1900 since we are also using 0-100 for other tokens). We will still using drop and inset for decision tokens nomenclature.

Captura de pantalla 2022-04-27 a las 10.33.13.png (1×2 px, 599 KB)

STH triaged this task as High priority.Apr 30 2022, 6:13 PM
STH changed the task status from Open to In Progress.May 26 2022, 12:13 AM

Change 800084 had a related patch set uploaded (by VolkerE; author: VolkerE):

[design/codex@main] tokens: Use design-first `box-shadow` tokens

https://gerrit.wikimedia.org/r/800084

Change 802441 had a related patch set uploaded (by VolkerE; author: VolkerE):

[design/codex@main] styles: Apply design-first `box-shadow` tokens

https://gerrit.wikimedia.org/r/802441

@Volker_E I add here the new spec sheet version created with your last feedback in Figma so you can update the shadow tokens with the following:

  1. Options:
    • Opacities unified to 0.2 (instead of 0.15, 0.2 and 0.25)
  2. Decisions:
    • State decisions will be documented as legacy since they are shorthands (combination of different values from Shadows + Colors) and we decided to document all shorthands in our system as legacy.
    • We’ll use drop and inset for names and we’ll revisit them if we have problems with theming.
ldelench_wmf subscribed.

Moving from sprint board to backlog per our defined goals at sprint planning; please holler if there's a reason to bump up the priority.

Change 804261 had a related patch set uploaded (by VolkerE; author: VolkerE):

[oojs/ui@master] styles: Rename vars to be forward-compatible with Codex tokens

https://gerrit.wikimedia.org/r/804261

Change 804261 merged by jenkins-bot:

[oojs/ui@master] styles: Rename vars to be forward-compatible with Codex tokens

https://gerrit.wikimedia.org/r/804261

Volker_E renamed this task from Define the system's shadow styles to Define the system's box shadow styles.Jun 19 2022, 12:36 AM

Change 807056 had a related patch set uploaded (by VolkerE; author: VolkerE):

[design/codex@main] tokens: Introduce `box-shadow-color` decision tokens

https://gerrit.wikimedia.org/r/807056

Change 800084 merged by jenkins-bot:

[design/codex@main] tokens: Use design-first `box-shadow` tokens

https://gerrit.wikimedia.org/r/800084

Change 802441 merged by jenkins-bot:

[design/codex@main] styles: Apply design-first `box-shadow` tokens

https://gerrit.wikimedia.org/r/802441

Change 807056 merged by jenkins-bot:

[design/codex@main] tokens: Introduce `box-shadow-color` decision tokens

https://gerrit.wikimedia.org/r/807056

Change 813630 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/core@master] Update OOUI to v0.44.1

https://gerrit.wikimedia.org/r/813630

Change 813630 merged by jenkins-bot:

[mediawiki/core@master] Update OOUI to v0.44.1

https://gerrit.wikimedia.org/r/813630

@bmartinezcalvo One small missing detail is, we need transparent as box-shadow-color as well. We need it for a smooth transition between states.

@bmartinezcalvo One small missing detail is, we need transparent as box-shadow-color as well. We need it for a smooth transition between states.

@Volker_E updated Figma proposal with box-shadow-color-transparent

Change 816020 had a related patch set uploaded (by VolkerE; author: VolkerE):

[design/codex@main] tokens: Replace legacy `@box-shadow` tokens with new combination tokens

https://gerrit.wikimedia.org/r/816020

Change 816020 merged by jenkins-bot:

[design/codex@main] tokens: Replace legacy `@box-shadow` tokens with new combination tokens

https://gerrit.wikimedia.org/r/816020

Volker_E removed a project: Patch-For-Review.
Volker_E updated the task description. (Show Details)

Last step before moving over to QTE column is releasing the box shadows Figma file out of Explorations! @bmartinezcalvo :)

@bmartinezcalvo I think in this case, it would make sense to jump over QTE sign-off, don't you think? cc: @EUdoh-WMF

@bmartinezcalvo I think in this case, it would make sense to jump over QTE sign-off, don't you think? cc: @EUdoh-WMF

If @EUdoh-WMF agrees we can jump to Product sign off then.

Looks great! Before I sign off quick question: does it make sense to simply replace the Codex doc section with a link to Figma and simply add a description of the token?

We can use this as a practical example of how to start differentiating documentation and land on sources of truth for specific info...

Currently we have 2 locations for token documentation:

We should keep both resources. We need to make tokens available in the Codex demo site, so they remain directly and easily accessible for developers (this is an automated process). We also need to keep documenting tokens (manually) in Figma because:

  • We use the visual representation of tokens to create reusable styles (when possible). For example, each base color token in the design palette is recorded as a reusable color style in Figma. These styles are then consumed by design components in the library.
  • This increases findability and consultation for designers, as they can 1. see the design tokens used in context via the mentioned styles (vs. having to check SFCs), 2. access to usage descriptions (which we could/should also document in the token visualization pages in the Codex, of course)
  • Some tokens can be reused as components for specification, which supports consistency. For example, documenting the individual spacing tokens from the scale as reusable elements would facilitate the application of system compliant spacing in compositions.

But, it might be worth exploring if there are ways to keep both resources automatically aligned. I never found a solution that really worked, but Figma and its community are growing quickly, and design tokens are more and more common. As a con, implementing some sort of automated solution will probably mean that we'll have to redefine our token "publication" workflow, and probably reshape all our current documentation, though.

Agree with @Sarai-WMDE. That's one of the challenges with the design system, we need to cater to both audiences, designers and developers slightly differently (and the PMs somewhere in between on a more zoomed out level ;) ). See also T295605.

We have been trying to keep the documentation as slim as possible in order to not so easily go out of sync between Figma and Codex demo site by keeping walls of text aligned.

Further options would besides Figma automated token assets output also be stronger IDE support (similar to TypeScript), but currently such options are very immature and under constant change.

All good. Product sign-off complete.

We'll look at documentation in the documentation epic.

Volker_E closed this task as Resolved.EditedAug 4 2022, 10:31 AM
Volker_E claimed this task.

Resolving as design-first box-shadow tokens have already been deployed in Codex v0.1.0-alpha.9.