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 the hover text-decoration transition in InlineLink, Accordion, Timeline and align Prose with the updated InlineLink styles #913

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

Conversation

stamat
Copy link
Contributor

@stamat stamat commented Jan 29, 2025

Summary

We can't animate the text-decoration-thickness, we can animate a border, but since this is 1px transition, transitioning it is practically useless. Tested it on dotcom.

List of notable changes:

  • *removed transition: var(--brand-InlineLink-transition-timing) text-decoration; from InlineLink styles.
  • *removed transition: var(--brand-InlineLink-transition-timing) text-decoration; from Accordion styles.
  • *removed transition: var(--brand-InlineLink-transition-timing) text-decoration; from Timeline styles.
  • Aligned Prose inline link styles with the rest, since the animation didn't work anyways.

What should reviewers focus on?

  • Hover effect on InlineLink

Steps to test:

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

Before After

…er, but since this is 1px transition, transitioning it is practically useless
Copy link

changeset-bot bot commented Jan 29, 2025

🦋 Changeset detected

Latest commit: fa028d2

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 Patch
@primer/react-brand Patch
@primer/brand-e2e Patch
@primer/brand-fonts Patch
@primer/brand-config Patch
@primer/brand-storybook 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

Copy link
Contributor

github-actions bot commented Jan 29, 2025

🟢 No design token changes found

@stamat stamat self-assigned this Jan 29, 2025
@stamat stamat requested review from rezrah and joshfarrant and removed request for rezrah January 29, 2025 16:27
Copy link
Contributor

github-actions bot commented Jan 29, 2025

⚠️ Visual differences found

Our visual comparison tests found UI differences.

Please review the differences by using the test artifacts to ensure that the changes were intentional.

Artifacts can be downloaded and reviewed locally.

Download links are available at the bottom of the workflow summary screen.

Example:

artifacts section of workflow run

If the changes are expected, please run npm run test:visual:update-snapshots to replace the previous fixtures.

Review visual differences

Copy link
Contributor

@joshfarrant joshfarrant left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @stamat!

Hold off for Rez's ✅ before merging though please

@rezrah
Copy link
Collaborator

rezrah commented Feb 3, 2025

Thanks for tidying up the InlineLink component @stamat ✨ 🧹

Before we merge this, a few things to add...

  • We'll need a changeset
  • We should remove the base.json token file which declares the underlying token
  • Optional (but better to do it in this single PR): We should also remove the same CSS rules from the other components that use this InlineLink style, which are Accordion, Prose and Timeline

@stamat
Copy link
Contributor Author

stamat commented Feb 3, 2025

@rezrah yo, I don't know what does this mean: We should remove the base.json token file which declares the underlying token 🤷

@stamat
Copy link
Contributor Author

stamat commented Feb 3, 2025

@rezrah ah I see I see, the design token for the variable right?

@stamat stamat changed the title Remove the hover text-decoration transition in InlineLink Remove the hover text-decoration transition in InlineLink, Accordion, Timeline and align Prose with the updated InlineLink styles Feb 3, 2025
"@primer/react-brand": patch
---

Remove the hover text-decoration transition in `InlineLink`, `Accordion`, `Timeline` and align `Prose` with the updated `InlineLink` styles
Copy link
Collaborator

Choose a reason for hiding this comment

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

Great, thanks @stamat.

On the off-chance that someone was relying on that downstream, let's provide a migration path:

- var(--brand-InlineLink-transition-timing)
+ var(--brand-animation-duration-fast)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Remove the hover text-decoration transition in `InlineLink`, `Accordion`, `Timeline` and align `Prose` with the updated `InlineLink` styles
Removed a redundant hover text-decoration transition in `InlineLink`, `Accordion`, `Timeline` and align `Prose`.
Also removed the following css variable: `--brand-InlineLink-transition-timing`. If you were using this variable, please use `--brand-animation-duration-fast` instead.

@@ -252,10 +252,8 @@ details[open] > .Accordion__summary.Accordion__summary--default .Accordion__summ
color: var(--brand-InlineLink-color-rest);
position: relative;
text-decoration: underline;
text-decoration-color: var(--brand-InlineLink-color-rest);
Copy link
Collaborator

Choose a reason for hiding this comment

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

@stamat i think removing this has caused a visual regression. As you're trying to remove the transition, i'm guessing it's unintentional. Could we restore it please?

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