-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
bug: no-padding / no-margin not working on toolbar #8765
Comments
This also effects other areas like: <ion-card no-margin> Which has no effect once rendered because <ion-card no-margin class="list-ios"> margin: -1px 0 32px 0; Maybe these utilities should use |
@tlaverdure Yeah I was trying to avoid using |
@brandyscarney that is exactly what I was thinking, since it's implicitly declared it shouldn't hurt. |
@brandyscarney To avoid the use of important, would it be possible to just extend a base component and go back to the way styles were applied in beta 11. You could then have something like ion-card-md which would always have the md styles applied to it. I don't think this would add much to package size or complexity of the frameworks css. It would make overriding easy again and would mean I don't have to rewrite at lot of the selectors I had written for beta 11 😝 |
I found another solution. If all of the utility variables are places inside .ion-page it causes there selectors to have higher priority.
This also works on the page level
I will use the for now, but it does some extra work and isn't very apparent. If possible it would be nice to have a system that makes it easier to override styles without having to add an id or class to every element of a certain type (like ion-card) |
Another possible quick fix for the utilities is to rearrange the current selectors. Moving I would put up a pull request for this, but unfortunately my company doesn't let me contribute to open source. Great framework though. It's made our app development so fast! |
Thanks for the ideas @j3gb3rt! We're going to be discussing this more in depth and try to come up with a solution that works for everyone. 😄 |
@biesbjerg you could fix your issue by being more specific. e.g. change
|
So we decided to go with a solution similar to the one proposed by @j3gb3rt. I've prefixed the utility attributes with
and that will set the default padding added by using @biesbjerg Your issue doesn't seem to be caused by the utility attributes since you are setting the padding in the CSS directly (please correct me if I'm misunderstanding). The components now have a class added without the mode attached that can be used to style the component for all modes. So you could do something like this:
This will be in the
Thanks! :) |
If the attribute is added to a toolbar the padding on the toolbar takes precedence:
A simple solution to this is moving the styles to the end of the css so they take precedence over toolbar, but this could always get messed up again in the future, and it probably doesn't work on some components.
This is just a thought, but what if we add a utility mixin that automatically added all of these attributes to the main component class. So it would be like:
and then the mixin could be:
None of the above was tested so it could not be functional currently.
What do you think @manucorporat @adamdbradley @bensperry ?
The text was updated successfully, but these errors were encountered: