Skip to content

refactor(loader): swap hard-coded values for design token - FE-7442#7941

Open
DipperTheDan wants to merge 4 commits into
masterfrom
FE-7442_loader-token-updates
Open

refactor(loader): swap hard-coded values for design token - FE-7442#7941
DipperTheDan wants to merge 4 commits into
masterfrom
FE-7442_loader-token-updates

Conversation

@DipperTheDan
Copy link
Copy Markdown
Contributor

Proposed behaviour

Update hard-coded values with the latest design token values.

Current behaviour

Component is still using hard-coded values.

Checklist

  • Commits follow our style guide
  • Related issues linked in commit messages if required
  • Screenshots are included in the PR if useful
  • All themes are supported if required
  • Unit tests added or updated if required
  • Playwright automation tests added or updated if required
  • Storybook added or updated if required
  • Translations added or updated (including creating or amending translation keys table in storybook) if required
  • Typescript d.ts file added or updated if required
  • Related docs have been updated if required

QA

  • Tested in provided StackBlitz sandbox/Storybook
  • Add new Playwright test coverage if required
  • Carbon implementation matches Design System/designs
  • UI Tests GitHub check reviewed if required

Additional context

N/A

Testing instructions

  • Loader should match the designs specified in the specs on the ticket.
  • There should be no functional regressions with the component as this just concerns styling.

@DipperTheDan DipperTheDan force-pushed the FE-7442_loader-token-updates branch from 95282ec to 1cac26e Compare May 1, 2026 15:44
mihai-albu-sage
mihai-albu-sage previously approved these changes May 6, 2026
@@ -55,9 +55,9 @@ const time = "3s";

export const StyledStarSVG = styled.svg`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

question: Just above this styled component declaration there are two key frames which are defined animateStopTop & animateStopBottom both of which use hard coded hex values.

Are there any design tokens which we can use here instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Nope. On the design linked provided in the ticket, the values are hex values.

? "var(--progress-loader-inverse-bg-default)"
: "var(--progress-loader-bg-default)";

if (variant === "ai") {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

suggestion: within this if statement we have a ternary which renders different stops based on the inverse props boolean value.

Can we remove the secondary backup hard coded values here? Most consumers will be using our token provider for these new next components so the backup hard coded values are redundant.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Didn't even spot that these had fallback values. I'll get them removed now.

width: 15px;
height: ${barHeights[size]};
border-radius: var(--borderRadius400);
border-radius: var(--global-size-s);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

issue: for border-radius values we should use the global radius tokens opposed to the global size tokens

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good spot. My bad for copying the wrong token value, it should be a radius token.

@DipperTheDan DipperTheDan marked this pull request as ready for review May 11, 2026 14:57
@DipperTheDan DipperTheDan requested review from a team as code owners May 11, 2026 14:57
Comment thread src/components/loader/__next__/internal/star.style.ts
Comment thread src/components/loader/__next__/loader.style.ts Outdated
Comment thread src/components/loader/__next__/loader.style.ts
height: 100%;
background: radial-gradient(
1514.52% 80.26% at 56.89% 94.74%,
var(--mode-color-ai-alt-stop-1) 0%,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Waiting for Steven C to confirm stop positions.

Comment thread src/components/loader/__next__/loader.test.tsx
@DipperTheDan DipperTheDan marked this pull request as draft May 15, 2026 08:55
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This will be removed when I update with master as I don't have the up to date gitignore file.

@DipperTheDan DipperTheDan marked this pull request as ready for review May 21, 2026 11:09
Copy link
Copy Markdown

@clairedenning clairedenning left a comment

Choose a reason for hiding this comment

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

May need to revisit the animation in the next ticket - TBC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants