|
28 | 28 | }
|
29 | 29 | }
|
30 | 30 |
|
31 |
| -.code-box pre { |
32 |
| - button { |
33 |
| - border-radius: 0; |
34 |
| - } |
35 |
| -} |
36 |
| - |
37 | 31 | pre.highlight {
|
38 |
| - background: #fff; |
39 |
| - padding: 1em; |
40 |
| - overflow-x: auto; |
41 |
| - border-radius: 10px; |
42 |
| - font-size: 15px; |
| 32 | + background: var(--color-code-background); |
| 33 | + font-size: 14px; |
43 | 34 | line-height: 1.53;
|
| 35 | + overflow-x: auto; |
44 | 36 |
|
45 |
| - .c, |
46 |
| - .cm, |
47 |
| - .cp, |
48 |
| - .c1, |
| 37 | + .c, /* Comment */ |
| 38 | + .cm, /* Comment.Multiline */ |
| 39 | + .cp, /* Comment.Preproc */ |
| 40 | + .c1, /* Comment.Single */ |
49 | 41 | .cs {
|
50 |
| - color: #6e6e6e; |
51 |
| - font-style: italic; |
| 42 | + /* Comment.Special */ |
| 43 | + color: var(--color-syntax-comments); |
52 | 44 | }
|
53 | 45 |
|
54 |
| - .k, |
55 |
| - .kt, |
| 46 | + .k, /* Keyword */ |
| 47 | + .kc, /* Keyword.Constant */ |
| 48 | + .kd, /* Keyword.Declaration */ |
| 49 | + .kp, /* Keyword.Pseudo */ |
56 | 50 | .kr,
|
57 |
| - .kd { |
58 |
| - color: #ad3da4; |
| 51 | + .kt, /* Keyword.Reserved */ |
| 52 | + .nb { |
| 53 | + /* Name.Builtin */ |
| 54 | + color: var(--color-syntax-keywords); |
59 | 55 | }
|
60 | 56 |
|
61 |
| - .s, |
62 |
| - .s1, |
63 |
| - .s2, |
64 |
| - .sd { |
65 |
| - color: #d12f1b; |
| 57 | + .nv, /* Name.Variable */ |
| 58 | + .nf { |
| 59 | + /* Name.Function */ |
| 60 | + color: var(--color-syntax-project-constants); |
66 | 61 | }
|
67 | 62 |
|
68 |
| - .nf { |
69 |
| - color: #703daa; |
| 63 | + .n { |
| 64 | + color: #B181EC; |
70 | 65 | }
|
71 | 66 |
|
72 |
| - .nc, |
73 |
| - .no, |
74 |
| - .nt { |
75 |
| - color: #3b5bdb; |
| 67 | + .o, .p { |
| 68 | + color: var(--color-syntax-brackets-dots); |
| 69 | + } |
| 70 | + |
| 71 | + .s, /* Literal.String */ |
| 72 | + .sb, /* Literal.String.Backtick */ |
| 73 | + .sc, /* Literal.String.Char >> --color-syntax-characters */ |
| 74 | + .sd, /* Literal.String.Doc */ |
| 75 | + .s2, /* Literal.String.Double */ |
| 76 | + .se, /* Literal.String.Escape */ |
| 77 | + .sh, /* Literal.String.Heredoc */ |
| 78 | + .si, /* Literal.String.Interpol */ |
| 79 | + .s1, /* Literal.String.Single */ |
| 80 | + .sx { |
| 81 | + /* Literal.String.Other */ |
| 82 | + color: var(--color-syntax-strings); |
| 83 | + } |
| 84 | + |
| 85 | + .na { |
| 86 | + /* Name.Attribute */ |
| 87 | + color: var(--color-syntax-attributes); |
76 | 88 | }
|
77 | 89 |
|
78 |
| - .nv, |
79 |
| - .vg, |
| 90 | + .nc, /* Name.Class */ |
| 91 | + .ni, /* Name.Entity */ |
| 92 | + .no, /* Name.Constant */ |
| 93 | + .vc, /* Name.Variable.Class */ |
| 94 | + .vg, /* Name.Variable.Global */ |
80 | 95 | .vi {
|
81 |
| - color: #333; |
| 96 | + /* Name.Variable.Instance */ |
| 97 | + color: var(--color-syntax-other-type-names); |
| 98 | + } |
| 99 | + |
| 100 | + .err, /* Error */ |
| 101 | + .gr, /* Generic.Error */ |
| 102 | + .gt, /* Generic.Traceback */ |
| 103 | + .ne { |
| 104 | + /* Name.Exception */ |
| 105 | + color: var(--color-syntax-strings); |
| 106 | + } |
| 107 | + |
| 108 | + .m, /* Literal.Number */ |
| 109 | + .mf, /* Literal.Number.Float */ |
| 110 | + .mh, /* Literal.Number.Hex */ |
| 111 | + .mi, /* Literal.Number.Integer */ |
| 112 | + .il, /* Literal.Number.Integer.Long */ |
| 113 | + .mo { |
| 114 | + /* Literal.Number.Oct */ |
| 115 | + color: var(--color-syntax-numbers); |
| 116 | + } |
| 117 | + |
| 118 | + .ge { |
| 119 | + /* Generic.Emph */ |
| 120 | + font-style: italic; |
| 121 | + } |
| 122 | + |
| 123 | + .nt { |
| 124 | + /* Name.Tag */ |
| 125 | + color: var(--color-syntax-characters); |
| 126 | + } |
| 127 | + |
| 128 | + .gd, /* Generic.Deleted */ |
| 129 | + .gd .x { |
| 130 | + /* Generic.Deleted.Specific */ |
| 131 | + color: var(--color-syntax-plain-text); |
| 132 | + background-color: var(--color-fill-red-secondary); |
| 133 | + } |
| 134 | + |
| 135 | + .gi, /* Generic.Inserted */ |
| 136 | + .gi .x { |
| 137 | + /* Generic.Inserted.Specific */ |
| 138 | + color: var(--color-syntax-plain-text); |
| 139 | + background-color: var(--color-fill-green-secondary); |
| 140 | + } |
| 141 | + |
| 142 | + .gh, /* Generic.Heading */ |
| 143 | + .bp, /* Name.Builtin.Pseudo */ |
| 144 | + .go, /* Generic.Output */ |
| 145 | + .gp, /* Generic.Prompt */ |
| 146 | + .gu, /* Generic.Subheading */ |
| 147 | + .w { |
| 148 | + /* Text.Whitespace */ |
| 149 | + color: var(--color-syntax-comments); |
| 150 | + } |
| 151 | + |
| 152 | + .nn { |
| 153 | + /* Name.Namespace */ |
| 154 | + color: var(--color-syntax-other-declarations); |
82 | 155 | }
|
83 | 156 |
|
84 |
| - .m, |
85 |
| - .mi, |
86 |
| - .mf { |
87 |
| - color: #098658; |
| 157 | + .sr { |
| 158 | + /* Literal.String.Regex */ |
| 159 | + color: var(--color-figure-green); |
88 | 160 | }
|
89 | 161 |
|
90 |
| - .o { |
91 |
| - color: #000; |
| 162 | + .ss { |
| 163 | + /* Literal.String.Symbol */ |
| 164 | + color: var(--color-syntax-heading); |
92 | 165 | }
|
93 | 166 |
|
94 |
| - .err { |
95 |
| - background-color: #ffeef0; |
96 |
| - color: #d73a49; |
| 167 | + /* Make prompts non-selectable, to make it easy to copy and paste */ |
| 168 | + .gp { |
| 169 | + -webkit-user-select: none; |
| 170 | + user-select: none; |
| 171 | + |
| 172 | + & + .w { |
| 173 | + -webkit-user-select: none; |
| 174 | + user-select: none; |
| 175 | + } |
97 | 176 | }
|
98 | 177 | }
|
| 178 | + |
| 179 | +.language-console { |
| 180 | + color: var(--color-syntax-plain-text); |
| 181 | +} |
| 182 | + |
| 183 | +// Explicit syntax highlighting for C++ code blocks: |
| 184 | + |
| 185 | +.language-cpp .cp, |
| 186 | +.language-cpp .kt, |
| 187 | +.language-cpp .nl, |
| 188 | +.language-cpp .o, |
| 189 | +.language-c\+\+ .cp, |
| 190 | +.language-c\+\+ .kt, |
| 191 | +.language-c\+\+ .nl, |
| 192 | +.language-c\+\+ .o { |
| 193 | + color: var(--color-syntax-keywords); |
| 194 | +} |
0 commit comments