valaxy 0.6.0 → 0.6.3

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.
@@ -1,8 +1,5 @@
1
1
  @use "~/styles/mixins" as *;
2
2
 
3
- /* https://github.com/antfu/prism-theme-vars */
4
- @use "prism-theme-vars/base.css" as *;
5
-
6
3
  @include mobile {
7
4
  .markdown-body {
8
5
  div[class*="language-"] {
@@ -11,17 +8,40 @@
11
8
  }
12
9
  }
13
10
 
11
+ @media (min-width: 640px) {
12
+ .markdown-body div[class*="language-"] {
13
+ border-radius: 6px;
14
+ margin: 16px 0;
15
+ }
16
+ }
17
+
18
+ @media (max-width: 639px) {
19
+ .markdown-body li div[class*="language-"] {
20
+ border-radius: 6px 0 0 6px;
21
+ }
22
+ }
23
+
14
24
  .markdown-body {
15
25
  div[class*="language-"] {
16
26
  position: relative;
17
- padding: 0;
18
- background-color: var(--smc-code-bg-color);
27
+ background-color: var(--va-code-block-bg);
28
+
29
+ code {
30
+ padding: 0 24px;
31
+ line-height: var(--va-code-line-height);
32
+ font-size: var(--va-code-font-size);
33
+ color: var(--va-code-block-color);
34
+ transition: color 0.5s;
35
+ width: fit-content;
36
+ }
19
37
 
20
38
  pre {
21
39
  position: relative;
22
- padding: 1rem;
23
40
  z-index: 1;
24
- background: none;
41
+ margin: 0;
42
+ padding: 1rem 0;
43
+ background: transparent;
44
+ overflow-x: auto;
25
45
 
26
46
  // expand
27
47
  code {
@@ -31,177 +51,181 @@
31
51
  }
32
52
  }
33
53
 
34
- /* Line highlighting */
35
-
36
- .highlight-lines {
37
- position: absolute;
38
- top: 0;
39
- bottom: 0;
40
- left: 0;
41
- padding: 1rem 0;
42
- width: 100%;
43
- line-height: var(--prism-line-height);
44
- user-select: none;
45
- overflow: hidden;
46
-
47
- .highlighted {
48
- background-color: rgba(0, 0, 0, 0.08);
49
- }
50
- }
51
-
52
- .dark {
54
+ // marker
55
+ .markdown-body {
53
56
  .highlight-lines {
57
+ position: absolute;
58
+ top: 0;
59
+ bottom: 0;
60
+ left: 0;
61
+ padding: 16px 0;
62
+ width: 100%;
63
+ line-height: var(--va-code-line-height);
64
+ font-family: var(--va-font-mono);
65
+ font-size: var(--va-code-font-size);
66
+ user-select: none;
67
+ overflow: hidden;
68
+
54
69
  .highlighted {
55
- background-color: rgba(0, 0, 0, 0.4);
70
+ background-color: var(--va-code-line-highlight-color);
71
+ transition: background-color 0.5s;
56
72
  }
57
73
  }
58
- }
59
74
 
60
- .markdown-body {
61
- code {
62
- color: var(--prism-foreground) !important;
75
+ [class*="language-"] > span.copy {
76
+ position: absolute;
77
+ top: 8px;
78
+ right: 8px;
79
+ z-index: 2;
80
+ display: block;
81
+ justify-content: center;
82
+ align-items: center;
83
+ border-radius: 4px;
84
+ width: 40px;
85
+ height: 40px;
86
+ background-color: var(--va-code-block-bg);
87
+ opacity: 0;
88
+ cursor: pointer;
89
+ background-image: var(--va-icon-copy);
90
+ background-position: 50%;
91
+ background-size: 20px;
92
+ background-repeat: no-repeat;
93
+ transition: opacity 0.25s;
63
94
  }
64
- }
65
-
66
- // prism
67
- html:not(.dark) {
68
- // text
69
- --prism-foreground: #224466;
70
-
71
- --prism-background: #f8f8f8;
72
- --prism-comment: #758575;
73
- --prism-namespace: #444444;
74
- --prism-string: #bc8671;
75
- --prism-punctuation: #80817d;
76
- --prism-literal: #36acaa;
77
- --prism-keyword: #248459;
78
- --prism-function: #0088bb;
79
- --prism-deleted: #9a050f;
80
- --prism-class: #2b91af;
81
- --prism-builtin: #800000;
82
- --prism-property: #ce9178;
83
- --prism-regex: #ad502b;
84
- }
85
-
86
- html.dark {
87
- --prism-foreground: #a6accd;
88
-
89
- --prism-background: #242424;
90
- --prism-namespace: #aaaaaa;
91
- --prism-comment: #758575;
92
- --prism-namespace: #444444;
93
- --prism-string: #c3e88d;
94
- --prism-punctuation: #a6accd;
95
- --prism-literal: #36acaa;
96
- --prism-keyword: #89ddff;
97
- --prism-function: #82aaff;
98
- --prism-deleted: #9a050f;
99
- --prism-class: #4ec9b0;
100
- --prism-builtin: #d16969;
101
- --prism-property: #c792ea;
102
- --prism-regex: #ad502b;
103
- --prism-selector: #c3e88d;
104
- }
105
-
106
- /* Language marker */
107
- // @use 'prism-theme-vars/marker.css' as *; * not div
108
- div[class*="language-"]:before {
109
- position: absolute;
110
- top: 0.6em;
111
- right: 1em;
112
- z-index: 2;
113
- font-size: 0.8rem;
114
- color: #888;
115
- }
116
-
117
- div[class~="language-html"]:before,
118
- div[class~="language-markup"]:before {
119
- content: "html";
120
- }
121
-
122
- div[class~="language-md"]:before,
123
- div[class~="language-markdown"]:before {
124
- content: "md";
125
- }
126
-
127
- div[class~="language-css"]:before {
128
- content: "css";
129
- }
130
-
131
- div[class~="language-sass"]:before {
132
- content: "sass";
133
- }
134
-
135
- div[class~="language-scss"]:before {
136
- content: "scss";
137
- }
138
-
139
- div[class~="language-less"]:before {
140
- content: "less";
141
- }
142
-
143
- div[class~="language-stylus"]:before {
144
- content: "styl";
145
- }
146
-
147
- div[class~="language-js"]:before,
148
- div[class~="language-javascript"]:before {
149
- content: "js";
150
- }
151
-
152
- div[class~="language-ts"]:before,
153
- div[class~="language-typescript"]:before {
154
- content: "ts";
155
- }
156
-
157
- div[class~="language-json"]:before {
158
- content: "json";
159
- }
160
-
161
- div[class~="language-rb"]:before,
162
- div[class~="language-ruby"]:before {
163
- content: "rb";
164
- }
165
-
166
- div[class~="language-py"]:before,
167
- div[class~="language-python"]:before {
168
- content: "py";
169
- }
170
-
171
- div[class~="language-sh"]:before,
172
- div[class~="language-bash"]:before {
173
- content: "sh";
174
- }
175
95
 
176
- div[class~="language-php"]:before {
177
- content: "php";
178
- }
179
-
180
- div[class~="language-go"]:before {
181
- content: "go";
182
- }
96
+ [class*="language-"]:hover > span.copy {
97
+ opacity: 1;
98
+ }
183
99
 
184
- div[class~="language-rust"]:before {
185
- content: "rust";
186
- }
100
+ [class*="language-"] > span.copy:hover {
101
+ background-color: var(--va-code-copy-code-hover-bg);
102
+ }
187
103
 
188
- div[class~="language-java"]:before {
189
- content: "java";
190
- }
104
+ [class*="language-"] > span.copy.copied,
105
+ [class*="language-"] > span.copy:hover.copied {
106
+ border-radius: 0 4px 4px 0;
107
+ background-color: var(--va-code-copy-code-hover-bg);
108
+ background-image: var(--va-icon-copied);
109
+ }
191
110
 
192
- div[class~="language-c"]:before {
193
- content: "c";
194
- }
111
+ [class*="language-"] > span.copy.copied::before,
112
+ [class*="language-"] > span.copy:hover.copied::before {
113
+ position: relative;
114
+ left: -65px;
115
+ display: block;
116
+ border-radius: 4px 0 0 4px;
117
+ padding-top: 8px;
118
+ width: 64px;
119
+ height: 40px;
120
+ text-align: center;
121
+ font-size: 12px;
122
+ font-weight: 500;
123
+ color: var(--va-code-copy-code-active-text);
124
+ background-color: var(--va-code-copy-code-hover-bg);
125
+ white-space: nowrap;
126
+ content: "Copied";
127
+ }
195
128
 
196
- div[class~="language-yml"]:before,
197
- div[class~="language-yaml"]:before {
198
- content: "yaml";
199
- }
129
+ [class*="language-"]:before {
130
+ position: absolute;
131
+ top: 6px;
132
+ right: 12px;
133
+ z-index: 2;
134
+ font-size: 12px;
135
+ font-weight: 500;
136
+ color: var(--va-c-text-dark-3);
137
+ transition: color 0.5s, opacity 0.5s;
138
+ }
200
139
 
201
- div[class~="language-dockerfile"]:before {
202
- content: "dockerfile";
203
- }
140
+ [class*="language-"]:hover:before {
141
+ opacity: 0;
142
+ }
204
143
 
205
- div[class~="language-vue"]:before {
206
- content: "vue";
144
+ [class~="language-c"]:before {
145
+ content: "c";
146
+ }
147
+ [class~="language-css"]:before {
148
+ content: "css";
149
+ }
150
+ [class~="language-go"]:before {
151
+ content: "go";
152
+ }
153
+ [class~="language-html"]:before {
154
+ content: "html";
155
+ }
156
+ [class~="language-java"]:before {
157
+ content: "java";
158
+ }
159
+ [class~="language-javascript"]:before {
160
+ content: "js";
161
+ }
162
+ [class~="language-js"]:before {
163
+ content: "js";
164
+ }
165
+ [class~="language-json"]:before {
166
+ content: "json";
167
+ }
168
+ [class~="language-jsx"]:before {
169
+ content: "jsx";
170
+ }
171
+ [class~="language-less"]:before {
172
+ content: "less";
173
+ }
174
+ [class~="language-markdown"]:before {
175
+ content: "md";
176
+ }
177
+ [class~="language-md"]:before {
178
+ content: "md";
179
+ }
180
+ [class~="language-php"]:before {
181
+ content: "php";
182
+ }
183
+ [class~="language-python"]:before {
184
+ content: "py";
185
+ }
186
+ [class~="language-py"]:before {
187
+ content: "py";
188
+ }
189
+ [class~="language-rb"]:before {
190
+ content: "rb";
191
+ }
192
+ [class~="language-ruby"]:before {
193
+ content: "rb";
194
+ }
195
+ [class~="language-rust"]:before {
196
+ content: "rust";
197
+ }
198
+ [class~="language-sass"]:before {
199
+ content: "sass";
200
+ }
201
+ [class~="language-scss"]:before {
202
+ content: "scss";
203
+ }
204
+ [class~="language-sh"]:before {
205
+ content: "sh";
206
+ }
207
+ [class~="language-bash"]:before {
208
+ content: "sh";
209
+ }
210
+ [class~="language-stylus"]:before {
211
+ content: "styl";
212
+ }
213
+ [class~="language-vue-html"]:before {
214
+ content: "template";
215
+ }
216
+ [class~="language-typescript"]:before {
217
+ content: "ts";
218
+ }
219
+ [class~="language-ts"]:before {
220
+ content: "ts";
221
+ }
222
+ [class~="language-tsx"]:before {
223
+ content: "tsx";
224
+ }
225
+ [class~="language-vue"]:before {
226
+ content: "vue";
227
+ }
228
+ [class~="language-yaml"]:before {
229
+ content: "yaml";
230
+ }
207
231
  }
@@ -1,8 +1,6 @@
1
1
  @use "sass:map";
2
2
 
3
3
  .markdown-body {
4
- --prism-font-family: var(--va-font-mono);
5
-
6
4
  --smc-font-family: var(--va-font-sans);
7
5
 
8
6
  video {
@@ -2,28 +2,28 @@
2
2
  @use "./mixins" as *;
3
3
  @use "./vars" as *;
4
4
 
5
- $c-primary: #0078E7 !default;
5
+ $c-primary: #0078e7 !default;
6
6
 
7
7
  @use "./palette" with (
8
8
  $colors: (
9
- 'primary': $c-primary,
9
+ "primary": $c-primary,
10
10
  )
11
11
  );
12
12
 
13
13
  // common
14
14
  :root {
15
15
  @include set-css-var-from-map($common);
16
- @include set-css-var-from-map($border, 'border');
17
- @include set-css-var-from-map($font, 'font');
18
- @include set-css-var-from-map($transition, 'transition');
16
+ @include set-css-var-from-map($border, "border");
17
+ @include set-css-var-from-map($font, "font");
18
+ @include set-css-var-from-map($transition, "transition");
19
19
  }
20
20
 
21
21
  // colors
22
22
  :root {
23
23
  // palette different with colors
24
- @include set-css-var-from-map(palette.$palette, 'c');
24
+ @include set-css-var-from-map(palette.$palette, "c");
25
25
  // primary
26
- @include set-css-var-from-map(palette.$colors, 'c');
26
+ @include set-css-var-from-map(palette.$colors, "c");
27
27
  }
28
28
 
29
29
  // light
@@ -32,8 +32,31 @@ $c-primary: #0078E7 !default;
32
32
  @include set-css-var-from-map(palette.$light);
33
33
  }
34
34
 
35
+ // code
36
+ :root {
37
+ --va-code-line-height: 1.7;
38
+ --va-code-font-size: 0.875em;
39
+
40
+ --va-code-block-color: var(--va-c-text-dark-1);
41
+ --va-code-block-bg: #282c34;
42
+
43
+ --va-code-line-highlight-color: rgba(0, 0, 0, 0.5);
44
+ --va-code-line-number-color: var(--va-c-text-dark-3);
45
+
46
+ --va-code-copy-code-hover-bg: rgba(255, 255, 255, 0.05);
47
+ --va-code-copy-code-active-text: var(--va-c-text-dark-2);
48
+ }
49
+
35
50
  // dark
36
51
  html.dark {
37
52
  color-scheme: dark;
38
53
  @include set-css-var-from-map(palette.$dark);
39
54
  }
55
+
56
+ /**
57
+ * Icons
58
+ * -------------------------------------------------------------------------- */
59
+ :root {
60
+ --va-icon-copy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' height='20' width='20' stroke='rgba(128,128,128,1)' stroke-width='2' class='h-6 w-6' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 5H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2M9 5a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2M9 5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2'/%3E%3C/svg%3E");
61
+ --va-icon-copied: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' height='20' width='20' stroke='rgba(128,128,128,1)' stroke-width='2' class='h-6 w-6' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 5H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2M9 5a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2M9 5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2m-6 9 2 2 4-4'/%3E%3C/svg%3E");
62
+ }
@@ -11,6 +11,15 @@ $palette: map.merge(
11
11
  "gray": #8e8e8e,
12
12
  "danger": #db2828,
13
13
  "warning": #f2711c,
14
+
15
+ "text-light-1": #213547,
16
+ "text-light-2": rgba(60, 60, 60, 0.7),
17
+ "text-light-3": rgba(60, 60, 60, 0.33),
18
+ "text-light-4": rgba(60, 60, 60, 0.18),
19
+ "text-dark-1": rgba(255, 255, 255, 0.87),
20
+ "text-dark-2": rgba(235, 235, 235, 0.6),
21
+ "text-dark-3": rgba(235, 235, 235, 0.38),
22
+ "text-dark-4": rgba(235, 235, 235, 0.18),
14
23
  ),
15
24
  $palette
16
25
  );
@@ -44,6 +53,9 @@ $light: map.merge(
44
53
  "c-bg": white,
45
54
  "c-bg-light": white,
46
55
  "c-bg-dark": #fafafa,
56
+ "c-bg-alt": #f9f9f9,
57
+ "c-bg-mute": #f1f1f1,
58
+
47
59
  "c-text": #333,
48
60
  "c-text-light": #555,
49
61
  "c-text-lighter": #666,
@@ -69,12 +81,15 @@ $dark: map.merge(
69
81
  "c-bg": #1a1a1a,
70
82
  "c-bg-light": #1d1e1f,
71
83
  "c-bg-dark": #1a1a1a,
84
+ "c-bg-alt": #1a1a1a,
85
+ "c-bg-mute": #2f2f2f,
72
86
 
73
87
  "c-text": #f2f2f2,
74
88
  "c-text-light": #ddd,
75
89
  "c-text-lighter": #eee,
76
90
  "c-text-dark": rgba(#ebebeb, 0.8),
77
91
  "c-link": map.get($colors, "primary-light"),
92
+ "code-block-bg": #151515,
78
93
  ),
79
94
  $dark
80
95
  );
@@ -1,27 +1,41 @@
1
1
  @use "sass:map";
2
2
 
3
3
  $common: () !default;
4
- $common: map.merge((
5
- 'sidebar-width-mobile': 320px,
6
- ), $common);
4
+ $common: map.merge(
5
+ (
6
+ "sidebar-width-mobile": 320px,
7
+ ),
8
+ $common
9
+ );
7
10
 
8
11
  $border: () !default;
9
- $border: map.merge((
10
- 'width': 1px
11
- ), $border);
12
+ $border: map.merge(
13
+ (
14
+ "width": 1px,
15
+ ),
16
+ $border
17
+ );
12
18
 
13
19
  $font: () !default;
14
- $font: map.merge((
15
- 'sans': 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',
16
- 'mono': 'Menlo, Monaco, Consolas, "Courier New", monospace',
17
- 'serif': "'Songti SC', 'Noto Serif SC', STZhongsong, STKaiti, KaiTi, Roboto, serif",
18
- 'serif-weight': 900,
19
- ), $font);
20
+ $font: map.merge(
21
+ (
22
+ "sans":
23
+ 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',
24
+ "mono": 'Menlo, Monaco, Consolas, "Courier New", monospace',
25
+ "serif":
26
+ "'Songti SC', 'Noto Serif SC', STZhongsong, STKaiti, KaiTi, Roboto, serif",
27
+ "serif-weight": 900,
28
+ ),
29
+ $font
30
+ );
20
31
 
21
32
  $transition: () !default;
22
- $transition: map.merge((
23
- 'duration-fast': 0.2s,
24
- 'duration': 0.4s,
25
- 'duration-slow': 0.6s,
26
- '': all var(--va-transition-duration-fast) ease-in-out
27
- ), $transition);
33
+ $transition: map.merge(
34
+ (
35
+ "duration-fast": 0.2s,
36
+ "duration": 0.4s,
37
+ "duration-slow": 0.6s,
38
+ "": all var(--va-transition-duration-fast) ease-in-out,
39
+ ),
40
+ $transition
41
+ );