File size: 1,808 Bytes
2409829
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
pre {
	display: flex;
	max-width: 100%;
	color: var(--color-fog);
	// This zero transform sets this element as the root for `position: fixed`
	transform: translate(0);

	// Color overrides
	&,
	&.z-code {
		background: var(--color-navy);

		.z-path {
			color: #679f70;

			span {
				color: #e6e1dc;
			}
		}
	}

	// Container for the element (span or table) containing the lines of code
	code {
		background: initial;
		color: inherit;
		display: block;
		overflow-x: auto;
		padding: 20px;
		width: 0;
		flex: 1 1 auto;
	}

	// Language name in top right corner
	&[data-lang] {
		padding-top: 28px;

		&::before {
			content: attr(data-lang);
			color: rgba(var(--color-seaside-rgb), 0.5);
			text-transform: lowercase;
			font-family: "Inter Variable", sans-serif;
			font-size: 0.75em;
			font-weight: 700;
			font-style: italic;
			-webkit-user-select: none;
			user-select: none;
			pointer-events: none;
			position: fixed;
			top: 0;
			line-height: 28px;
			display: block;
			width: 100%;
			text-indent: 20px;
			background: rgba(0, 0, 0, 0.25);

			&[data-lang="sh"] {
				content: "Shell";
			}

			&[data-lang="rs"] {
				content: "Rust";
			}

			&[data-lang="js"] {
				content: "JavaScript";
			}

			&[data-lang="ts"] {
				content: "TypeScript";
			}
		}
	}

	// Code blocks with line numbers
	&[data-linenos] table {
		border-spacing: 0;
		margin: -20px;

		tr {
			&:first-child td {
				padding-top: 20px;
			}

			&:last-child td {
				padding-bottom: 20px;
			}

			td {
				&:first-child {
					padding-left: 20px;
					padding-right: 10px;
					-webkit-user-select: none;
					user-select: none;
					vertical-align: top;
					text-align: right;
					background: rgba(0, 0, 0, 0.25);
				}

				&:last-child {
					padding-left: 10px;
					padding-right: 20px;
				}
			}
		}
	}
}