@moubing/bing-ui 0.4.0 → 0.5.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 +43 -4
- package/dist/bing-ui.css +1 -1
- package/dist/bing-ui.es.js +1733 -1707
- package/dist/bing-ui.umd.js +25 -25
- package/dist/components/BingCodeBlock/BingCodeBlock.types.d.ts +3 -1
- package/dist/components/BingCodeBlock/BingCodeBlock.vue.d.ts +1 -1
- package/dist/components/BingCodeBlock/index.d.ts +1 -1
- package/package.json +15 -16
package/README.md
CHANGED
|
@@ -37,10 +37,49 @@ Browser-mode tests always run headlessly. To reuse an installed Chrome when Play
|
|
|
37
37
|
|
|
38
38
|
```ts
|
|
39
39
|
import { BingButton } from '@moubing/bing-ui'
|
|
40
|
-
import '@moubing/bing-ui/style.css'
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
##
|
|
40
|
+
import '@moubing/bing-ui/style.css'
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Themes
|
|
44
|
+
|
|
45
|
+
The bundled stylesheet includes `light`, `dark`, and `system` themes. Light remains the
|
|
46
|
+
default when no theme attribute is present. The light theme uses the library's signature
|
|
47
|
+
pink interaction accent, while dark mode shifts the semantic accent toward night purple;
|
|
48
|
+
the original pink palette remains available for brand and decorative details.
|
|
49
|
+
|
|
50
|
+
Set the theme on the document element so components teleported to `body` inherit the
|
|
51
|
+
same tokens as their triggers:
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
document.documentElement.dataset.bingTheme = 'dark'
|
|
55
|
+
|
|
56
|
+
// Follow the operating-system preference.
|
|
57
|
+
document.documentElement.dataset.bingTheme = 'system'
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Apply a persisted theme before mounting Vue to avoid a light-to-dark flash during startup.
|
|
61
|
+
Applications can override any semantic token after importing the library stylesheet:
|
|
62
|
+
|
|
63
|
+
```css
|
|
64
|
+
html[data-bing-theme='dark'] {
|
|
65
|
+
--bing-accent-rgb: 251 113 133;
|
|
66
|
+
--bing-accent-strong-rgb: 254 205 211;
|
|
67
|
+
--bing-accent-solid-rgb: 253 164 175;
|
|
68
|
+
--bing-accent: #fb7185;
|
|
69
|
+
--bing-accent-strong: #fecdd3;
|
|
70
|
+
--bing-accent-solid: #fda4af;
|
|
71
|
+
--bing-focus: rgb(var(--bing-accent-rgb) / 0.62);
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
The first theme release intentionally uses the document element as its scope. This keeps
|
|
76
|
+
regular components and overlays teleported to `body` on the same theme.
|
|
77
|
+
|
|
78
|
+
`BingCodeBlock` uses `theme="auto"` by default, mapping light mode to `vitesse-light`
|
|
79
|
+
and dark mode to the higher-contrast `github-dark` palette. Pass an explicit Shiki theme
|
|
80
|
+
name when a code sample must remain fixed independently of the application theme.
|
|
81
|
+
|
|
82
|
+
## Project Layout
|
|
44
83
|
|
|
45
84
|
```txt
|
|
46
85
|
src/
|