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
[Badge] Add invisible property #13534
Conversation
6e86b39
to
247f513
Compare
[Badge] Added hide property tests [docs] Added hide property demo
247f513
to
4c75462
Compare
@@ -34,6 +34,7 @@ export const styles = theme => ({ | |||
backgroundColor: theme.palette.color, | |||
color: theme.palette.textColor, | |||
zIndex: 1, // Render the badge on top of potential ripples. | |||
transition: '225ms cubic-bezier(0.4, 0, 0.2, 1)', |
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.
Can we use the transition theme helper?
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 didn't even realise the theme has a transition helper. I'll give this a go 👍
@@ -50,6 +51,14 @@ export const styles = theme => ({ | |||
backgroundColor: theme.palette.error.main, | |||
color: theme.palette.error.contrastText, | |||
}, | |||
/* Styles applied to the badge `span` element if `hide={false}`. */ | |||
shown: { |
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.
Most of the time, we only provide a class rule for the non-default state. I think that we can merge it with root
.
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.
Okay :)
transform: 'scale(1)', | ||
}, | ||
/* Styles applied to the badge `span` element if `hide={true}`. */ | ||
hidden: { |
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.
It would be better to have the class rule match the property name. Let's find another wording that matches this requirement and that can be used as an adjective rather than only a verb.
hidden
is already taken: https://developer.mozilla.org/fr/docs/Web/HTML/Attributs_universels/hidden.hide
is only a verb
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.
cc @mbrookes I'm out of ideas.
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.
Tricky. inactive
, closed
, invisible
?
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.
invisible
sounds good to me.
[Badge] Merged shown class into root class
130524e
to
69dac34
Compare
@oliviertassinari I know this isn’t a Badge specific issue but is there a way to stop the command |
c1cd422
to
4ccbb2d
Compare
[docs] Updated Docs with Badge property change
4ccbb2d
to
270c18a
Compare
@joshwooding Are you on Windows? It can be a bug. |
Yeah, Looks like it I've submitted: #13541 |
@joshwooding You did great here :) |
Fixes #10466