You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

code-docs.tsx 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. import styled from "styles"
  2. export default function CodeDocs({ isHidden }: { isHidden: boolean }) {
  3. return (
  4. <StyledDocs isHidden={isHidden}>
  5. <h2>Docs</h2>
  6. </StyledDocs>
  7. )
  8. }
  9. const StyledDocs = styled("div", {
  10. position: "absolute",
  11. backgroundColor: "$panel",
  12. top: 0,
  13. left: 0,
  14. width: "100%",
  15. height: "100%",
  16. padding: 16,
  17. font: "$docs",
  18. overflowY: "scroll",
  19. userSelect: "none",
  20. paddingBottom: 64,
  21. variants: {
  22. isHidden: {
  23. true: {
  24. visibility: "hidden",
  25. },
  26. false: {
  27. visibility: "visible",
  28. },
  29. },
  30. },
  31. "& ol": {},
  32. "& li": {
  33. marginTop: 8,
  34. marginBottom: 4,
  35. },
  36. "& code": {
  37. font: "$mono",
  38. },
  39. "& hr": {
  40. margin: "32px 0",
  41. borderColor: "$muted",
  42. },
  43. "& h2": {
  44. margin: "24px 0px",
  45. },
  46. "& h3": {
  47. fontSize: 20,
  48. margin: "48px 0px 32px 0px",
  49. },
  50. "& h3 > code": {
  51. fontWeight: 600,
  52. font: "$monoheading",
  53. },
  54. "& h4": {
  55. margin: "32px 0px 0px 0px",
  56. },
  57. "& h4 > code": {
  58. font: "$monoheading",
  59. fontSize: 16,
  60. userSelect: "all",
  61. },
  62. "& h4 > code > i": {
  63. fontSize: 14,
  64. color: "$muted",
  65. },
  66. "& pre": {
  67. backgroundColor: "$bounds_bg",
  68. padding: 16,
  69. borderRadius: 4,
  70. userSelect: "all",
  71. margin: "24px 0",
  72. },
  73. "& p > code, blockquote > code": {
  74. backgroundColor: "$bounds_bg",
  75. padding: "2px 4px",
  76. borderRadius: 2,
  77. color: "$code",
  78. },
  79. "& blockquote": {
  80. backgroundColor: "rgba(144, 144, 144, .05)",
  81. padding: 12,
  82. margin: "20px 0",
  83. borderRadius: 8,
  84. },
  85. })