simplified global style
This commit is contained in:
parent
69071a37ff
commit
3aa52e9315
1 changed files with 40 additions and 27 deletions
|
@ -187,6 +187,13 @@ const blockquoteCSS = css`
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
|
const hrCSS = css`
|
||||||
|
hr {
|
||||||
|
border: 0;
|
||||||
|
border-bottom: 1px solid;
|
||||||
|
}
|
||||||
|
`
|
||||||
|
|
||||||
const headerCSS = css`
|
const headerCSS = css`
|
||||||
/* intentionally left out h1 */
|
/* intentionally left out h1 */
|
||||||
|
|
||||||
|
@ -223,22 +230,7 @@ const katexCSS = css`
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
/**
|
const globalCSS = css`
|
||||||
* Theme that will be used throughout the website
|
|
||||||
* wrapping it using css because prettier extension does not work well with styled-components
|
|
||||||
* https://github.com/styled-components/vscode-styled-components/issues/175
|
|
||||||
*/
|
|
||||||
const globalStyle = css`
|
|
||||||
${anchorCSS}
|
|
||||||
${scrollbarCSS}
|
|
||||||
${codeCSS}
|
|
||||||
${kbdCSS}
|
|
||||||
${tableCSS}
|
|
||||||
${blockquoteCSS}
|
|
||||||
${headerCSS}
|
|
||||||
${markCSS}
|
|
||||||
${katexCSS}
|
|
||||||
|
|
||||||
body {
|
body {
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
|
@ -247,11 +239,27 @@ const globalStyle = css`
|
||||||
html,
|
html,
|
||||||
body,
|
body,
|
||||||
#root {
|
#root {
|
||||||
|
/* size */
|
||||||
|
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
||||||
|
/* style */
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: column;
|
flex-flow: column;
|
||||||
|
|
||||||
|
/* text */
|
||||||
|
|
||||||
line-height: 2rem;
|
line-height: 2rem;
|
||||||
|
font-size: ${theming.size.medium};
|
||||||
|
font-family: ${theming.font.regular};
|
||||||
|
font-weight: 400;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
text-rendering: optimizeLegibility;
|
||||||
|
|
||||||
|
/* color */
|
||||||
|
|
||||||
background-color: ${(props) =>
|
background-color: ${(props) =>
|
||||||
theming.theme(props.theme.currentTheme, {
|
theming.theme(props.theme.currentTheme, {
|
||||||
light: theming.light.backgroundColor1,
|
light: theming.light.backgroundColor1,
|
||||||
|
@ -262,16 +270,6 @@ const globalStyle = css`
|
||||||
light: theming.light.color1,
|
light: theming.light.color1,
|
||||||
dark: theming.dark.color1,
|
dark: theming.dark.color1,
|
||||||
})};
|
})};
|
||||||
font-size: ${theming.size.medium};
|
|
||||||
font-family: ${theming.font.regular};
|
|
||||||
font-weight: 400;
|
|
||||||
-webkit-font-smoothing: antialiased;
|
|
||||||
text-rendering: optimizeLegibility;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr {
|
|
||||||
border: 0;
|
|
||||||
border-bottom: 1px solid;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
* {
|
* {
|
||||||
|
@ -280,6 +278,21 @@ const globalStyle = css`
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Theme that will be used throughout the website
|
||||||
|
* prettier extension does not work here
|
||||||
|
* see https://github.com/styled-components/vscode-styled-components/issues/175
|
||||||
|
*/
|
||||||
export default createGlobalStyle`
|
export default createGlobalStyle`
|
||||||
${globalStyle}
|
${anchorCSS}
|
||||||
|
${scrollbarCSS}
|
||||||
|
${codeCSS}
|
||||||
|
${kbdCSS}
|
||||||
|
${tableCSS}
|
||||||
|
${blockquoteCSS}
|
||||||
|
${hrCSS}
|
||||||
|
${headerCSS}
|
||||||
|
${markCSS}
|
||||||
|
${katexCSS}
|
||||||
|
${globalCSS}
|
||||||
`
|
`
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue