@channel.io/bezier-tokens 0.2.13 → 0.3.1
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 +35 -10
- package/dist/alpha/cjs/darkTheme.js +6 -6
- package/dist/alpha/cjs/global.js +1 -0
- package/dist/alpha/css/styles.css +7 -6
- package/dist/alpha/esm/darkTheme.mjs +6 -6
- package/dist/alpha/esm/global.mjs +1 -0
- package/dist/alpha/scss/dark-theme.scss +628 -0
- package/dist/alpha/scss/global.scss +922 -0
- package/dist/alpha/scss/index.scss +9 -0
- package/dist/alpha/scss/light-theme.scss +628 -0
- package/dist/scss/dark-theme.scss +294 -0
- package/dist/scss/global.scss +530 -0
- package/dist/scss/index.scss +9 -0
- package/dist/scss/light-theme.scss +294 -0
- package/dist/types/alpha/cjs/darkTheme.d.ts +9 -9
- package/dist/types/alpha/cjs/global.d.ts +3 -0
- package/dist/types/alpha/cjs/index.d.ts +12 -9
- package/dist/types/alpha/esm/darkTheme.d.mts +9 -9
- package/dist/types/alpha/esm/global.d.mts +3 -0
- package/dist/types/alpha/esm/index.d.mts +12 -9
- package/dist/types/alpha/esm/index.d.mts.map +1 -1
- package/package.json +12 -7
package/README.md
CHANGED
|
@@ -10,29 +10,54 @@ npm i -D @channel.io/bezier-tokens
|
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
|
-
###
|
|
13
|
+
### CSS
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Provide all design tokens as CSS variables. If you want to apply dark theme tokens, add the `data-bezier-theme="dark"` attribute to the parent element. The default is light theme tokens, which can also be applied by adding the `data-bezier-theme="light"` attribute to the parent element.
|
|
16
16
|
|
|
17
17
|
```ts
|
|
18
|
-
import
|
|
18
|
+
import '@channel.io/bezier-tokens/css/styles.css'
|
|
19
|
+
```
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
```html
|
|
22
|
+
<div data-bezier-theme="light">
|
|
23
|
+
<div class="foo" />
|
|
24
|
+
<div data-bezier-theme="dark">
|
|
25
|
+
<div class="foo" />
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
22
28
|
```
|
|
23
29
|
|
|
24
|
-
|
|
30
|
+
```css
|
|
31
|
+
.foo {
|
|
32
|
+
background-color: var(--bg-black-dark);
|
|
33
|
+
}
|
|
34
|
+
```
|
|
25
35
|
|
|
26
|
-
|
|
36
|
+
### SCSS
|
|
27
37
|
|
|
28
|
-
|
|
29
|
-
|
|
38
|
+
While CSS variables are recommended, you can also use SCSS variables directly if you need to.
|
|
39
|
+
|
|
40
|
+
```scss
|
|
41
|
+
@use "sass:map";
|
|
42
|
+
@use "pkg:@channel.io/bezier-tokens" as *;
|
|
30
43
|
|
|
31
44
|
div {
|
|
32
|
-
|
|
45
|
+
border-radius: map.get($tokens, "global", "radius", "4"); // ...px
|
|
46
|
+
background-color: map.get($tokens, "light-theme", "bg", "black", "dark"); // #...
|
|
33
47
|
}
|
|
34
48
|
```
|
|
35
49
|
|
|
50
|
+
### JavaScript
|
|
51
|
+
|
|
52
|
+
You can access and use values by token group.
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
import { tokens } from '@channel.io/bezier-tokens'
|
|
56
|
+
|
|
57
|
+
console.log(tokens.global.color['blue-300']) // "#..."
|
|
58
|
+
console.log(tokens.lightTheme.color['bg-black-dark']) // "#..."
|
|
59
|
+
```
|
|
60
|
+
|
|
36
61
|
## Contributing
|
|
37
62
|
|
|
38
63
|
See [contribution guide](https://github.com/channel-io/bezier-react/wiki/Contribute).
|
|
@@ -387,12 +387,12 @@ module.exports = Object.freeze({
|
|
|
387
387
|
"alpha-color-bg-absolute-white-lightest-hovered": Object.freeze({"value":"#ededed4d"}),
|
|
388
388
|
"alpha-color-bg-absolute-white-transparent": Object.freeze({"value":"#ffffff00","ref":"alpha-color-white-0"}),
|
|
389
389
|
"alpha-color-bg-absolute-white-transparent-hovered": Object.freeze({"value":"#ffffff0d"}),
|
|
390
|
-
"alpha-color-surface-lowest": Object.freeze({"value":"#
|
|
391
|
-
"alpha-color-surface-lowest-hovered": Object.freeze({"value":"#
|
|
392
|
-
"alpha-color-surface-lower": Object.freeze({"value":"#
|
|
393
|
-
"alpha-color-surface-lower-hovered": Object.freeze({"value":"#
|
|
394
|
-
"alpha-color-surface-normal": Object.freeze({"value":"#
|
|
395
|
-
"alpha-color-surface-normal-hovered": Object.freeze({"value":"#
|
|
390
|
+
"alpha-color-surface-lowest": Object.freeze({"value":"#2a2b2d","ref":"alpha-color-grey-850"}),
|
|
391
|
+
"alpha-color-surface-lowest-hovered": Object.freeze({"value":"#343538ff"}),
|
|
392
|
+
"alpha-color-surface-lower": Object.freeze({"value":"#242428","ref":"alpha-color-grey-900"}),
|
|
393
|
+
"alpha-color-surface-lower-hovered": Object.freeze({"value":"#2e2e33ff"}),
|
|
394
|
+
"alpha-color-surface-normal": Object.freeze({"value":"#1a1a1c","ref":"alpha-color-grey-950"}),
|
|
395
|
+
"alpha-color-surface-normal-hovered": Object.freeze({"value":"#242427ff"}),
|
|
396
396
|
"alpha-color-shadow-xlarge": Object.freeze({"value":"#00000099","ref":"alpha-color-black-60"}),
|
|
397
397
|
"alpha-color-shadow-xlarge-hovered": Object.freeze({"value":"#0a0a0a99"}),
|
|
398
398
|
"alpha-color-shadow-large": Object.freeze({"value":"#00000066","ref":"alpha-color-black-40"}),
|
package/dist/alpha/cjs/global.js
CHANGED
|
@@ -189,6 +189,7 @@ module.exports = Object.freeze({
|
|
|
189
189
|
"alpha-color-grey-800": Object.freeze({"value":"#313234"}),
|
|
190
190
|
"alpha-color-grey-850": Object.freeze({"value":"#2a2b2d"}),
|
|
191
191
|
"alpha-color-grey-900": Object.freeze({"value":"#242428"}),
|
|
192
|
+
"alpha-color-grey-950": Object.freeze({"value":"#1a1a1c"}),
|
|
192
193
|
"alpha-color-grey-900-0": Object.freeze({"value":"#24242800"}),
|
|
193
194
|
"alpha-color-grey-alpha-900-90": Object.freeze({"value":"#242428e6"}),
|
|
194
195
|
"alpha-color-grey-alpha-850-80": Object.freeze({"value":"#2a2b2dcc"}),
|
|
@@ -382,12 +382,12 @@
|
|
|
382
382
|
--alpha-color-bg-absolute-white-lightest-hovered: #ededed4d;
|
|
383
383
|
--alpha-color-bg-absolute-white-transparent: var(--alpha-color-white-0);
|
|
384
384
|
--alpha-color-bg-absolute-white-transparent-hovered: #ffffff0d;
|
|
385
|
-
--alpha-color-surface-lowest: var(--alpha-color-grey-
|
|
386
|
-
--alpha-color-surface-lowest-hovered: #
|
|
387
|
-
--alpha-color-surface-lower: var(--alpha-color-grey-
|
|
388
|
-
--alpha-color-surface-lower-hovered: #
|
|
389
|
-
--alpha-color-surface-normal: var(--alpha-color-grey-
|
|
390
|
-
--alpha-color-surface-normal-hovered: #
|
|
385
|
+
--alpha-color-surface-lowest: var(--alpha-color-grey-850);
|
|
386
|
+
--alpha-color-surface-lowest-hovered: #343538ff;
|
|
387
|
+
--alpha-color-surface-lower: var(--alpha-color-grey-900);
|
|
388
|
+
--alpha-color-surface-lower-hovered: #2e2e33ff;
|
|
389
|
+
--alpha-color-surface-normal: var(--alpha-color-grey-950);
|
|
390
|
+
--alpha-color-surface-normal-hovered: #242427ff;
|
|
391
391
|
--alpha-color-shadow-xlarge: var(--alpha-color-black-60);
|
|
392
392
|
--alpha-color-shadow-xlarge-hovered: #0a0a0a99;
|
|
393
393
|
--alpha-color-shadow-large: var(--alpha-color-black-40);
|
|
@@ -676,6 +676,7 @@
|
|
|
676
676
|
--alpha-color-grey-800: #313234;
|
|
677
677
|
--alpha-color-grey-850: #2a2b2d;
|
|
678
678
|
--alpha-color-grey-900: #242428;
|
|
679
|
+
--alpha-color-grey-950: #1a1a1c;
|
|
679
680
|
--alpha-color-grey-900-0: #24242800;
|
|
680
681
|
--alpha-color-grey-alpha-900-90: #242428e6;
|
|
681
682
|
--alpha-color-grey-alpha-850-80: #2a2b2dcc;
|
|
@@ -387,12 +387,12 @@ export default Object.freeze({
|
|
|
387
387
|
"alpha-color-bg-absolute-white-lightest-hovered": Object.freeze({"value":"#ededed4d"}),
|
|
388
388
|
"alpha-color-bg-absolute-white-transparent": Object.freeze({"value":"#ffffff00","ref":"alpha-color-white-0"}),
|
|
389
389
|
"alpha-color-bg-absolute-white-transparent-hovered": Object.freeze({"value":"#ffffff0d"}),
|
|
390
|
-
"alpha-color-surface-lowest": Object.freeze({"value":"#
|
|
391
|
-
"alpha-color-surface-lowest-hovered": Object.freeze({"value":"#
|
|
392
|
-
"alpha-color-surface-lower": Object.freeze({"value":"#
|
|
393
|
-
"alpha-color-surface-lower-hovered": Object.freeze({"value":"#
|
|
394
|
-
"alpha-color-surface-normal": Object.freeze({"value":"#
|
|
395
|
-
"alpha-color-surface-normal-hovered": Object.freeze({"value":"#
|
|
390
|
+
"alpha-color-surface-lowest": Object.freeze({"value":"#2a2b2d","ref":"alpha-color-grey-850"}),
|
|
391
|
+
"alpha-color-surface-lowest-hovered": Object.freeze({"value":"#343538ff"}),
|
|
392
|
+
"alpha-color-surface-lower": Object.freeze({"value":"#242428","ref":"alpha-color-grey-900"}),
|
|
393
|
+
"alpha-color-surface-lower-hovered": Object.freeze({"value":"#2e2e33ff"}),
|
|
394
|
+
"alpha-color-surface-normal": Object.freeze({"value":"#1a1a1c","ref":"alpha-color-grey-950"}),
|
|
395
|
+
"alpha-color-surface-normal-hovered": Object.freeze({"value":"#242427ff"}),
|
|
396
396
|
"alpha-color-shadow-xlarge": Object.freeze({"value":"#00000099","ref":"alpha-color-black-60"}),
|
|
397
397
|
"alpha-color-shadow-xlarge-hovered": Object.freeze({"value":"#0a0a0a99"}),
|
|
398
398
|
"alpha-color-shadow-large": Object.freeze({"value":"#00000066","ref":"alpha-color-black-40"}),
|
|
@@ -189,6 +189,7 @@ export default Object.freeze({
|
|
|
189
189
|
"alpha-color-grey-800": Object.freeze({"value":"#313234"}),
|
|
190
190
|
"alpha-color-grey-850": Object.freeze({"value":"#2a2b2d"}),
|
|
191
191
|
"alpha-color-grey-900": Object.freeze({"value":"#242428"}),
|
|
192
|
+
"alpha-color-grey-950": Object.freeze({"value":"#1a1a1c"}),
|
|
192
193
|
"alpha-color-grey-900-0": Object.freeze({"value":"#24242800"}),
|
|
193
194
|
"alpha-color-grey-alpha-900-90": Object.freeze({"value":"#242428e6"}),
|
|
194
195
|
"alpha-color-grey-alpha-850-80": Object.freeze({"value":"#2a2b2dcc"}),
|