Skip to content

Commit fb831a4

Browse files
committed
Switch shiki for prism
This fixes WebIDL warnings
1 parent f4ad361 commit fb831a4

File tree

3 files changed

+124
-4
lines changed

3 files changed

+124
-4
lines changed

site/astro.config.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ export default defineConfig({
2323
],
2424
site: 'https://open-ui.org',
2525
markdown: {
26-
shikiConfig: {
27-
langs: [],
28-
wrap: true,
29-
},
26+
syntaxHighlight: 'prism',
3027
},
3128
vite: {
3229
ssr: {

site/public/styles/prism-dark.css

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
code[class*="language-"],
2+
pre[class*="language-"] {
3+
color: #f8f8f2;
4+
background: none;
5+
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
6+
text-align: left;
7+
word-spacing: normal;
8+
word-wrap: normal;
9+
10+
white-space: pre-wrap; /* Allow wrapping */
11+
word-break: break-word; /* Prevent overflow */
12+
overflow-wrap: break-word; /* Ensures long words break */
13+
overflow-x: auto; /* Keep horizontal scroll if necessary */
14+
line-height: 1.5;
15+
16+
tab-size: 4;
17+
18+
hyphens: none;
19+
}
20+
21+
/* Code blocks */
22+
pre[class*="language-"] {
23+
padding: 0em;
24+
margin: 0.5em 0;
25+
overflow: auto;
26+
border-radius: 0.3em;
27+
}
28+
29+
:not(pre) > code[class*="language-"],
30+
pre[class*="language-"] {
31+
background: #2b2b2b;
32+
}
33+
34+
/* Inline code */
35+
:not(pre) > code[class*="language-"] {
36+
padding: 0.1em;
37+
border-radius: 0.3em;
38+
white-space: normal;
39+
}
40+
41+
.token.comment,
42+
.token.prolog,
43+
.token.doctype,
44+
.token.cdata {
45+
color: #d4d0ab;
46+
}
47+
48+
.token.punctuation {
49+
color: #e1e4e8;
50+
}
51+
52+
.token.property,
53+
.token.tag,
54+
.token.constant,
55+
[class*="language-webidl"] .token.keyword,
56+
.token.symbol,
57+
.token.deleted {
58+
color: #85E89C;
59+
}
60+
61+
.token.boolean,
62+
.token.number {
63+
color: #00e0e0;
64+
}
65+
66+
.token.selector,
67+
[class*="language-webidl"] .token.class-name,
68+
.token.attr-name,
69+
.token.string,
70+
.token.char,
71+
.token.builtin,
72+
.token.inserted {
73+
color: #b392f0;
74+
}
75+
76+
.token.string {
77+
color:#9ecbff
78+
}
79+
80+
.token.operator,
81+
.token.entity,
82+
.token.url,
83+
.language-css .token.string,
84+
.style .token.string,
85+
.token.variable {
86+
color: #00e0e0;
87+
}
88+
89+
.token.atrule,
90+
.token.attr-value {
91+
color: #9ecbff;
92+
}
93+
94+
.token.function {
95+
color: #b392f0;
96+
}
97+
98+
.token.keyword {
99+
color: #f97583;
100+
}
101+
102+
.token.regex,
103+
.token.important {
104+
color: #ffd700;
105+
}
106+
107+
.token.important,
108+
.token.bold {
109+
font-weight: bold;
110+
}
111+
112+
.token.italic {
113+
font-style: italic;
114+
}
115+
116+
.token.entity {
117+
cursor: help;
118+
}
119+
120+
code[class*="language-webidl"] {
121+
color: #9ecbff;
122+
}

site/src/layouts/BaseLayout.astro

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const { title } = Astro.props;
1111
<link rel="icon" type="image/svg+xml" href="/images/favicon-32x32.png" />
1212
<link rel="stylesheet" href="/styles/reset.css" />
1313
<link rel="stylesheet" href="/styles/global.css" />
14+
<link rel="stylesheet" href="/styles/prism-dark.css" />
1415
<title>{title}</title>
1516
<meta name="description" content="Open UI "/>
1617
<meta property="og:title" content={title}/>

0 commit comments

Comments
 (0)