Unverified Commit 088f374c authored by 子慕大诗人's avatar 子慕大诗人 Committed by GitHub

Fix react-dev-overlay rem style conflict (#17723)

### Don‘t use rem in react-dev-overlay.
If we create a nextjs project and use css rem. We could set the html fontsize to any 'px'.  The react-dev-overlay components styles will be affected so that the style becomes larger or smaller.

![image](https://user-images.githubusercontent.com/10840654/95490394-c189a800-09ca-11eb-816a-8bcaf6bcb657.png)
## So i suggest change the rem to px.
## After modification:
![image](https://user-images.githubusercontent.com/10840654/95490703-2e9d3d80-09cb-11eb-8369-7ec650fa6c52.png)

---

Fixes #18680
parent e4a74465
...@@ -44,7 +44,7 @@ const styles = css` ...@@ -44,7 +44,7 @@ const styles = css`
[data-nextjs-codeframe] > p > svg { [data-nextjs-codeframe] > p > svg {
width: auto; width: auto;
height: 1em; height: 1em;
margin-left: 0.5rem; margin-left: 8px;
} }
` `
......
...@@ -12,7 +12,7 @@ const styles = css` ...@@ -12,7 +12,7 @@ const styles = css`
border-radius: var(--size-gap); border-radius: var(--size-gap);
box-shadow: 0 var(--size-gap-half) var(--size-gap-double) box-shadow: 0 var(--size-gap-half) var(--size-gap-double)
rgba(0, 0, 0, 0.25); rgba(0, 0, 0, 0.25);
max-height: calc(100% - 3.5rem); max-height: calc(100% - 56px);
overflow-y: hidden; overflow-y: hidden;
} }
......
...@@ -17,7 +17,7 @@ const styles = css` ...@@ -17,7 +17,7 @@ const styles = css`
} }
[data-nextjs-toast-wrapper] { [data-nextjs-toast-wrapper] {
padding: 1rem; padding: 16px;
border-radius: var(--size-gap-half); border-radius: var(--size-gap-half);
font-weight: 500; font-weight: 500;
color: var(--color-ansi-bright-white); color: var(--color-ansi-bright-white);
......
...@@ -7,15 +7,15 @@ export function Base() { ...@@ -7,15 +7,15 @@ export function Base() {
dangerouslySetInnerHTML={{ dangerouslySetInnerHTML={{
__html: css` __html: css`
:host { :host {
--size-gap-half: 0.25rem; /* 4px */ --size-gap-half: 4px;
--size-gap: 0.5rem; /* 8px */ --size-gap: 8px;
--size-gap-double: 1rem; /* 16px */ --size-gap-double: 16px;
--size-gap-quad: 2rem; /* 32px */ --size-gap-quad: 32px;
--size-font-small: 0.875rem; /* 14px */ --size-font-small: 14px;
--size-font: 1rem; /* 16px */ --size-font: 16px;
--size-font-big: 1.25rem; /* 20px */ --size-font-big: 20px;
--size-font-bigger: 1.5rem; /* 24px */ --size-font-bigger: 24px;
--color-accents-1: #808080; --color-accents-1: #808080;
--color-accents-2: #222222; --color-accents-2: #222222;
...@@ -62,22 +62,22 @@ export function Base() { ...@@ -62,22 +62,22 @@ export function Base() {
} }
h1 { h1 {
font-size: 2.5rem; font-size: 40px;
} }
h2 { h2 {
font-size: 2rem; font-size: 32px;
} }
h3 { h3 {
font-size: 1.75rem; font-size: 28px;
} }
h4 { h4 {
font-size: 1.5rem; font-size: 24px;
} }
h5 { h5 {
font-size: 1.25rem; font-size: 20px;
} }
h6 { h6 {
font-size: 1rem; font-size: 16px;
} }
`, `,
}} }}
......
...@@ -52,7 +52,7 @@ export function CssReset() { ...@@ -52,7 +52,7 @@ export function CssReset() {
'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif,
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
'Noto Color Emoji'; 'Noto Color Emoji';
font-size: 1rem; font-size: 16px;
font-weight: 400; font-weight: 400;
line-height: 1.5; line-height: 1.5;
color: #212529; color: #212529;
...@@ -77,12 +77,12 @@ export function CssReset() { ...@@ -77,12 +77,12 @@ export function CssReset() {
h5, h5,
h6 { h6 {
margin-top: 0; margin-top: 0;
margin-bottom: 0.5rem; margin-bottom: 8px;
} }
p { p {
margin-top: 0; margin-top: 0;
margin-bottom: 1rem; margin-bottom: 16px;
} }
abbr[title], abbr[title],
...@@ -97,7 +97,7 @@ export function CssReset() { ...@@ -97,7 +97,7 @@ export function CssReset() {
} }
address { address {
margin-bottom: 1rem; margin-bottom: 16px;
font-style: normal; font-style: normal;
line-height: inherit; line-height: inherit;
} }
...@@ -106,7 +106,7 @@ export function CssReset() { ...@@ -106,7 +106,7 @@ export function CssReset() {
ul, ul,
dl { dl {
margin-top: 0; margin-top: 0;
margin-bottom: 1rem; margin-bottom: 16px;
} }
ol ol, ol ol,
...@@ -121,12 +121,12 @@ export function CssReset() { ...@@ -121,12 +121,12 @@ export function CssReset() {
} }
dd { dd {
margin-bottom: 0.5rem; margin-bottom: 8px;
margin-left: 0; margin-left: 0;
} }
blockquote { blockquote {
margin: 0 0 1rem; margin: 0 0 16px;
} }
b, b,
...@@ -186,12 +186,12 @@ export function CssReset() { ...@@ -186,12 +186,12 @@ export function CssReset() {
pre { pre {
margin-top: 0; margin-top: 0;
margin-bottom: 1rem; margin-bottom: 16px;
overflow: auto; overflow: auto;
} }
figure { figure {
margin: 0 0 1rem; margin: 0 0 16px;
} }
img { img {
...@@ -209,8 +209,8 @@ export function CssReset() { ...@@ -209,8 +209,8 @@ export function CssReset() {
} }
caption { caption {
padding-top: 0.75rem; padding-top: 12px;
padding-bottom: 0.75rem; padding-bottom: 12px;
color: #6c757d; color: #6c757d;
text-align: left; text-align: left;
caption-side: bottom; caption-side: bottom;
...@@ -222,7 +222,7 @@ export function CssReset() { ...@@ -222,7 +222,7 @@ export function CssReset() {
label { label {
display: inline-block; display: inline-block;
margin-bottom: 0.5rem; margin-bottom: 8px;
} }
button { button {
...@@ -311,8 +311,8 @@ export function CssReset() { ...@@ -311,8 +311,8 @@ export function CssReset() {
width: 100%; width: 100%;
max-width: 100%; max-width: 100%;
padding: 0; padding: 0;
margin-bottom: 0.5rem; margin-bottom: 8px;
font-size: 1.5rem; font-size: 24px;
line-height: inherit; line-height: inherit;
color: inherit; color: inherit;
white-space: normal; white-space: normal;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment