-
Notifications
You must be signed in to change notification settings - Fork 808
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
Add gradient color to Button Component #1316
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@lokeswaran-aj is attempting to deploy a commit to the webstudio-is Team on Vercel. A member of the Team first needs to authorize it. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
kof
reviewed
Mar 28, 2023
Problem is that if is with that specific color, kinda not very useful
function, wouldn't use it at least in case of the gradient base
…On Wed, Mar 29, 2023, 8:09 AM Roman Pominov ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In packages/design-system/src/components/button.tsx
<#1316 (comment)>
:
> + if (base === "$colors$backgroundGradientPrimary") {
+ return `linear-gradient(${overlay}, ${overlay}), ${base}`;
+ }
This solution seems ok to me, except we should replace base ===
"$colors$backgroundGradientPrimary" with base ===
theme.colors.backgroundGradientPrimary.
Logic with this solution:
- backgroundColors applies two colors as a background, and does it
using a gradient hack
- but if one of the colors is a gradient itself, it should put it as is
------------------------------
Alternative solution: in perColorStyle do something like:
background: variant === "gradient" ? `linear-gradient(${overlay}, ${overlay}), ${base}` : backgroundColors(
backgrounds[variant],
theme.colors.backgroundButtonHover
)
Not sure which one is better, both seem ok to me.
—
Reply to this email directly, view it on GitHub
<#1316 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAM4WEBOEQB3U5RGPKTW4LW6PGZ3ANCNFSM6AAAAAAWK5KSAU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Yeah, let's do |
kof
approved these changes
Mar 30, 2023
merged, thank you! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR contains the changes for the Gradient color for the button component
Here is an example of share button with
gradient
color:Screen.Recording.2023-03-28.at.11.38.32.PM.mov
Steps for reproduction
color="gradient"
in Button ComponentCode Review
Before requesting a review
Before merging
.env.example
and thebuilder/env-check.js
if mandatory