-
Notifications
You must be signed in to change notification settings - Fork 752
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
experimental: add gradient controller to update color stops using ui #4159
base: main
Are you sure you want to change the base?
Conversation
apps/builder/app/builder/features/style-panel/sections/backgrounds/gradient-control.tsx
Outdated
Show resolved
Hide resolved
846ef21
to
59d61cd
Compare
apps/builder/app/builder/features/style-panel/sections/backgrounds/gradient-control.tsx
Outdated
Show resolved
Hide resolved
I like how gradient style tries to balance new dots instead of manually centering, maybe not needed for our case |
I instinctively do alt+click to delete thumbs |
I would do color picker as popover, tooltip feels super unpredictable |
I think its not a bad idea for us to support this, since our users know this combo |
It is indeed looking good. But the catch is, if a user sets the slider to a custom location. It changes it at the time of rebalancing when a new stop is added. Or is the behaviour is different there ? |
I am using it as Seems the events from Slider are little bit unpredictable. |
apps/builder/app/builder/features/style-panel/sections/backgrounds/gradient-control.tsx
Outdated
Show resolved
Hide resolved
Total list of issues:
|
Looks like this is how all the sliders behave too. Its add for me too while working with gradient selector. But, let's see react-aria. Even it moves the closest thumb, when we click somewhere on the range Do you think, it's the actual standard spec and trying to prevent the movement is anti pattern ? |
@JayaKrishnaNamburu idk if preventing the movement is supported from the spec, like using some preventDefault, but it doesn't really matter, because in our case its not really a slider, we are just trying to see if slider gets us the UX we need to avoid reimplementing accessibility ourselves. So the question is really - can you hide the track or not let it listen to clicks in some other way or not |
|
yeah, but you already have your own click position logic, so why not hide the range, avoid radix for these, and based on where the click happened just add the new stop, click - your own logic, drag - slider logic |
Description
The
GradientControl
helps in displaying the colour stops that are available in the linear-gradient that users added.There are two knows issues at the moment.
tools, the colours are swapped resulting in the swiping of the gradient too.
This is because of a limitation/bug on the radix side, they pre-sort the slider stops. So, we can never know which crosses an existing stop and changed it's value. Slider ability to disable swap of multiple thumbs radix-ui/primitives#2247
Steps for reproduction
color-stops
in the gradient.color-hints
are displayed at the bottom of the gradient bar. These can't be moved along, more info about it is in the code component. Because, this basically changes the whole gradient just by moving.color-hints
are showed at the bottom of the gradient. Just to notify users about the existence of the hints.Code Review
Before requesting a review
Before merging
.env
file