-
-
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
[docs] Fix Safari code font size #34859
[docs] Fix Safari code font size #34859
Conversation
|
|
||
code[class*='language-'] { | ||
code[class*='language-'], | ||
pre[class*='language-'] { |
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 have synced the top of this CSS file with https://unpkg.com/prismjs/themes/prism-okaidia.css. I have also commented what is not necessary.
// inline code | ||
'& code': { | ||
// inline code block | ||
'& :not(pre) > code': { |
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 use :not(pre)
in the selector to avoid the need to reset the styles for code blocks. This selector more accurately selects inline code and ONLY. For example, it matches 1. but doesn't 2.
- A
foo
B
<Foo />
1f8a463
to
498345b
Compare
fontFamily: 'inherit', | ||
fontSize: '0.813rem', | ||
fontSize: theme.typography.pxToRem(13), |
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.
The correct API
.token.comment, | ||
.token.prolog, | ||
.token.doctype, | ||
.token.cdata { | ||
color: slategray; | ||
color: #8292a2; |
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.
|
||
.token.punctuation { | ||
color: #f8f8f2; | ||
} | ||
|
||
.namespace { | ||
.token.namespace { |
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.
7b1900a
to
a3e9f19
Compare
300b89e
to
56ee07a
Compare
ff7ab46
to
524075d
Compare
'& pre': { | ||
fontSize: theme.typography.pxToRem(16), | ||
}, |
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.
This has no impacts, e.g. https://mui.com/blog/date-pickers-stable-v5/#integrated-localization. It's dead code.
There are many changes unrelated to the Safari code font size in this PR. Could you either split it into multiple PRs or summarize all the changes in the description and rename the PR to better reflect what it's about? |
@michaldudak I think that we could create about 10 PRs out of this one, which more or less matches each of the line comments. |
IMO it's important to have a description matching the content of the PR. When I do |
dc5fe89
to
b94554f
Compare
b94554f
to
1a7686f
Compare
@michaldudak Done, I have isolated the changes to different PRs. |
// Reset for Safari | ||
// https://github.com/necolas/normalize.css/blob/master/normalize.css#L102 | ||
fontSize: '1em', |
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.
The fix for Safari font size is to not apply the custom font size on the <code>
but on the <pre>
element.
The fix relies on https://github.com/necolas/normalize.css/blob/master/normalize.css#L102
Before
https://6357aef90039260008eccf21--material-ui-docs.netlify.app/material-ui/react-skeleton/#usage
After
https://deploy-preview-34859--material-ui.netlify.app/material-ui/react-skeleton/#usage
Why work on this?
Because iOS & blog posts 🙈: