File size: 1,013 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import { Box, type BoxProps } from "@chakra-ui/react"

export const Pre = (props: BoxProps) => {
  return (
    <Box
      as="pre"
      {...props}
      css={{
        backgroundColor: "bg.muted",
        shadow: "inset",
        marginTop: "1.6em",
        marginBottom: "1.6em",
        borderRadius: "md",
        fontSize: "0.9em",
        paddingBlock: "2em",
        paddingInline: "2em",
        overflowX: "auto",
        fontWeight: "400",
        "& code": {
          bg: "transparent",
          fontSize: "inherit",
          letterSpacing: "inherit",
          borderWidth: "inherit",
          padding: "0",
        },
      }}
    />
  )
}

export const Code = (props: BoxProps) => {
  return (
    <Box
      as="code"
      {...props}
      css={{
        fontSize: "0.8em",
        letterSpacing: "-0.01em",
        borderRadius: "md",
        borderWidth: "0.5px",
        bg: "bg.muted",
        color: "fg",
        whiteSpace: "pre",
        padding: "0.1em 0.4em",
      }}
    />
  )
}