-
Notifications
You must be signed in to change notification settings - Fork 15
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
Button redesign #2148
base: master
Are you sure you want to change the base?
Button redesign #2148
Conversation
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.
A few minor changes.
Won't accept the PR until we get to update the docs though.
/** | ||
* Specifies the semantic meaning of the buttons, which determines its color. | ||
*/ | ||
semantic?: "default" | "error" | "warning" | "success" | "info"; | ||
semantic?: Semantic; | ||
/** | ||
* If true, the component will be disabled. |
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 true, the button will be disabled.*
const IconContainer = styled.div<{ | ||
size: ButtonPropsType["size"]; | ||
size: Size; | ||
}>` | ||
display: flex; | ||
font-size: ${(props) => (props.size?.height === "small" ? "16" : props.size?.height === "medium" ? "16" : "24")}px; | ||
font-size: var(${({ size }) => (size?.height === "large" ? "--height-s" : "--height-xxs")}); | ||
svg { | ||
height: ${(props) => (props.size?.height === "small" ? "16" : props.size?.height === "medium" ? "16" : "24")}px; | ||
width: ${(props) => (props.size?.height === "small" ? "16" : props.size?.height === "medium" ? "16" : "24")}px; | ||
height: var(${({ size }) => (size?.height === "large" ? "--height-s" : "--height-xxs")}); | ||
width: ${({ size }) => (size?.height === "large" ? "24" : "16")}px; | ||
} | ||
`; |
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.
Not a mistake, but in my redesigns so far I am using
${({ size }) => (size?.height === "large" ? "var(--height-s)" : "var(--height-xxs)")});
over
var(${({ size }) => (size?.height === "large" ? "--height-s" : "--height-xxs")});
It feels more readable for me, but we can talk about it to come up with a common criteria for all the PRs.
&:focus:enabled { | ||
outline: var(--border-width-m) var(--border-style-default) var(--border-color-secondary-medium); | ||
outline-offset: -2px; |
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.
Maybe instead of doing this workaround to "overlap" the existing border in the button, we should just use border here to overwrite its color?
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.
Also, you should add $:active here as well, you can see in figma that the outline must be in both focus and active states.
Checklist
/lib
directory./website
as needed.Description
Redesign of the button component following the new design kit specifications, already using the new token architecture (CSS variables).
Additional context