page.js 2.1 KB

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