previewGlobalStyles.tsx 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. import {css, Global} from '@emotion/react';
  2. import {Theme} from 'app/utils/theme';
  3. const styles = (theme: Theme) => css`
  4. body {
  5. font-family: ${theme.text.family};
  6. font-size: ${theme.fontSizeLarge};
  7. color: ${theme.gray500};
  8. }
  9. div,
  10. p,
  11. a,
  12. span,
  13. button {
  14. font-family: ${theme.text.family};
  15. font-size: 1em;
  16. color: ${theme.gray500};
  17. }
  18. .sbdocs.sbdocs-p,
  19. .sbdocs.sbdocs-li {
  20. font-family: ${theme.text.family};
  21. font-size: 1em;
  22. color: ${theme.gray500};
  23. }
  24. .sbdocs.sbdocs-wrapper code {
  25. font-family: ${theme.text.familyMono};
  26. font-size: 0.875em;
  27. padding: 0.125em 0.5em;
  28. color: ${theme.gray500};
  29. }
  30. .sbdocs.sbdocs-h1,
  31. .sbdocs.sbdocs-h2,
  32. .sbdocs.sbdocs-h3,
  33. .sbdocs.sbdocs-h4,
  34. .sbdocs.sbdocs-h5,
  35. .sbdocs.sbdocs-h6 {
  36. font-family: ${theme.text.family};
  37. font-weight: 600;
  38. color: ${theme.gray500};
  39. }
  40. .sbdocs.sbdocs-h1 {
  41. font-size: 2.25em;
  42. letter-spacing: -0.02em;
  43. margin-top: 0.4em;
  44. }
  45. .sbdocs.sbdocs-h2,
  46. .sbdocs.sbdocs-h2:first-of-type {
  47. font-size: 1.875em;
  48. letter-spacing: -0.01em;
  49. margin-top: 1em;
  50. }
  51. .sbdocs.sbdocs-h3,
  52. .sbdocs.sbdocs-h3:first-of-type {
  53. font-size: 1.625em;
  54. letter-spacing: -0.008em;
  55. margin-top: 1em;
  56. }
  57. .sbdocs.sbdocs-h4,
  58. .sbdocs.sbdocs-h4:first-of-type {
  59. font-size: 1.375em;
  60. margin-top: 1em;
  61. }
  62. .sbdocs.sbdocs-h5,
  63. .sbdocs.sbdocs-h5:first-of-type {
  64. font-size: 1.25em;
  65. margin-top: 1em;
  66. }
  67. .sbdocs.sbdocs-h6,
  68. .sbdocs.sbdocs-h6:first-of-type {
  69. font-size: 1.125em;
  70. margin-top: 1em;
  71. }
  72. .sbdocs.sbdocs-content {
  73. max-width: 48em;
  74. }
  75. `;
  76. const PreviewGlobalStyles = ({theme}: {theme: Theme}) => (
  77. <Global styles={styles(theme)} />
  78. );
  79. export default PreviewGlobalStyles;