documentationWrapper.tsx 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. import styled from '@emotion/styled';
  2. import {Alert, alertStyles} from 'sentry/components/alert';
  3. import {space} from 'sentry/styles/space';
  4. type AlertType = React.ComponentProps<typeof Alert>['type'];
  5. const getAlertSelector = (type: AlertType) =>
  6. type === 'muted' ? null : `.alert[level="${type}"], .alert-${type}`;
  7. export const DocumentationWrapper = styled('div')`
  8. /* Size of the new footer + 16px */
  9. padding-bottom: calc(72px + ${space(2)});
  10. h2 {
  11. font-size: 1.375rem;
  12. }
  13. h3 {
  14. font-size: 1.25rem;
  15. }
  16. h1,
  17. h2,
  18. h3,
  19. h4,
  20. h5,
  21. h6,
  22. p,
  23. ul,
  24. ol,
  25. li {
  26. margin-top: 0.5em;
  27. margin-bottom: 0.5em;
  28. }
  29. blockquote,
  30. hr,
  31. pre,
  32. div[data-language] {
  33. margin-top: 1em;
  34. margin-bottom: 1em;
  35. }
  36. blockquote {
  37. padding: ${space(1.5)} ${space(2)};
  38. ${p => alertStyles({theme: p.theme, type: 'info'})}
  39. }
  40. blockquote > * {
  41. margin: 0;
  42. }
  43. .gatsby-highlight:last-child {
  44. margin-bottom: 0;
  45. }
  46. hr {
  47. border-color: ${p => p.theme.border};
  48. }
  49. code {
  50. color: ${p => p.theme.pink400};
  51. }
  52. .alert {
  53. border-radius: ${p => p.theme.borderRadius};
  54. }
  55. /**
  56. * XXX(epurkhiser): This comes from the doc styles and avoids bottom margin issues in alerts
  57. */
  58. .content-flush-bottom *:last-child {
  59. margin-bottom: 0;
  60. }
  61. ${p =>
  62. Object.keys(p.theme.alert).map(
  63. type => `
  64. ${getAlertSelector(type as AlertType)} {
  65. ${alertStyles({theme: p.theme, type: type as AlertType})};
  66. display: block;
  67. }
  68. `
  69. )}
  70. `;