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

Update border-radii design tokens #980

Merged
merged 11 commits into from
Jun 16, 2021
Merged

Update border-radii design tokens #980

merged 11 commits into from
Jun 16, 2021

Conversation

robinmetral
Copy link
Contributor

@robinmetral robinmetral commented Jun 15, 2021

Purpose

Updates border radii to match Figma. Generally the mapping is:

value name before name after
1px kilo - 1
4px mega bit
6px giga - 2
8px tera byte
12px peta kilo
16px - mega

1 the value isn't part of design tokens anymore but some 1px radii were hardcoded in Circuit where it made sense, see comments below
2 6px radii were generally switched to 8px after consulting with design

Approach and changes

  • update the design tokens
  • write a codemod to map the values when upgrading
  • address all addressable FIXME comments in the codebase (mostly border-radius related)
  • fix the <Plus /> icon (it had a hardcoded #000 color)

ℹ️ the upgrade of Circuit's @sumup/design-tokens peer dependency will be done in a separate PR, we need to release it first

Definition of done

  • Development completed
  • Reviewers assigned
  • Unit and integration tests
  • Meets minimum browser support
  • Meets accessibility requirements

@sumup-clark
Copy link

sumup-clark bot commented Jun 15, 2021

Hey @robinmetral,
we are super excited that you are contributing! 🎉There's one more thing you need to do. Please accept our Contributor License Agreement. It helps you and us to collaborate on clear terms and focus on what we love most: code.

Thanks!

@changeset-bot
Copy link

changeset-bot bot commented Jun 15, 2021

🦋 Changeset detected

Latest commit: e9c4e5c

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

This PR includes changesets to release 3 packages
Name Type
@sumup/circuit-ui Major
@sumup/icons Patch
@sumup/design-tokens Major

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 Jun 15, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/sumup/oss-circuit-ui/7YyGMriodJdYc1w5s92ajbwk2m4X
✅ Preview: https://oss-circuit-ui-git-border-radii-update-sumup.vercel.app

Robin Métral added 4 commits June 15, 2021 18:35
This also bundles all component renames into a single codemod (typography components and NotificationBanner)
@codecov
Copy link

codecov bot commented Jun 16, 2021

Codecov Report

Merging #980 (e9c4e5c) into next (3cfefac) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             next     #980      +/-   ##
==========================================
+ Coverage   91.68%   91.70%   +0.02%     
==========================================
  Files         165      165              
  Lines        3077     3074       -3     
  Branches      782      754      -28     
==========================================
- Hits         2821     2819       -2     
  Misses        227      227              
+ Partials       29       28       -1     
Impacted Files Coverage Δ
packages/circuit-ui/components/Anchor/Anchor.tsx 100.00% <ø> (ø)
...ndar/components/CalendarWrapper/CalendarWrapper.js 100.00% <ø> (ø)
packages/circuit-ui/components/Card/Card.tsx 87.50% <ø> (ø)
...uit-ui/components/CardList/components/Item/Item.js 85.00% <ø> (ø)
...cuit-ui/components/InlineMessage/InlineMessage.tsx 95.23% <ø> (ø)
...i/components/NotificationCard/NotificationCard.tsx 100.00% <ø> (ø)
...i/components/NotificationList/NotificationList.tsx 100.00% <ø> (ø)
.../circuit-ui/components/SearchInput/SearchInput.tsx 100.00% <ø> (ø)
packages/circuit-ui/components/Select/Select.tsx 98.52% <ø> (ø)
...ckages/circuit-ui/components/Selector/Selector.tsx 100.00% <ø> (ø)
... and 13 more

Copy link
Contributor Author

@robinmetral robinmetral left a comment

Choose a reason for hiding this comment

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

See also the deploy preview and Chromatic to review this visually ✨

renameFactory(j, root, 'mega', 'bit');
renameFactory(j, root, 'giga', 'byte');
renameFactory(j, root, 'tera', 'byte');
renameFactory(j, root, 'peta', 'kilo');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: this doesn't replace this pattern:

const elementStyles = css`
  border-radius: ${p => p.theme.borderRadius.tera};
`;

I've seen it used more regularly recently, I'm not sure if I should extend the codemod to fit it?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, let's extend the codemod to cover this case. Would you like to pair on this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd love to!

@robinmetral robinmetral marked this pull request as ready for review June 16, 2021 10:49
@robinmetral robinmetral requested a review from connor-baer June 16, 2021 10:49
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