-
Notifications
You must be signed in to change notification settings - Fork 700
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
@@ -0,0 +1,171 @@ | |||
import { toValue, UnitValue } from "@webstudio-is/css-engine"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are building a lower level component, without any application logic, then it should go into design system pacakge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently in the design-system
package we are not using css-engine
pacakge. Is it ok if i add it there ? I am using types from there and it's the only reason i added it into builder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say you can decouple the things you are using from css engine, seems very minimal, but curious what @TrySound would say
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. |
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