-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[withSwitchLabel] labelClassName vs className (LabelSwitch, LabelRadio, LabelCheckbox) #6746
Comments
Agreed, we have been discussing perhaps a different approach to complex components (perhaps under @nathanmarks @oliviertassinari - thoughts? related: #6711 |
@Alxandr Thanks for trying out and sharing your experience with the My thoughts on this. I see two issues. Predictibility
A very specific variation for a one-time problem/situationWe don't provide a After thinking about it, I think that exposing a |
Slightly related: nathanmarks/jss-theme-reactor#42 That's another problematic control I found btw. Using Tabs inside an AppBar required this mess: const styleSheet = createStyleSheet('RootAppBar', () => ({
tabs: {
height: '100%',
'& > div': {
height: '100%',
'& > div': {
height: '100%',
'& > div:first-child': {
height: '100%',
alignItems: 'center',
},
},
},
},
})); I can make another issue about the Tabs inside AppBar if wanted. |
@Alxandr The Tabs inside an AppBar is an interesting issue! I have faced it yesterday. I have been simply applying the height of the AppBar to the |
Back to this issue, I think that the best other alternative is exposing a |
I'm fine with both solutions (the current one and the proposed one). Let me know what you think :). |
Any objection to expose a |
No objections here |
I'm on it, let's follow rebass API, it's going to be a breaking change through. |
I'm writing an app using the
next
release ofmaterial-ui
onnpm
, and for the most part it's really great. However I ran into one thing that puzzled me greatly today with theLabelSwitch
. I wanted to move it up to the upper right corner, so I created a class witch hadposition: absolute; top: 5; right: 5
and used<LabelSwitch className='topRight' />
, however only the switch was moved to the top right. I looked at the source and quickly discovered why (and how to fix it) usinglabelClassName
, but I would argue that the outermost component should probably be styled usingclassName
, and that you could rather make a differentswitchClassName
which targets the switch itself. All in all it's not the biggest of problems, I just feel that if you try to move a component you expect the entire component to move, not just a subcomponent.The text was updated successfully, but these errors were encountered: