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

[Skeleton] Add rounded variant #33044

Closed
wants to merge 1 commit into from

Conversation

soullivaneuh
Copy link

@soullivaneuh soullivaneuh commented Jun 6, 2022

closes #33043

@mui-bot
Copy link

mui-bot commented Jun 6, 2022

Details of bundle changes

Generated by 🚫 dangerJS against ef29835

@soullivaneuh soullivaneuh force-pushed the skeleton/rounded-variant branch 2 times, most recently from 5ed805a to 2786bec Compare June 6, 2022 12:50
Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not obvious to me is why we need this change. It seems that we could either change the Material UI default look & feel or ask developers to apply a theme customization when their designer wants to diverge from the default look.

@@ -37,7 +37,7 @@ For instance:

## Variants

The component supports 3 shape variants.
The component supports 4 shape variants.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds off. Aren't we mixing aesthetic considerations with the kind of component that the skeleton is meant to replace? I would expect 2 different props.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't we mixing aesthetic considerations with the kind of component that the skeleton is meant to replace?

I'm not sure this is related to the change because we already have similar variants like the circle that does the same thing.

I would expect 2 different props.

I didn't follow you, which two props do you expect? 🤔

@soullivaneuh
Copy link
Author

when their designer wants to diverge from the default look.

I do not really agree with that, this changes is not diverging from the default look to me.

This rounded variant is introduced here to match the already existing similar, like for the avatar: https://mui.com/material-ui/react-avatar/#variants

This is also why I use theme.shape.borderRadius as reference: https://github.com/mui/material-ui/pull/33044/files#diff-772a1a6c6b82fcb6b5bee1c620c5e856d7eb3bc09ded68930028cee8ad55be31R102

@mnajdova mnajdova changed the title feat(skeleton): rounded variant [Skeleton]: Add rounded variant Jul 12, 2022
@mnajdova mnajdova changed the title [Skeleton]: Add rounded variant [Skeleton] Add rounded variant Jul 12, 2022
Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@soullivaneuh thanks! Please update to latest master, so we can merge it.

@@ -37,7 +37,7 @@ For instance:

## Variants

The component supports 3 shape variants.
The component supports 4 shape variants.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The component supports 4 shape variants.
The component supports 4 shape variants:
- `text`: represents a single line of text (you can change the height via font size).
- `circular`, `rectangular`, and `rounded`: provide only a border radius to let you take control of the size of the skeleton.

Copy link
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -7,7 +7,8 @@ export default function Variants() {
<Stack spacing={1}>
<Skeleton variant="text" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<Skeleton variant="text" />
<Skeleton variant="text" sx={{ fontSize: '1rem' }} />

@@ -1,3 +1,4 @@
<Skeleton variant="text" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<Skeleton variant="text" />
<Skeleton variant="text" sx={{ fontSize: '1rem' }} />

@@ -98,6 +98,9 @@ const SkeletonRoot = styled('span', {
...(ownerState.variant === 'circular' && {
borderRadius: '50%',
}),
...(ownerState.variant === 'rounded' && {
borderRadius: theme.shape.borderRadius,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
borderRadius: theme.shape.borderRadius,
borderRadius: (theme.vars || theme).shape.borderRadius,

@siriwatknp
Copy link
Member

@soullivaneuh Not sure what's wrong but I could not commit the suggestions or push to your branch. cc @mnajdova

@mnajdova mnajdova added new feature New feature or request component: skeleton This is the name of the generic UI component, not the React module! labels Jul 18, 2022
@mnajdova
Copy link
Member

@soullivaneuh Not sure what's wrong but I could not commit the suggestions or push to your branch.

Hmm interesting, I've just tried and hit the same problem. Let's wait for @soullivaneuh's response. Maybe doing git clean and updating to latest master could fix the issue.

@mnajdova
Copy link
Member

Looks like @soullivaneuh is not active anymore, so I guess we will need to re-create a new branch with the changes so that we can commit the suggestions.

@siriwatknp
Copy link
Member

Sure, I can take care of it.

@siriwatknp siriwatknp mentioned this pull request Jul 29, 2022
1 task
@siriwatknp
Copy link
Member

closed in favor of #33687

@siriwatknp siriwatknp closed this Jul 29, 2022
@soullivaneuh soullivaneuh deleted the skeleton/rounded-variant branch August 23, 2022 08:42
@soullivaneuh
Copy link
Author

Sorry for the miss, glad to see this finally merge! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: skeleton This is the name of the generic UI component, not the React module! new feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Skeleton: rounded variant
5 participants