Skip to content

Commit 4dd6148

Browse files
author
abrulic
committed
UI tw fixes
1 parent 4417aec commit 4dd6148

File tree

2 files changed

+24
-186
lines changed

2 files changed

+24
-186
lines changed

docs/app/components/code-block/code-block-syntax-highlighter.ts

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,32 @@
66
type TokenType = "keyword" | "string" | "number" | "comment" | "operator" | "punctuation" | "function" | "text"
77

88
const MASTER_REGEX = new RegExp(
9-
[
10-
// whitespace
11-
"\\s+",
12-
// single-line comment
13-
"//.*?(?=\\n|$)",
14-
// multi-line comment
15-
"/\\*[\\s\\S]*?\\*/",
16-
// hash comment at start of line
17-
"^\\s*#.*$",
18-
// strings
19-
"(['\"])(?:(?!\\1)[^\\\\]|\\\\.)*\\1",
20-
// numbers
21-
"\\d+\\.?\\d*",
22-
// identifiers
23-
"[a-zA-Z_$][a-zA-Z0-9_$]*",
24-
// operators and punctuation
25-
"===|!==|<=|>=|==|!=|&&|\\|\\||\\+\\+|--|[+\\-*/%=<>!?:(){}\\[\\];,.]|[+\\-*/%]=",
26-
// arrow function
27-
"=>",
28-
].join("|"),
29-
"g"
9+
[
10+
// whitespace
11+
"\\s+",
12+
// single-line comment
13+
"\\/\\/[^\\n\\r]*",
14+
// multi-line comment
15+
"\\/\\*[\\s\\S]*?\\*\\/",
16+
// hash comment at start of line
17+
"^\\s*#.*$",
18+
// strings
19+
"(['\"])(?:(?!\\1)[^\\\\]|\\\\.)*\\1",
20+
// numbers
21+
"\\d+\\.?\\d*",
22+
// identifiers
23+
"[a-zA-Z_$][a-zA-Z0-9_$]*",
24+
// arrow function
25+
"=>",
26+
// operators & punctuation:
27+
// - multi-char first
28+
// - single '/' only if NOT starting a comment
29+
"===|!==|<=|>=|==|!=|&&|\\|\\||\\+\\+|--|[+\\-*%=<>!?:(){}\\[\\];,.]|\\/(?![/*])|[+\\-*/%]=",
30+
].join("|"),
31+
"gm"
3032
)
3133

34+
3235
const KEYWORDS = [
3336
"import",
3437
"export",

docs/app/tailwind.css

Lines changed: 0 additions & 165 deletions
Original file line numberDiff line numberDiff line change
@@ -290,168 +290,3 @@
290290
cursor: default;
291291
}
292292
}
293-
294-
@layer components {
295-
.prose {
296-
max-width: none;
297-
color: theme(--color-slate-700);
298-
299-
hr {
300-
border-color: theme(--color-slate-100);
301-
margin-top: 3em;
302-
margin-bottom: 3em;
303-
}
304-
305-
h1, h2, h3 {
306-
letter-spacing: -0.025em;
307-
}
308-
309-
h2 {
310-
margin-bottom: 0.6666666667em; /* 16/24 */
311-
}
312-
313-
h3 {
314-
margin-top: 2.4em;
315-
line-height: 1.4;
316-
}
317-
318-
h4 {
319-
margin-top: 2em;
320-
font-size: 1.125em;
321-
}
322-
323-
h2 small, h3 small, h4 small {
324-
font-family: theme(--font-mono);
325-
color: theme(--color-slate-500);
326-
font-weight: 500;
327-
}
328-
329-
h2 small {
330-
font-size: theme(--text-lg);
331-
line-height: theme(--text-xl--line-height);
332-
}
333-
334-
h3 small {
335-
font-size: theme(--text-base);
336-
line-height: theme(--text-base--line-height);
337-
}
338-
339-
h4 small {
340-
font-size: theme(--text-sm);
341-
line-height: theme(--text-sm--line-height);
342-
}
343-
344-
h2, h3, h4 {
345-
scroll-margin-top: var(--scroll-mt);
346-
}
347-
348-
h2 code, h3 code {
349-
font: inherit;
350-
}
351-
352-
ul {
353-
list-style-type: none;
354-
padding-left: 0;
355-
}
356-
357-
ul > li {
358-
position: relative;
359-
padding-left: 1.75em;
360-
}
361-
362-
ul > li::before {
363-
content: "";
364-
width: 0.75em;
365-
height: 0.125em;
366-
position: absolute;
367-
top: calc(0.875em - 0.0625em);
368-
left: 0;
369-
border-radius: 9999px;
370-
background-color: theme(--color-slate-300);
371-
}
372-
373-
a {
374-
font-weight: --font-semibold;
375-
text-decoration: none;
376-
border-bottom: 1px solid theme(--color-sky-300);
377-
}
378-
379-
a:hover {
380-
border-bottom-width: 2px;
381-
}
382-
383-
a code {
384-
color: inherit;
385-
font-weight: inherit;
386-
}
387-
388-
strong {
389-
color: theme(--color-slate-900);
390-
font-weight: --font-semibold
391-
}
392-
393-
a strong {
394-
color: inherit;
395-
font-weight: inherit;
396-
}
397-
398-
kbd {
399-
background: theme(--color-slate-100);
400-
border-width: 1px;
401-
border-color: theme(--color-slate-200);
402-
padding: 0.125em 0.25em;
403-
color: theme(--color-slate-700);
404-
font-weight: 500;
405-
font-size: 0.875em;
406-
font-variant-ligatures: none;
407-
border-radius: 4px;
408-
margin: 0 1px;
409-
}
410-
411-
code {
412-
font-weight: --font-medium;
413-
font-variant-ligatures: none;
414-
}
415-
416-
pre {
417-
color: theme(--color-slate-50);
418-
border-radius: theme(--radius-xl);
419-
padding: theme(--spacing);
420-
box-shadow: theme(--shadow-md);
421-
display: flex;
422-
margin-top: 1.4285714286em; /* 20/14 */
423-
margin-bottom: 2.2857142857em; /* 32/14 */
424-
}
425-
426-
p + pre {
427-
margin-top: -0.2857142857em; /* -4/14 */
428-
}
429-
430-
pre + pre {
431-
margin-top: -1.1428571429em; /* -16/14 */
432-
}
433-
434-
pre code {
435-
flex: none;
436-
min-width: 100%;
437-
}
438-
439-
440-
441-
tbody tr:last-child {
442-
border-bottom-width: 1px;
443-
}
444-
445-
446-
447-
figure figcaption {
448-
text-align: center;
449-
font-style: italic;
450-
}
451-
452-
figure > figcaption {
453-
margin-top: 0.8571428571em; /* 12/14 */
454-
}
455-
}
456-
457-
}

0 commit comments

Comments
 (0)