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

Remove unused tokens #515

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Remove unused tokens #515

wants to merge 3 commits into from

Conversation

langermank
Copy link
Contributor

Summary

Part of https://github.com/github/primer/issues/2097

I've got a lot of changes coming soon, so just removing anything that's not actually used to keep things cleaner. We have a better strategy in place for these kinds of generic tokens, but I haven't run into a use case to add them here.

List of notable changes:

Removed unused tokens:

--brand-animation-variant-scaleInTop-distance
--brand-color-success-emphasis
--brand-color-success-muted
--brand-color-success-subtle
--brand-color-error-emphasis
--brand-color-error-muted
--brand-color-error-subtle
--brand-color-neutral-emphasisPlus
--brand-color-neutral-emphasis
--brand-color-neutral-muted
--brand-color-accent-secondary

Contributor checklist:

  • All new and existing CI checks pass
  • Tests prove that the feature works and covers both happy and unhappy paths
  • Any drop in coverage, breaking changes or regressions have been documented above
  • New visual snapshots have been generated / updated for any UI changes
  • All developer debugging and non-functional logging has been removed
  • Related issues have been referenced in the PR description

Reviewer checklist:

  • Check that pull request and proposed changes adhere to our contribution guidelines and code of conduct
  • Check that tests prove the feature works and covers both happy and unhappy paths
  • Check that there aren't other open Pull Requests for the same update/change

Copy link

changeset-bot bot commented Dec 18, 2023

🦋 Changeset detected

Latest commit: 0b91e58

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

This PR includes changesets to release 6 packages
Name Type
@primer/brand-primitives Minor
@primer/react-brand Minor
@primer/brand-e2e Minor
@primer/brand-fonts Minor
@primer/brand-config Minor
@primer/brand-storybook 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

Copy link
Contributor

github-actions bot commented Dec 18, 2023

🟢 No design token changes found

Copy link
Contributor

github-actions bot commented Dec 18, 2023

🟢 No visual differences found

Our visual comparison tests did not find any differences in the UI.

Copy link
Contributor

@danielguillan danielguillan left a comment

Choose a reason for hiding this comment

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

Looks good to me. However, I'm unsure if the --brand-animation-variant-scaleInTop-distance was intentionally left unused or not. Either way, we can bring it back if needed later.

@rezrah
Copy link
Collaborator

rezrah commented Dec 19, 2023

While these tokens aren't used internally, I'd say there's a high likelihood that they're referenced by the end-user somewhere. E.g. I know that we reference --brand-color-success-* in a few marketing pages, and in the upcoming brand toolkit.

Removing these tokens technically constitutes a breaking change, so wondering:

a) do we need to do this right now? Can it be deferred and batched with the other upcoming breaking changes?
b) can we provide alternatives for folks that are currently relying on those tokens?

@langermank
Copy link
Contributor Author

@rezrah what is the plan for upgrading packages that consume Primer Brand tokens when we complete the mass renaming? I think the last time we talked about it, you weren't concerned about custom CSS usage.

Since I'm adding a stylelint config/plugin to handle find and replace for all the other tokens, I can do the same for these. But it would be helpful if I can see where they are used to best recommend a replacement token.

@rezrah
Copy link
Collaborator

rezrah commented Dec 20, 2023

@rezrah what is the plan for upgrading packages that consume Primer Brand tokens when we complete the mass renaming?

For tokens, a combination of stylelint codemods and/or written migration guides in the changelog should be enough, I think 👍

Here's a very recent example of a functional token being used consumer-side.

Since I'm adding a stylelint config/plugin to handle find and replace for all the other tokens, I can do the same for these.

🙏 That sounds great. If the configs aren't ready / available.. could also just expand the changelog entry to include a migration diff? Should be examples from previous deprecations in there already. If we don't have alternative tokens, we could also ask users to create local replacements for now. Just a one-liner would be fine. WDYT.

Leaving approval in meantime, as I'll be out until the new year.

Comment on lines -45 to -47
"secondary": {
"value": "var(--base-color-scale-purple-5)",
"dark": "var(--base-color-scale-purple-3)"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like we may need additional accent color variables in future to support our brand pillars, so worth keeping this around?

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

Successfully merging this pull request may close these issues.

None yet

3 participants