-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[core] Remove usage of theme.spacing.unit #12022
[core] Remove usage of theme.spacing.unit #12022
Conversation
e248ef7
to
254208a
Compare
254208a
to
56be16b
Compare
@@ -83,11 +83,11 @@ const styles = theme => ({ | |||
fontSize: 16, | |||
color: theme.palette.text.primary, | |||
'& .anchor-link': { | |||
marginTop: -theme.spacing.unit * 12, // Offset for the anchor. | |||
marginTop: -8 * 12, // Offset for the anchor. |
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.
Even though it's a bit more work, I would just make this -96
, and so on.
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.
Alright
56be16b
to
155b7ab
Compare
So you encourage people to not use |
@vuhrmeister No, by keeping it in the demos, we are still encouraging people to use it. I'm using it everywhere too on the product I'm working on. |
This change comes from an internal discussion with @mbrookes. The usage of
theme.spacing.unit
was only here to illustrate the link with the 8dp spacing unit. In practice, we do not expect people to change the value. By doing this change, we make the style generation lighter (-0.3 Kb gzipped).P.S. I have only changed the source code, not the demos.
P.S. I wish we had a performance benchmark to see the implications of such change.