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

Add semantic color tokens to BaseStyles #1880

Merged
merged 12 commits into from
Jan 10, 2023
Merged

Conversation

robinmetral
Copy link
Contributor

@robinmetral robinmetral commented Dec 14, 2022

Purpose

This PR adds semantic color tokens to the Circuit UI BaseStyles.

The variables and color values are defined in Figma (internal ref).

Approach and changes

  • add the variables to the :root pseudo-class in BaseStyles (injected as global styles by Emotion)
  • listed the variables on the Storybook theme documentation

Definition of done

  • Development completed
  • Reviewers assigned
  • Unit and integration tests
  • Meets minimum browser support (uses CSS custom properties)
  • Meets accessibility requirements

@robinmetral robinmetral requested a review from a team as a code owner December 14, 2022 13:06
@robinmetral robinmetral requested review from connor-baer and removed request for a team December 14, 2022 13:06
@changeset-bot
Copy link

changeset-bot bot commented Dec 14, 2022

🦋 Changeset detected

Latest commit: a7f0dd2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sumup/circuit-ui Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Dec 14, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
oss-circuit-ui ✅ Ready (Inspect) Visit Preview Jan 6, 2023 at 0:50AM (UTC)

@robinmetral robinmetral changed the title emantic color tokens Add semantic color tokens to BaseStyles Dec 14, 2022
@robinmetral robinmetral marked this pull request as draft December 14, 2022 13:07
@sumup-oss sumup-oss deleted a comment from sumup-clark bot Dec 14, 2022
Robin Métral added 5 commits January 4, 2023 13:49
All colors are now named directly as their aliases. The 4-part token structure only serves as a mental model but is omitted in code (it will be detailed in documentation). This makes things more consistent, reduces the number of variables in global styles, and aligns closely to Figma.
Comment on lines +60 to +62
--cui-bg-strong: #000000;
--cui-bg-strong-hovered: #000000;
--cui-bg-strong-pressed: #000000;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How will users perceive/differentiate these different states?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case it looks like there is no differentiation. This could for instance be used in the ODL black buttons. From a standards perspective (WCAG 2.1 AA), nothing states that hovered or pressed states should be visually different from a UI element's idle state.

So we fall back to a design question—I'm happy to raise this with design again in the context of ODL (which introduces a lot of these black and white styles) but in the meantime I'd suggest moving forward here (no blocker and this is a design decision).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised this isn't an accessibility failure. I would at least classify it as a usability issue. Do you know if there's any other indicator planned in the new button design?

I agree that this shouldn't block this PR, but I'd like to question this decision and improve it in the future.

@codecov
Copy link

codecov bot commented Jan 5, 2023

Codecov Report

Merging #1880 (a7f0dd2) into main (790ef22) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1880   +/-   ##
=======================================
  Coverage   91.69%   91.69%           
=======================================
  Files         172      172           
  Lines        3565     3565           
  Branches     1152     1198   +46     
=======================================
  Hits         3269     3269           
  Misses        276      276           
  Partials       20       20           
Impacted Files Coverage Δ
...cuit-ui/components/BaseStyles/BaseStylesService.ts 100.00% <ø> (ø)

@robinmetral robinmetral marked this pull request as ready for review January 6, 2023 12:47
@robinmetral
Copy link
Contributor Author

@connor-baer re-requesting a quick review for the documentation (preview). I plan on expanding on it in the future—for now the colors are simply listed on the Theme page, and there's a convenient button to copy the custom property name.

Copy link
Member

@connor-baer connor-baer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing 🎨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants