Skip to content

Conversation

broccolinisoup
Copy link
Member

@broccolinisoup broccolinisoup commented Jan 23, 2023

Note: These are the non breaking changes from this PR

Improvements

  • Add a block prop for full width
  • Add alignContent prop to align content to center or start
  • Use control sizing CSS variable values (not using CSS vars just yet)
  • Use height over padding for more control over sizing

Visual updates

Addresses a few things missing from this discussion: https://github.com/github/primer/discussions/1016

  • Slightly more condensed padding
  • Uses correct font weight

Closes:

Screenshots

Please refer to the comprehensive Storybook stories- this is just a small sample of some of the changes

before after description
image image trailing action slot alignment
image image default padding, font-weight
image image large height
icon was blue image invisible svg color
image image trailing action locks right in full width

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.

@changeset-bot
Copy link

changeset-bot bot commented Jan 23, 2023

🦋 Changeset detected

Latest commit: 8b8cf1f

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

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

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

@broccolinisoup broccolinisoup changed the title initial commit Button style enhancement - to be deleted Jan 23, 2023
@broccolinisoup broccolinisoup changed the title Button style enhancement - to be deleted Button style enhancement - to be deleted - just testing something Jan 23, 2023
@broccolinisoup broccolinisoup temporarily deployed to github-pages January 23, 2023 00:57 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-2792 January 23, 2023 00:58 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-2792 January 23, 2023 00:58 Inactive
@github-actions
Copy link
Contributor

github-actions bot commented Jan 23, 2023

size-limit report 📦

Path Size
dist/browser.esm.js 89.52 KB (+0.55% 🔺)
dist/browser.umd.js 90.15 KB (+0.58% 🔺)

@broccolinisoup broccolinisoup temporarily deployed to github-pages January 23, 2023 01:21 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-2792 January 23, 2023 01:21 Inactive
@broccolinisoup broccolinisoup temporarily deployed to github-pages January 23, 2023 01:59 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-2792 January 23, 2023 01:59 Inactive
@langermank langermank temporarily deployed to github-pages January 23, 2023 17:40 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-2792 January 23, 2023 17:41 Inactive
@langermank langermank temporarily deployed to github-pages January 23, 2023 23:06 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-2792 January 23, 2023 23:07 Inactive
@langermank langermank mentioned this pull request Jan 25, 2023
6 tasks
@broccolinisoup broccolinisoup temporarily deployed to github-pages January 26, 2023 23:07 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-2792 January 26, 2023 23:07 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-2792 January 26, 2023 23:08 Inactive
@broccolinisoup broccolinisoup marked this pull request as ready for review January 26, 2023 23:48
@broccolinisoup broccolinisoup added update snapshots 🤖 Command that updates VRT snapshots on the pull request and removed update snapshots 🤖 Command that updates VRT snapshots on the pull request labels Jan 27, 2023
@langermank langermank temporarily deployed to github-pages January 27, 2023 20:43 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-2792 January 27, 2023 20:44 Inactive
@joshblack joshblack added update snapshots 🤖 Command that updates VRT snapshots on the pull request and removed update snapshots 🤖 Command that updates VRT snapshots on the pull request labels Jan 27, 2023
@github-actions github-actions bot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Jan 27, 2023
@broccolinisoup broccolinisoup temporarily deployed to github-pages January 30, 2023 00:38 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-2792 January 30, 2023 00:39 Inactive
@broccolinisoup broccolinisoup changed the title Button style enhancement - to be deleted - just testing something Button style enhancement Jan 30, 2023
@@ -103,15 +102,15 @@ export const getVariantStyles = (variant: VariantType = 'default', theme?: Theme
},
},
invisible: {
color: 'accent.fg',
color: 'btn.text',
Copy link
Member

Choose a reason for hiding this comment

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

Random question, if something is currently theming/relying on btn.text would this change impact them?

Copy link
Contributor

Choose a reason for hiding this comment

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

@joshblack can you give me an example of what you're thinking?

Copy link
Member

Choose a reason for hiding this comment

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

@langermank I probably should have used btn.hoverBg or btn.selectedBg as a better example 😅 It seemed like if someone created a custom theme like:

const customTheme = deepmerge(theme, {
  colors: {
    btn: {
      hoverBg: 'var(--my-custom-color)',
    },
  },
})

Based on the example here: https://primer.style/react/theming#customizing-the-theme

That this might no longer work since that btn.hoverBg token is no longer used in the hover styles. Hope that makes sense, let me know if I'm misunderstanding anything!

Copy link
Contributor

Choose a reason for hiding this comment

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

@joshblack I didn't know we offered theming options like that! That's kind of risky isn't it, and makes it near impossible for us to even rename things without any visual changes 😅 but yeah, you're right, it would break. Does that mean I need to move this to a major release?

Copy link
Member

Choose a reason for hiding this comment

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

@langermank agreed, I think it brings in component tokens as part of the public API. Would an interim solution potentially be to set the value of these tokens to the new expected value? Not sure if the references work that way but wanted to throw it out there if so.

Also added this to that versioning doc under "theming": https://github.com/primer/react/blob/37cfd07fb1eef4c0655157a0c9025cec94abaed5/contributor-docs/versioning.md#changes so we can align on if this is part of semver or not for the project

Copy link
Contributor

Choose a reason for hiding this comment

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

Would an interim solution potentially be to set the value of these tokens to the new expected value?

Normally I would say yes, but this component was using generic color tokens here– not specific to Button. I think it would be weird to override accent.fg with a different color 🤔 unless I'm not understanding correctly

Copy link
Member

Choose a reason for hiding this comment

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

@langermank was more-so thinking of stuff like:

  • btn.hoverBg has the value actionListItem.default.hoverBg
  • btn.selectedBg has the value actionListItem.default.activeBg

Note: there was one usage of btn.selectedBg going to actionListItem.default.selectedBg that I wasn't sure how to remediate

I think the big thing was just trying to see if we could keep the component tokens (btn.*) the same in the source code but change their values in the theme, if possible. Totally get if this really isn't do-able though

Copy link
Contributor

Choose a reason for hiding this comment

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

@joshblack I'm reverting these changes for now and will add them back into the followup PR for our next major release 😄

@langermank langermank temporarily deployed to github-pages January 31, 2023 22:40 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-2792 January 31, 2023 22:40 Inactive
@langermank langermank temporarily deployed to github-pages January 31, 2023 23:02 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-2792 January 31, 2023 23:03 Inactive
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.

4 participants