Skip to content

Commit 8da97db

Browse files
committed
consolidate
1 parent e04d548 commit 8da97db

File tree

10 files changed

+42
-54
lines changed

10 files changed

+42
-54
lines changed

apps/svelte.dev/content/docs/kit/10-getting-started/10-introduction.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
title: Introduction
33
---
44

5+
```js
6+
const number = 42; // wheee
7+
const boolean = true; // wheee
8+
```
9+
510
## Before we begin
611

712
> [!NOTE] If you're new to Svelte or SvelteKit we recommend checking out the [interactive tutorial](/tutorial/kit).

packages/editor/src/lib/codemirror.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
}
44

55
.cm-editor {
6-
color: var(--sk-code-base);
6+
color: var(--shiki-color-text);
77
background-color: transparent;
88
height: 100%;
99

packages/editor/src/lib/theme.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import { tags as t } from '@lezer/highlight';
33

44
export const theme = syntaxHighlighting(
55
HighlightStyle.define([
6-
{ tag: t.keyword, color: 'var(--sk-code-keyword)' },
6+
{ tag: t.keyword, color: 'var(--shiki-token-keyword)' },
77
{
88
tag: [t.name, t.deleted, t.character, t.propertyName, t.macroName],
9-
color: 'var(--sk-code-base)'
9+
color: 'var(--shiki-color-text)'
1010
},
11-
{ tag: [t.function(t.variableName), t.labelName], color: 'var(--sk-code-tags)' },
12-
{ tag: [t.color, t.constant(t.name), t.standard(t.name)], color: 'var(--sk-code-base)' },
13-
{ tag: [t.definition(t.name), t.separator], color: 'var(--sk-code-base)' },
11+
{ tag: [t.function(t.variableName), t.labelName], color: 'var(--shiki-token-function)' },
12+
{ tag: [t.color, t.constant(t.name), t.standard(t.name)], color: 'var(--shiki-color-text)' },
13+
{ tag: [t.definition(t.name), t.separator], color: 'var(--shiki-color-text)' },
1414
{
1515
tag: [
1616
t.typeName,
@@ -22,20 +22,20 @@ export const theme = syntaxHighlighting(
2222
t.self,
2323
t.namespace
2424
],
25-
color: 'var(--sk-code-tags)'
25+
color: 'var(--shiki-token-function)'
2626
},
2727
{
2828
tag: [t.operator, t.operatorKeyword, t.url, t.escape, t.regexp, t.link, t.special(t.string)],
29-
color: 'var(--sk-code-base)'
29+
color: 'var(--shiki-color-text)'
3030
},
31-
{ tag: [t.meta, t.comment], color: 'var(--sk-code-comment)' },
31+
{ tag: [t.meta, t.comment], color: 'var(--shiki-token-comment)' },
3232
{ tag: t.strong, fontWeight: 'bold' },
3333
{ tag: t.emphasis, fontStyle: 'italic' },
3434
{ tag: t.strikethrough, textDecoration: 'line-through' },
35-
{ tag: t.link, color: 'var(--sk-code-base)', textDecoration: 'underline' },
35+
{ tag: t.link, color: 'var(--shiki-color-text)', textDecoration: 'underline' },
3636
{ tag: t.heading, fontWeight: 'bold', color: 'var(--sk-fg-1)' },
3737
{ tag: [t.atom, t.bool], color: 'var(--sk-code-atom)' },
38-
{ tag: [t.processingInstruction, t.string, t.inserted], color: 'var(--sk-code-string)' },
38+
{ tag: [t.processingInstruction, t.string, t.inserted], color: 'var(--shiki-token-string)' },
3939
{ tag: t.invalid, color: '#ff008c' }
4040
])
4141
);

packages/repl/src/lib/Output/AstNode.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,18 +163,18 @@
163163
}
164164
165165
.token {
166-
color: var(--sk-code-base);
166+
color: var(--shiki-color-text);
167167
}
168168
169169
.token.string {
170-
color: var(--sk-code-string);
170+
color: var(--shiki-token-string);
171171
}
172172
173173
.token.number {
174-
color: var(--sk-code-number);
174+
color: var(--shiki-token-constant);
175175
}
176176
177177
.token.comment {
178-
color: var(--sk-code-comment);
178+
color: var(--shiki-token-comment);
179179
}
180180
</style>

packages/repl/src/lib/Output/AstView.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
--string: hsl(41, 37%, 45%);
9494
--number: hsl(102, 27%, 50%);
9595
background: var(--sk-bg-3);
96-
color: var(--sk-code-base);
96+
color: var(--shiki-color-text);
9797
display: flex;
9898
flex-direction: column;
9999
}

packages/repl/src/lib/Output/CompilerOptions.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@
6161
}
6262
6363
.string {
64-
color: var(--sk-code-string);
64+
color: var(--shiki-token-string);
6565
}
6666
6767
label {
6868
display: inline-block;
6969
}
7070
7171
label[for] {
72-
color: var(--sk-code-string);
72+
color: var(--shiki-token-string);
7373
}
7474
7575
label :global(input[type='checkbox']) {

packages/repl/src/lib/Output/console/Console.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
--error-border: rgb(242, 214, 219);
3636
--warning-bg: rgb(254, 251, 218);
3737
--warning-border: rgb(242, 232, 163);
38-
--json-tree-string-color: var(--sk-code-string);
38+
--json-tree-string-color: var(--shiki-token-string);
3939
--json-tree-font-family: var(--sk-font-family-mono);
4040
4141
:global(.dark) & {

packages/site-kit/src/lib/components/Text.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@
281281
width: 100%;
282282
padding: 0.7rem 1rem;
283283
box-sizing: border-box;
284-
color: var(--sk-code-base);
284+
color: var(--shiki-color-text);
285285
border-radius: var(--sk-border-radius);
286286
overflow-x: auto;
287287

packages/site-kit/src/lib/markdown/renderer.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import * as marked from 'marked';
88
import { codeToHtml, createCssVariablesTheme } from 'shiki';
99
import { transformerTwoslash } from '@shikijs/twoslash';
1010
import { SHIKI_LANGUAGE_MAP, slugify, smart_quotes, transform } from './utils';
11-
import { fileURLToPath } from 'node:url';
1211

1312
interface SnippetOptions {
1413
file: string | null;
@@ -24,9 +23,7 @@ const METADATA_REGEX =
2423

2524
const theme = createCssVariablesTheme({
2625
name: 'css-variables',
27-
variablePrefix: '--shiki-',
28-
variableDefaults: {},
29-
fontStyle: true
26+
variablePrefix: '--shiki-'
3027
});
3128

3229
// Hash the contents of this file and its dependencies so that we get a new cache in case we have changed

packages/site-kit/src/lib/styles/tokens/colours.css

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,16 @@
1515
--sk-fg-4: hsl(0, 0%, 45%);
1616
--sk-fg-accent: hsl(12, 93%, 43%);
1717

18-
--sk-code-base: var(--sk-fg-2);
19-
--sk-code-comment: var(--sk-fg-4);
20-
--sk-code-keyword: hsl(204, 100%, 38%);
21-
--sk-code-function: var(--sk-fg-accent);
22-
--sk-code-string: hsl(30, 100%, 30%);
23-
--sk-code-number: hsl(120, 100%, 25%);
24-
--sk-code-template-string: hsl(2, 80%, 47%);
25-
--sk-code-tags: var(--sk-code-function);
26-
--sk-code-important: var(--sk-code-string);
27-
28-
--shiki-color-text: var(--sk-code-base);
29-
--shiki-token-constant: var(--sk-code-base);
30-
--shiki-token-string: var(--sk-code-string);
31-
--shiki-token-comment: var(--sk-code-comment);
32-
--shiki-token-keyword: var(--sk-code-keyword);
33-
--shiki-token-parameter: var(--sk-code-base);
34-
--shiki-token-function: var(--sk-code-function);
35-
--shiki-token-string-expression: var(--sk-code-string);
36-
--shiki-token-punctuation: var(--sk-code-base);
37-
--shiki-token-link: var(--sk-code-keyword);
18+
--shiki-color-text: var(--sk-fg-2);
19+
--shiki-token-constant: var(--shiki-color-text);
20+
--shiki-token-string: hsl(30, 100%, 30%);
21+
--shiki-token-comment: var(--sk-fg-4);
22+
--shiki-token-keyword: hsl(204, 100%, 38%);
23+
--shiki-token-parameter: var(--shiki-color-text);
24+
--shiki-token-function: var(--sk-fg-accent);
25+
--shiki-token-string-expression: var(--shiki-token-string);
26+
--shiki-token-punctuation: var(--shiki-color-text);
27+
--shiki-token-link: var(--shiki-token-keyword);
3828

3929
/* Background colours */
4030
--sk-bg-1: hsl(0, 0%, 100%);
@@ -43,8 +33,8 @@
4333
--sk-bg-4: hsl(0, 0%, 95%);
4434
--sk-bg-5: hsl(0, 0%, 92%);
4535
--sk-bg-6: hsl(0, 0%, 86%);
46-
--sk-bg-selection: hsla(204, 100%, 63%, 0.3);
4736
--sk-bg-accent: var(--sk-fg-accent);
37+
--sk-bg-selection: hsla(204, 100%, 63%, 0.3);
4838

4939
/* Border colors */
5040

@@ -78,15 +68,11 @@
7868
--sk-fg-4: hsl(var(--sk-bg-hue), 10%, 45%);
7969
--sk-fg-accent: hsl(12, 94%, 62%);
8070

81-
--sk-code-base: hsl(45, 7%, 75%);
82-
--sk-code-comment: hsl(0, 0%, 55%);
83-
--sk-code-keyword: hsl(204, 88%, 65%);
84-
--sk-code-function: hsl(19, 67%, 75%);
85-
--sk-code-string: hsl(41, 37%, 68%);
86-
--sk-code-number: hsl(120, 100%, 25%);
87-
--sk-code-template-string: hsl(2, 80%, 47%);
88-
--sk-code-tags: var(--sk-code-function);
89-
--sk-code-important: var(--sk-code-string);
71+
--shiki-color-text: hsl(45, 7%, 75%);
72+
--shiki-token-comment: hsl(0, 0%, 55%);
73+
--shiki-token-keyword: hsl(204, 88%, 65%);
74+
--shiki-token-function: hsl(19, 67%, 75%);
75+
--shiki-token-string: hsl(41, 37%, 68%);
9076

9177
/* Background colours */
9278
--sk-bg-1: hsl(var(--sk-bg-hue), 15%, 8%);

0 commit comments

Comments
 (0)