valaxy 0.22.6 → 0.22.8

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/client/main.ts CHANGED
@@ -12,19 +12,9 @@ import AppLink from './components/AppLink.vue'
12
12
  import setupMain from './setup/main'
13
13
 
14
14
  import { setupValaxyDevTools } from './utils/dev'
15
- // reset styles, load css before app
16
- // import '@unocss/reset/tailwind.css'
17
- // https://unocss.dev/guide/style-reset#tailwind-compat
18
- // minus the background color override for buttons to avoid conflicts with UI frameworks
19
- import '@unocss/reset/tailwind-compat.css'
20
15
 
21
- // css
22
- import './styles/css/css-vars.css'
23
-
24
- import './styles/css/main.css'
25
16
  // generate user styles
26
- import '/@valaxyjs/styles'
27
- import 'uno.css'
17
+ import '#valaxy/styles'
28
18
 
29
19
  const valaxyConfig = initValaxyConfig()
30
20
 
package/client/shims.d.ts CHANGED
@@ -1,3 +1,10 @@
1
+ // Types for virtual modules
2
+ // `#valaxy/*` is an alias for `/@valaxyjs/*`, because TS will consider `/@valaxyjs/*` as an absolute path that we can't override
3
+
1
4
  declare module 'virtual:valaxy-theme' {
2
5
  export default any
3
6
  }
7
+
8
+ declare module '#valaxy/styles' {
9
+ // side-effects only
10
+ }
@@ -66,6 +66,27 @@ html.dark {
66
66
  --va-c-text-3: rgba(235, 235, 245, 0.38);
67
67
  }
68
68
 
69
+ // bg
70
+ :root {
71
+ --va-c-bg: #ffffff;
72
+ --va-c-bg-light: #ffffff;
73
+ --va-c-bg-dark: #fafafa;
74
+ --va-c-bg-opacity: rgba(255, 255, 255, 0.8);
75
+ --va-c-bg-soft: #f9f9f9;
76
+ --va-c-bg-alt: #f9f9f9;
77
+ --va-c-bg-mute: #f1f1f1;
78
+ }
79
+
80
+ html.dark {
81
+ --va-c-bg: #1a1a1d;
82
+ --va-c-bg-light: #202127;
83
+ --va-c-bg-dark: #1a1a1a;
84
+ --va-c-bg-opacity: rgba(0, 0, 0, 0.8);
85
+ --va-c-bg-alt: #161618;
86
+ --va-c-bg-soft: #202127;
87
+ --va-c-bg-mute: #2f2f2f;
88
+ }
89
+
69
90
  /* code */
70
91
  :root {
71
92
  --va-code-line-height: 1.7;
@@ -10,3 +10,18 @@ $c-primary: #0078e7 !default;
10
10
  @use "css-i18n/src/styles/index.scss" as *;
11
11
 
12
12
  // components import by yourself
13
+ html,
14
+ body,
15
+ #app {
16
+ margin: 0;
17
+ padding: 0;
18
+ line-height: 2;
19
+ }
20
+
21
+ html {
22
+ background-color: var(--va-c-bg);
23
+ }
24
+
25
+ a {
26
+ cursor: pointer;
27
+ }
@@ -47,8 +47,8 @@ export function scrollTo(el: HTMLElement, hash: string, options: Partial<ScrollT
47
47
  const targetPadding = options?.targetPadding || -64
48
48
  const targetTop
49
49
  = window.scrollY
50
- + (target as HTMLElement).getBoundingClientRect().top
51
- + targetPadding
50
+ + (target as HTMLElement).getBoundingClientRect().top
51
+ + targetPadding
52
52
 
53
53
  // only smooth scroll if distance is smaller than screen height.
54
54
  if (!options.smooth || Math.abs(targetTop - window.scrollY) > window.innerHeight) {