Page.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. import styled, { ThemeProvider, createGlobalStyle } from 'styled-components'
  2. import Header from './Header'
  3. import Meta from './Meta'
  4. const theme = {
  5. lightred: '#f0b0b0',
  6. red: '#f03535',
  7. black: '#393939',
  8. grey: '#7f8c8d',
  9. lightgrey: '#95a5a5',
  10. lighterblue: '#d6e4f0',
  11. lightblue: '#b0d3f0',
  12. blue: '#4482c3',
  13. darkblue: '#285680',
  14. darkerblue: '#204567',
  15. offWhite: '#EDEDED',
  16. maxWidth: '1000px',
  17. bs: '0 12px 24px 0 rgba(0,0,0,0.09)',
  18. bsSmall: '0 5px 10px 0 rgba(0,0,0,0.19)'
  19. }
  20. const StyledPage = styled.div`
  21. background: white;
  22. color: ${props => props.theme.black};
  23. `
  24. const Inner = styled.div`
  25. max-width: ${props => props.theme.maxWidth};
  26. margin: 0 auto;
  27. padding: 2rem;
  28. `
  29. const GlobalStyle = createGlobalStyle`
  30. @font-face {
  31. font-family: 'roboto';
  32. src: url('/static/Roboto-Thin.woff2');
  33. }
  34. @font-face {
  35. font-family: 'roboto_mono';
  36. src: url('/static/RobotoMono-Thin.woff2');
  37. }
  38. @font-face {
  39. font-family: 'roboto_black';
  40. src: url('/static/Roboto-Black.woff2');
  41. }
  42. html {
  43. box-sizing: border-box;
  44. font-size: 12px;
  45. }
  46. *, *:before, *:after {
  47. box-sizing: inherit;
  48. }
  49. body {
  50. padding: 0;
  51. margin: 0;
  52. font-size: 1.5rem;
  53. line-height: 2;
  54. font-family: 'roboto', sans-serif;
  55. }
  56. h1 {
  57. font-family: 'roboto_black';
  58. }
  59. h2, h3, h4, h5, h6 {
  60. }
  61. button {
  62. font-family: 'roboto_black';
  63. background: ${props => props.theme.darkblue};
  64. color: ${props => props.theme.lighterblue};
  65. border: 1px solid ${props => props.theme.darkerblue};
  66. padding: 0.3em 1.8em;
  67. cursor: pointer;
  68. box-shadow: ${props => props.theme.bsSmall};
  69. }
  70. input,
  71. textarea {
  72. font-family: 'roboto';
  73. border: 1px solid ${props => props.theme.lightgrey};
  74. padding: 6px;
  75. margin: 0 8px;
  76. }
  77. pre {
  78. font-family: 'roboto_mono';
  79. }
  80. `
  81. class Page extends React.Component {
  82. render () {
  83. return (
  84. <ThemeProvider theme={theme}>
  85. <StyledPage>
  86. <Meta />
  87. <GlobalStyle />
  88. <Header />
  89. <Inner>{this.props.children}</Inner>
  90. </StyledPage>
  91. </ThemeProvider>
  92. )
  93. }
  94. }
  95. export default Page