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

Button redesign #2148

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

Button redesign #2148

wants to merge 11 commits into from

Conversation

GomezIvann
Copy link
Collaborator

@GomezIvann GomezIvann commented Jan 27, 2025

Checklist

  • The build process is done without errors. All tests pass in the /lib directory.
  • Self-reviewed the code before submitting.
  • Meets accessibility standards.
  • Added/updated documentation to /website as needed.
  • Added/updated tests as needed.

Description
Redesign of the button component following the new design kit specifications, already using the new token architecture (CSS variables).

Additional context

@GomezIvann GomezIvann marked this pull request as ready for review February 3, 2025 12:28
@Mil4n0r Mil4n0r self-assigned this Feb 4, 2025
@Mil4n0r Mil4n0r self-requested a review February 4, 2025 16:12
Copy link
Collaborator

@Mil4n0r Mil4n0r left a 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.
Copy link
Collaborator

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.*

Comment on lines 53 to 62
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;
}
`;
Copy link
Collaborator

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.

Comment on lines +21 to +23
&:focus:enabled {
outline: var(--border-width-m) var(--border-style-default) var(--border-color-secondary-medium);
outline-offset: -2px;
Copy link
Collaborator

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?

Copy link
Collaborator

@Mil4n0r Mil4n0r Feb 5, 2025

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.

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

Successfully merging this pull request may close these issues.

2 participants