gamut icon indicating copy to clipboard operation
gamut copied to clipboard

style(Tag): Update Tag colors

Open LinKCoding opened this issue 1 year ago • 6 comments

Overview

Updates tags to use the correct color tokens. Current implementation of tags somewhat uses ColorMode and needs to invert the colors to work.

Major Changes:

  1. removed DismissButton from TagWrapper
  2. TagWrapper => TagLabelWrapper
  3. ^ necessary to remove the background behind DimissButton
  4. Tag is no longer a Background, is now a Box
  5. Changed the BaseButton to an IconButton (to gain access to ToolTip properties)
  6. The gray variant should have updated colors (and for hover state too)

Updates tags to use the correct color tokens.

PR Checklist

  • [ ] Related to designs: https://www.figma.com/design/ReGfRNillGABAj5SlITalN/%F0%9F%93%90-Gamut?node-id=46539-40954&m=dev
  • [x] Related to JIRA ticket: GM-778
  • [x] I have run this code to verify it works
  • [x] This PR includes unit tests for the code change
  • [x] This PR includes testing instructions tests for the code change
  • [x] The alpha package of this PR is passing end-to-end tests in all relevant Codecademy repositories

Testing Instructions

  1. Go to the Storybook preview and the tags page ?path=/docs/atoms-tag--tag-variants
  2. Look over the tags implementation, compare against the figma — Mono
  3. Go to the tengu preview env
  4. Go to Pricing > Individuals > select "Try Pro for free"
  5. Create an account
  6. At checkout, click on the "Have a promo code?" link
  7. Add in test50
  8. Check that the tag renders correctly. — Monolith
  9. go to the preview (without portal app), log in as an admin
  10. Go to the admin page and create a test user that has a Pro subscription + billed monthly (you can also use this link: https://pr-38096-monolith.dev-eks.codecademy.com/admin/test_user?prefill_id=66ab9a074e03aa000159fe35) ^ the settings is important because we need to upgrade the user (and can't seem to upgrade free or pro-lite users)
  11. Impersonate the test user
  12. go to "Account + Billing" > "Payment And Plan" tab
  13. Select "Change Plan" and opt to upgrade to bill yearly
  14. in the address bar append the query string: ?coupon=test50
  15. see that the tag is rendered
  16. ...
  17. Profit

Screenshots: Mono: image

Monolith: image

PR Links and Envs

Repository PR Link PR Env
Monolith Monolith PR Monolith Env
Portal Portal Link Portal Env
Another Repo Another Link Another Env

LinKCoding avatar Jul 20 '24 02:07 LinKCoding

image

this looks great, i don't see the line on zoom at all so i think it's just a weird pixel thing 🤷 only issue i'm seeing is this strange focus state bug (prob some inherited style 🤔 )

dreamwasp avatar Jul 23 '24 14:07 dreamwasp

this looks great, i don't see the line on zoom at all so i think it's just a weird pixel thing 🤷 only issue i'm seeing is this strange focus state bug (prob some inherited style 🤔 )

Nice, thanks! - I realized that focus states are a little messed up after I implemented my changes, gonna take some time to fix that (Just need to do the truncated tag for some reason the outline doesn't reach the full component)

LinKCoding avatar Jul 23 '24 15:07 LinKCoding

these look great! only thing i'm noticing is something slightly off with the focus styles on hover of one of the examples - the focus styles seem to be taking up the full width of their container?

image

if this is only happening in this example and not in actual code i'm happy to ✅ so i'm gonna take a look at mono now~

I see the issue — I'm guessing to add more spacing around tags, there was a .5 rem margin added around the tag itself which makes the focus outline bigger.

I've added a box around the tag now to include this padding and this should fix the issue.

Thanks for catching!!

LinKCoding avatar Jul 29 '24 14:07 LinKCoding

The SelectDropdown multiselect tag border radius are still a little off (2px v 4px in tags)- i think borderRadius got moved out of tagBaseStyles or something in the multiValue object so it's not making its way there anymore. you should be able to fix it by adding borderRadius 4px [here] (https://github.com/Codecademy/gamut/blob/f5a35661fe1f7262dc42effe6c84df3b240aff37/packages/gamut/src/Form/SelectDropdown/styles.ts#L177) image

dreamwasp avatar Jul 30 '24 16:07 dreamwasp

📬Published Alpha Packages:

@codecademy/[email protected]
@codecademy/[email protected]
@codecademy/[email protected]

codecademydev avatar Aug 05 '24 15:08 codecademydev