global.ts 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. import theme from './theme'
  2. import css from 'styled-jsx/css'
  3. const GlobalStyle = css.global`
  4. /* normalize.css is imported in meta.js */
  5. /*@import url('https://fonts.googleapis.com/css?family=Roboto+Mono:300|Roboto:300,900&display=swap');*/
  6. @import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@700&family=Open+Sans&family=Source+Code+Pro&display=swap');
  7. /* Use border-box sizing instead of context-box.
  8. This includes border and padding in the calculation.
  9. Also define a default font. */
  10. html {
  11. box-sizing: border-box;
  12. font-family: 'Open Sans', sans-serif;
  13. font-size: 16px;
  14. font-weight: 400;
  15. }
  16. *,
  17. *::before,
  18. *::after {
  19. box-sizing: inherit;
  20. }
  21. #__next {
  22. display: grid;
  23. grid-template-areas:
  24. 'header'
  25. 'main'
  26. 'footer';
  27. grid-template-rows: auto 1fr minmax(75px, auto);
  28. min-height: 100vh;
  29. background: ${theme.colors.background};
  30. color: ${theme.colors.color};
  31. box-shadow: ${theme.bs};
  32. }
  33. header {
  34. grid-area: header;
  35. }
  36. main {
  37. grid-area: main;
  38. }
  39. footer {
  40. grid-area: footer;
  41. }
  42. /* Use bold font for headers */
  43. h1,
  44. h2,
  45. h3,
  46. h4,
  47. h5,
  48. h6,
  49. th,
  50. legend {
  51. font-family: 'Exo 2', sans-serif;
  52. font-weight: 700;
  53. }
  54. /* Use monospace font for pre */
  55. pre {
  56. font-family: 'Source Code Pro', monospace;
  57. }
  58. form input,
  59. form select,
  60. form textbox {
  61. display: block;
  62. width: 100%;
  63. margin: 0.3em auto;
  64. padding: 0.3em;
  65. border: 2px solid ${theme.colors.formBackground}00;
  66. color: ${theme.colors.formColor};
  67. background-color: ${theme.colors.formBackground}22;
  68. transition: all 250ms ease-in-out;
  69. }
  70. form input:focus,
  71. form select:focus,
  72. form textbox:focus {
  73. color: ${theme.colors.formHighlight};
  74. background-color: ${theme.colors.formHighlightBackground}22;
  75. border-bottom: 2px solid ${theme.colors.formHighlightBackground}22;
  76. }
  77. form input.error,
  78. form select.error,
  79. form textbox.error {
  80. color: ${theme.colors.formError};
  81. background-color: ${theme.colors.formErrorBackground}22;
  82. border-bottom: 2px solid ${theme.colors.formErrorBackground}22;
  83. }
  84. button {
  85. display: block;
  86. margin: 0.8em auto;
  87. padding: 0.5em 1em;
  88. border: none;
  89. background-color: ${theme.colors.buttonBackground};
  90. color: ${theme.colors.button};
  91. }
  92. form fieldset {
  93. border: none;
  94. margin: none;
  95. padding: 1em 0.3em;
  96. background: ${theme.colors.background};
  97. box-shadow: ${theme.bsSmall};
  98. }
  99. form fieldset legend {
  100. font-size: 120%;
  101. padding: 0.5em;
  102. box-shadow: ${theme.bsSmall};
  103. }
  104. @media (min-width: ${theme.midsize}) {
  105. fieldset {
  106. padding: 2em 3em;
  107. }
  108. }
  109. `
  110. export default GlobalStyle