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

Spinner: VR color variants #3912

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Spinner: VR color variants #3912

wants to merge 2 commits into from

Conversation

diyorbek
Copy link
Contributor

Summary

Added new color variants for VR Spinner.

color="white"
Screenshot 2024-12-16 at 22 38 21

color="grayscale"
Screenshot 2024-12-16 at 22 38 16

Links

Checklist

  • Added unit tests
  • Added documentation + accessibility tests
  • Verified accessibility: keyboard & screen reader interaction
  • Checked dark mode, responsiveness, and right-to-left support
  • Checked stakeholder feedback (e.g. Gestalt designers, relevant feature teams)

@diyorbek diyorbek requested a review from a team as a code owner December 16, 2024 17:39
Copy link

netlify bot commented Dec 16, 2024

Deploy Preview for gestalt ready!

Name Link
🔨 Latest commit 5345569
🔍 Latest deploy log https://app.netlify.com/sites/gestalt/deploys/676065f10a827000083eeb23
😎 Deploy Preview https://deploy-preview-3912--gestalt.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Dec 16, 2024

Deploy Preview for gestalt ready!

Name Link
🔨 Latest commit 16a97df
🔍 Latest deploy log https://app.netlify.com/sites/gestalt/deploys/6760666c8595d80008fc9fb0
😎 Deploy Preview https://deploy-preview-3912--gestalt.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@diyorbek diyorbek added the minor release Minor release label Dec 16, 2024
Copy link
Contributor

@rlingineni rlingineni left a comment

Choose a reason for hiding this comment

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

Approved but see suggestion on not introducing one-off component tokens

@@ -59,6 +59,16 @@ svg * {
calc(var(--g-enter-delay) + 300ms);
}

.spinner.grayscale circle {
animation-name: scale, none, dot-intro;
fill: var(--comp-spinner-grayscale-background);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm tempted to say that we should use a single token (comp-spinner-background) and ovverride the value of the token in the react component. Instead of introducing one-off component tokens.

When we do have better theming support, we can use a theme provider to provide those values

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rlingineni can you elaborate? I thought having component tokens in this kind of situations are expected and encouraged. 🤔

this kind of situations => where we have multiple color variants for a component.

Should iOS and Android should do the same in these situations? Where should the token values be read from while setting them from the component?

Copy link
Contributor

@rlingineni rlingineni Dec 17, 2024

Choose a reason for hiding this comment

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

Ideally - because the function is the same for these component tokens I was thinking it'd be like this:

You've already written the color tokens like this:

-comp-spinner-color-background-1
-comp-spinner-color-background-2
-comp-spinner-color-background-3

So I would think you would override these token values, instead of making new ones.

In general for these components with component variants,

the ideal would be like this:

comp.json
-comp-spinner-color-background-1: Color1
-comp-spinner-color-background-2: Color2
-comp-spinner-color-background-3: Color3
comp-light-variant.json
-comp-spinner-color-background-1: Color1
-comp-spinner-color-background-2: Color1
-comp-spinner-color-background-3: Color1

And the provider would allow you to pull from the right variant. Right now, we're not sure on the structure of how to do these, or the provider.

So what I'm proposing is to put this "theme" override in JS in the react component.

So even applying override classes like this could probably work:


.darkVariant{
-comp-spinner-color-background-1: Color1
-comp-spinner-color-background-2: Color1
-comp-spinner-color-background-3: Color1
}

.lightVariant{
-comp-spinner-color-background-1: Color2
-comp-spinner-color-background-2: Color2
-comp-spinner-color-background-3: Color2
}

That way - themes represent values changing.

On iOS and Android, I thought the preference was to use Lottie? They also need some level of sub-theming support.

Alternatively, you can keep the current token you made, and use that to set the value of the other tokens - in case we think iOS and Android would need it. But if they need a component token, they can also add it in iOS.json or android.json files to have them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On iOS and Android, I thought the preference was to use Lottie?

yes but my question was in general

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor release Minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants