Skip to content

Add accent button color and other updates to buttons - #955

Merged
rezrah merged 8 commits into
mainfrom
rezrah/accent-button
Apr 3, 2025
Merged

Add accent button color and other updates to buttons#955
rezrah merged 8 commits into
mainfrom
rezrah/accent-button

Conversation

@rezrah

@rezrah rezrah commented Mar 31, 2025

Copy link
Copy Markdown
Collaborator

Summary

Resolved https://github.com/github/primer/issues/4933

Adds a new green button variant named accent.

Also updates CTABanner spacing, as newer designs in latest Refactor project use the banners without a description. In those situations the spacing isn't enough, so increased to 32px per the designs on widest breakpoint.

🔗 Button Interface guidelines
🔗 Button React docs
🔗 Button Storybook
🔗 Accent button in Hero
🔗 Accent button in CTABanner

WIP TODO

  • Agree on final colors
  • Agree on final usage constraints:
    • Should have arrow by default?
    • Should only be used in two components?
    • Should not be used in specific components?
  • Add Figma component

List of notable changes:

  • added accent variant to button
  • removed arrow from all buttons except subtle
  • updates subtle hover state to be bg color instead of border
  • updated CTA banner spacing

What should reviewers focus on?

  • Design review
  • Reviewing guidelines (see links above)

Steps to test:

  1. Use links at the top of this PR description
  2. Review visual snapshots

Supporting resources (related issues, external links, etc):

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
  • UI Changes contain new visual snapshots (generated by adding update snapshots label to the PR)
  • 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

Screenshots:

Please try to provide before and after screenshots or videos

Light Dark

Screenshot 2025-03-31 at 13 57 36

Screenshot 2025-03-31 at 13 57 42

@changeset-bot

changeset-bot Bot commented Mar 31, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: eb17ac6

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

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

@github-actions

github-actions Bot commented Mar 31, 2025

Copy link
Copy Markdown
Contributor

🔍 Design token changes found

View CSS variable changes
+ --brand-button-accent-bgColor-rest: var(--base-color-scale-green-5);
+ --brand-button-accent-bgColor-hover: var(--base-color-scale-green-4);
+ --brand-button-accent-bgColor-active: var(--base-color-scale-green-5);
+ --brand-button-accent-bgColor-disabled: var(--base-color-scale-gray-4);
+ --brand-button-accent-fgColor-rest: var(--base-color-scale-white-0);
+ --brand-button-accent-fgColor-disabled: var(--base-color-scale-gray-2);
- --brand-button-subtle-borderColor-rest: transparent;
+ --brand-button-subtle-bgColor-rest: transparent;
- --brand-button-subtle-borderColor-hover: var(--base-color-scale-gray-9);
+ --brand-button-subtle-bgColor-hover: #b7bfc833;
- --brand-button-subtle-borderColor-active: var(--base-color-scale-gray-9);
+ --brand-button-subtle-bgColor-active: #b7bfc866;
+ --brand-button-accent-bgColor-rest: var(--base-color-scale-green-1);
+ --brand-button-accent-bgColor-hover: var(--base-color-scale-green-3);
+ --brand-button-accent-bgColor-active: var(--base-color-scale-green-1);
+ --brand-button-accent-bgColor-disabled: var(--base-color-scale-gray-4);
+ --brand-button-accent-fgColor-rest: var(--base-color-scale-black-0);
+ --brand-button-accent-fgColor-disabled: var(--base-color-scale-gray-2);
- --brand-button-subtle-borderColor-rest: transparent;
+ --brand-button-subtle-bgColor-rest: transparent;
- --brand-button-subtle-borderColor-hover: var(--base-color-scale-white-0);
+ --brand-button-subtle-bgColor-hover: #8a939e33;
- --brand-button-subtle-borderColor-active: var(--base-color-scale-white-0);
+ --brand-button-subtle-bgColor-active: #8a939e66;

@github-actions

github-actions Bot commented Mar 31, 2025

Copy link
Copy Markdown
Contributor

🟢 No visual differences found

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

@rezrah
rezrah requested a review from danielguillan March 31, 2025 13:00
@rezrah
rezrah marked this pull request as ready for review April 1, 2025 09:59
@rezrah rezrah changed the title Add accent color variant to button Add accent button color and other updates to buttons Apr 1, 2025

@danielguillan danielguillan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks great! 🚀

@rezrah
rezrah merged commit 2daaff8 into main Apr 3, 2025
@rezrah
rezrah deleted the rezrah/accent-button branch April 3, 2025 10:33
@primer-css primer-css mentioned this pull request Apr 3, 2025
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.

3 participants