@fuzdev/fuz_code 0.39.0 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -8
- package/dist/Code.svelte +2 -2
- package/dist/CodeHighlight.svelte +2 -2
- package/dist/theme.css +11 -11
- package/dist/theme_highlight.css +11 -11
- package/dist/theme_variables.css +2 -2
- package/package.json +11 -10
package/README.md
CHANGED
|
@@ -25,8 +25,8 @@ but there are two optional dependencies:
|
|
|
25
25
|
based on [`prism-svelte`](https://github.com/pngwn/prism-svelte)
|
|
26
26
|
and a [Svelte component](src/lib/Code.svelte) for convenient usage.
|
|
27
27
|
- The [default theme](src/lib/theme.css) integrates
|
|
28
|
-
with my CSS library [
|
|
29
|
-
Non-
|
|
28
|
+
with my CSS library [fuz_css](https://github.com/fuzdev/fuz_css) for colors that adapt to the user's runtime `color-scheme` preference.
|
|
29
|
+
Non-fuz_css users should import [theme_variables.css](src/lib/theme_variables.css)
|
|
30
30
|
or otherwise define those variables.
|
|
31
31
|
|
|
32
32
|
Compared to [Shiki](https://github.com/shikijs/shiki),
|
|
@@ -79,14 +79,14 @@ import '@fuzdev/fuz_code/theme.css';
|
|
|
79
79
|
```
|
|
80
80
|
|
|
81
81
|
The primary themes (currently just [one](src/lib/theme.css)) have a dependency
|
|
82
|
-
on my CSS library [
|
|
82
|
+
on my CSS library [fuz_css](https://github.com/fuzdev/fuz_css)
|
|
83
83
|
for [color-scheme](https://css.fuz.dev/docs/themes) awareness.
|
|
84
|
-
See the [
|
|
84
|
+
See the [fuz_css docs](https://css.fuz.dev/) for its usage.
|
|
85
85
|
|
|
86
|
-
If you're not using
|
|
86
|
+
If you're not using fuz_css, import `theme_variables.css` alongside `theme.css`:
|
|
87
87
|
|
|
88
88
|
```ts
|
|
89
|
-
// Without
|
|
89
|
+
// Without fuz_css:
|
|
90
90
|
import '@fuzdev/fuz_code/theme.css';
|
|
91
91
|
import '@fuzdev/fuz_code/theme_variables.css';
|
|
92
92
|
```
|
|
@@ -96,9 +96,9 @@ import '@fuzdev/fuz_code/theme_variables.css';
|
|
|
96
96
|
- [@fuzdev/fuz_code/syntax_styler_global.js](src/lib/syntax_styler_global.ts) - pre-configured instance with all grammars
|
|
97
97
|
- [@fuzdev/fuz_code/syntax_styler.js](src/lib/syntax_styler.ts) - base class for custom grammars
|
|
98
98
|
- [@fuzdev/fuz_code/theme.css](src/lib/theme.css) -
|
|
99
|
-
default theme that depends on [
|
|
99
|
+
default theme that depends on [fuz_css](https://github.com/fuzdev/fuz_css)
|
|
100
100
|
- [@fuzdev/fuz_code/theme_variables.css](src/lib/theme_variables.css) -
|
|
101
|
-
CSS variables for non-
|
|
101
|
+
CSS variables for non-fuz_css users
|
|
102
102
|
- [@fuzdev/fuz_code/Code.svelte](src/lib/Code.svelte) -
|
|
103
103
|
Svelte component for syntax highlighting with HTML generation
|
|
104
104
|
|
package/dist/Code.svelte
CHANGED
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
>
|
|
137
137
|
|
|
138
138
|
<style>
|
|
139
|
-
/* inline code inherits
|
|
139
|
+
/* inline code inherits fuz_css defaults: pre-wrap, inline-block, baseline alignment */
|
|
140
140
|
|
|
141
141
|
code:not(.inline) {
|
|
142
142
|
/* block code: traditional no-wrap, horizontal scroll */
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
code.wrap:not(.inline) {
|
|
151
|
-
/* unset what we set above, otherwise rely on
|
|
151
|
+
/* unset what we set above, otherwise rely on fuz_css base styles */
|
|
152
152
|
white-space: pre-wrap;
|
|
153
153
|
}
|
|
154
154
|
|
|
@@ -188,7 +188,7 @@
|
|
|
188
188
|
>
|
|
189
189
|
|
|
190
190
|
<style>
|
|
191
|
-
/* inline code inherits
|
|
191
|
+
/* inline code inherits fuz_css defaults: pre-wrap, inline-block, baseline alignment */
|
|
192
192
|
|
|
193
193
|
code:not(.inline) {
|
|
194
194
|
/* block code: traditional no-wrap, horizontal scroll */
|
|
@@ -200,7 +200,7 @@
|
|
|
200
200
|
}
|
|
201
201
|
|
|
202
202
|
code.wrap:not(.inline) {
|
|
203
|
-
/* unset what we set above, otherwise rely on
|
|
203
|
+
/* unset what we set above, otherwise rely on fuz_css base styles */
|
|
204
204
|
white-space: pre-wrap;
|
|
205
205
|
}
|
|
206
206
|
</style>
|
package/dist/theme.css
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
.token_doctype,
|
|
3
3
|
.token_cdata,
|
|
4
4
|
.token_punctuation {
|
|
5
|
-
color: var(--
|
|
5
|
+
color: var(--text_50);
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.token_tag,
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
.token_heading,
|
|
17
17
|
.token_heading_punctuation,
|
|
18
18
|
.token_tag_punctuation {
|
|
19
|
-
color: var(--
|
|
19
|
+
color: var(--color_a_50);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.token_comment,
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
.token_inserted,
|
|
25
25
|
.token_blockquote,
|
|
26
26
|
.token_blockquote_punctuation {
|
|
27
|
-
color: var(--
|
|
27
|
+
color: var(--color_b_50);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
.token_builtin,
|
|
31
31
|
.token_class_name,
|
|
32
32
|
.token_number {
|
|
33
|
-
color: var(--
|
|
33
|
+
color: var(--color_j_50);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
.token_attr_value,
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
.token_template_punctuation,
|
|
40
40
|
.token_inline_code,
|
|
41
41
|
.token_code_punctuation {
|
|
42
|
-
color: var(--
|
|
42
|
+
color: var(--color_h_50);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
/* attr_equals must be after attr_value */
|
|
46
46
|
.token_attr_equals {
|
|
47
|
-
color: var(--
|
|
47
|
+
color: var(--text_50);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
.token_selector,
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
.token_regex,
|
|
53
53
|
.token_important,
|
|
54
54
|
.token_variable {
|
|
55
|
-
color: var(--
|
|
55
|
+
color: var(--color_e_50);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
.token_atrule {
|
|
59
|
-
color: var(--
|
|
59
|
+
color: var(--color_f_50);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
.token_attr_name,
|
|
@@ -66,18 +66,18 @@
|
|
|
66
66
|
.token_link_text_wrapper,
|
|
67
67
|
.token_link_text,
|
|
68
68
|
.token_link_punctuation {
|
|
69
|
-
color: var(--
|
|
69
|
+
color: var(--color_i_50);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
.token_special_keyword,
|
|
73
73
|
.token_namespace,
|
|
74
74
|
.token_rule {
|
|
75
|
-
color: var(--
|
|
75
|
+
color: var(--color_g_50);
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
.token_at_keyword,
|
|
79
79
|
.token_url {
|
|
80
|
-
color: var(--
|
|
80
|
+
color: var(--color_d_50);
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
.token_url {
|
package/dist/theme_highlight.css
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
::highlight(token_cdata),
|
|
7
7
|
.token_punctuation,
|
|
8
8
|
::highlight(token_punctuation) {
|
|
9
|
-
color: var(--
|
|
9
|
+
color: var(--text_50);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
.token_tag,
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
::highlight(token_heading_punctuation),
|
|
32
32
|
.token_tag_punctuation,
|
|
33
33
|
::highlight(token_tag_punctuation) {
|
|
34
|
-
color: var(--
|
|
34
|
+
color: var(--color_a_50);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
.token_comment,
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
::highlight(token_blockquote),
|
|
45
45
|
.token_blockquote_punctuation,
|
|
46
46
|
::highlight(token_blockquote_punctuation) {
|
|
47
|
-
color: var(--
|
|
47
|
+
color: var(--color_b_50);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
.token_builtin,
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
::highlight(token_class_name),
|
|
54
54
|
.token_number,
|
|
55
55
|
::highlight(token_number) {
|
|
56
|
-
color: var(--
|
|
56
|
+
color: var(--color_j_50);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
.token_attr_value,
|
|
@@ -68,13 +68,13 @@
|
|
|
68
68
|
::highlight(token_inline_code),
|
|
69
69
|
.token_code_punctuation,
|
|
70
70
|
::highlight(token_code_punctuation) {
|
|
71
|
-
color: var(--
|
|
71
|
+
color: var(--color_h_50);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
/* attr_equals must be after attr_value */
|
|
75
75
|
.token_attr_equals,
|
|
76
76
|
::highlight(token_attr_equals) {
|
|
77
|
-
color: var(--
|
|
77
|
+
color: var(--text_50);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
.token_selector,
|
|
@@ -87,12 +87,12 @@
|
|
|
87
87
|
::highlight(token_important),
|
|
88
88
|
.token_variable,
|
|
89
89
|
::highlight(token_variable) {
|
|
90
|
-
color: var(--
|
|
90
|
+
color: var(--color_e_50);
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
.token_atrule,
|
|
94
94
|
::highlight(token_atrule) {
|
|
95
|
-
color: var(--
|
|
95
|
+
color: var(--color_f_50);
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
.token_attr_name,
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
::highlight(token_link_text),
|
|
110
110
|
.token_link_punctuation,
|
|
111
111
|
::highlight(token_link_punctuation) {
|
|
112
|
-
color: var(--
|
|
112
|
+
color: var(--color_i_50);
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
.token_special_keyword,
|
|
@@ -118,14 +118,14 @@
|
|
|
118
118
|
::highlight(token_namespace),
|
|
119
119
|
.token_rule,
|
|
120
120
|
::highlight(token_rule) {
|
|
121
|
-
color: var(--
|
|
121
|
+
color: var(--color_g_50);
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
.token_at_keyword,
|
|
125
125
|
::highlight(token_at_keyword),
|
|
126
126
|
.token_url,
|
|
127
127
|
::highlight(token_url) {
|
|
128
|
-
color: var(--
|
|
128
|
+
color: var(--color_d_50);
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
.token_url,
|
package/dist/theme_variables.css
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
|
|
3
|
-
CSS variables for syntax highlighting when not using
|
|
4
|
-
Import this alongside theme.css if you're not using
|
|
3
|
+
CSS variables for syntax highlighting when not using fuz_css.
|
|
4
|
+
Import this alongside theme.css if you're not using fuz_css.
|
|
5
5
|
|
|
6
6
|
*/
|
|
7
7
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fuzdev/fuz_code",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.41.0",
|
|
4
4
|
"description": "syntax styling utilities and components for TypeScript, Svelte, and Markdown",
|
|
5
5
|
"glyph": "🎨",
|
|
6
6
|
"logo": "logo.svg",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"node": ">=22.15"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@fuzdev/fuz_css": ">=0.
|
|
35
|
+
"@fuzdev/fuz_css": ">=0.44.1",
|
|
36
36
|
"svelte": "^5"
|
|
37
37
|
},
|
|
38
38
|
"peerDependenciesMeta": {
|
|
@@ -45,23 +45,24 @@
|
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@changesets/changelog-git": "^0.2.1",
|
|
48
|
-
"@fuzdev/fuz_css": "^0.
|
|
49
|
-
"@fuzdev/fuz_ui": "^0.
|
|
50
|
-
"@fuzdev/fuz_util": "^0.
|
|
48
|
+
"@fuzdev/fuz_css": "^0.45.0",
|
|
49
|
+
"@fuzdev/fuz_ui": "^0.180.0",
|
|
50
|
+
"@fuzdev/fuz_util": "^0.48.2",
|
|
51
51
|
"@ryanatkn/eslint-config": "^0.9.0",
|
|
52
|
-
"@ryanatkn/gro": "^0.
|
|
52
|
+
"@ryanatkn/gro": "^0.189.3",
|
|
53
53
|
"@sveltejs/adapter-static": "^3.0.10",
|
|
54
|
-
"@sveltejs/kit": "^2.
|
|
54
|
+
"@sveltejs/kit": "^2.50.1",
|
|
55
55
|
"@sveltejs/package": "^2.5.7",
|
|
56
|
-
"@sveltejs/vite-plugin-svelte": "^6.2.
|
|
56
|
+
"@sveltejs/vite-plugin-svelte": "^6.2.4",
|
|
57
57
|
"@types/node": "^24.10.1",
|
|
58
|
+
"@webref/css": "^8.2.0",
|
|
58
59
|
"eslint": "^9.39.1",
|
|
59
60
|
"eslint-plugin-svelte": "^3.13.1",
|
|
60
61
|
"esm-env": "^1.2.2",
|
|
61
62
|
"prettier": "^3.7.4",
|
|
62
63
|
"prettier-plugin-svelte": "^3.4.1",
|
|
63
|
-
"svelte": "^5.
|
|
64
|
-
"svelte-check": "^4.3.
|
|
64
|
+
"svelte": "^5.48.5",
|
|
65
|
+
"svelte-check": "^4.3.5",
|
|
65
66
|
"tslib": "^2.8.1",
|
|
66
67
|
"typescript": "^5.9.3",
|
|
67
68
|
"typescript-eslint": "^8.48.1",
|