@1337exp/taoui 2.0.0 → 2.1.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 +9 -0
- package/README.ru.md +10 -0
- package/dist/index.cjs +41 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +28 -0
- package/dist/index.mjs +41 -16
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/styles/index.css +2 -1
- package/src/styles/surface.css +102 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tao UI — Surfaces / Поверхности
|
|
3
|
+
*
|
|
4
|
+
* How a panel is "made": flat fill (default), grain (film grain), glass (blurred translucent).
|
|
5
|
+
* Put `.tao-surface-grain` / `-glass` on any element — a game HUD, a landing section, a sidebar —
|
|
6
|
+
* or pass `surface` to TaoCard / TaoBlock. Theme tokens below tune the look once for the whole app.
|
|
7
|
+
*
|
|
8
|
+
* Из чего «сделана» панель: плоская заливка (по умолчанию), grain (плёночное зерно), glass (размытое
|
|
9
|
+
* полупрозрачное стекло). Класс `.tao-surface-*` — на любой элемент, или проп `surface` у TaoCard / TaoBlock.
|
|
10
|
+
* Токены ниже настраивают вид один раз на всё приложение.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/* The surface belongs to one element: a glass panel does not turn its children into glass.
|
|
14
|
+
Поверхность принадлежит одному элементу: стеклянная панель не делает стеклянными детей. */
|
|
15
|
+
@property --tao-surface-fill {
|
|
16
|
+
syntax: '*';
|
|
17
|
+
inherits: false;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@property --tao-surface-image {
|
|
21
|
+
syntax: '*';
|
|
22
|
+
inherits: false;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@property --tao-surface-image-size {
|
|
26
|
+
syntax: '*';
|
|
27
|
+
inherits: false;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@property --tao-surface-inset {
|
|
31
|
+
syntax: '*';
|
|
32
|
+
inherits: false;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@property --tao-surface-backdrop {
|
|
36
|
+
syntax: '*';
|
|
37
|
+
inherits: false;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* ---------- Theme tokens: dark (default) / Токены темы: тёмная ---------- */
|
|
41
|
+
:root,
|
|
42
|
+
[data-tao-theme="dark"] {
|
|
43
|
+
/* static film grain, light specks; replace with your own image / статичное зерно, светлые крапинки */
|
|
44
|
+
--tao-surface-grain-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0.07 0 0 0 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
|
|
45
|
+
--tao-surface-grain-size: 160px;
|
|
46
|
+
--tao-glass-fill: color-mix(in srgb, var(--tao-color-surface-raised) 55%, transparent);
|
|
47
|
+
--tao-glass-border: rgb(255 255 255 / 0.08);
|
|
48
|
+
--tao-glass-blur: 16px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* ---------- Theme tokens: light / Токены темы: светлая ----------
|
|
52
|
+
After the dark block on purpose: :root and [data-tao-theme] weigh the same, the later one wins.
|
|
53
|
+
Специально после тёмной: :root и [data-tao-theme] весят одинаково, побеждает поздний. */
|
|
54
|
+
[data-tao-theme="light"] {
|
|
55
|
+
/* dark specks / тёмные крапинки */
|
|
56
|
+
--tao-surface-grain-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.035 0 0 0 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
|
|
57
|
+
--tao-glass-fill: color-mix(in srgb, var(--tao-color-surface) 60%, transparent);
|
|
58
|
+
--tao-glass-border: rgb(0 0 0 / 0.08);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* ---------- Classes / Классы ---------- */
|
|
62
|
+
.tao-surface-grain {
|
|
63
|
+
--tao-surface-image: var(--tao-surface-grain-image);
|
|
64
|
+
--tao-surface-image-size: var(--tao-surface-grain-size);
|
|
65
|
+
background-image: var(--tao-surface-image);
|
|
66
|
+
background-size: var(--tao-surface-image-size);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* Glass needs something behind it: use it for things that float over content (popovers, HUD, a header over a scroll).
|
|
70
|
+
Стеклу нужно что-то позади: для того, что плавает над контентом (поповеры, HUD, шапка над прокруткой). */
|
|
71
|
+
.tao-surface-glass {
|
|
72
|
+
--tao-surface-fill: var(--tao-glass-fill);
|
|
73
|
+
/* the edge keeps glass apart from what is behind / край отделяет стекло от того, что позади */
|
|
74
|
+
--tao-surface-inset: inset 0 0 0 1px var(--tao-glass-border);
|
|
75
|
+
--tao-surface-backdrop: blur(var(--tao-glass-blur)) saturate(1.4);
|
|
76
|
+
background-color: var(--tao-surface-fill);
|
|
77
|
+
box-shadow: var(--tao-surface-inset);
|
|
78
|
+
-webkit-backdrop-filter: var(--tao-surface-backdrop);
|
|
79
|
+
backdrop-filter: var(--tao-surface-backdrop);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* No blur support, or the user asked for less transparency: a solid panel.
|
|
83
|
+
Нет размытия или пользователь попросил меньше прозрачности — сплошная панель.
|
|
84
|
+
The token itself turns solid, so components that tint glass (toast, confirm) follow.
|
|
85
|
+
Сплошным становится сам токен — за ним идут и компоненты, которые подкрашивают стекло (toast, confirm). */
|
|
86
|
+
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
|
|
87
|
+
:root,
|
|
88
|
+
[data-tao-theme] {
|
|
89
|
+
--tao-glass-fill: var(--tao-color-surface-raised);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@media (prefers-reduced-transparency: reduce) {
|
|
94
|
+
:root,
|
|
95
|
+
[data-tao-theme] {
|
|
96
|
+
--tao-glass-fill: var(--tao-color-surface-raised);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.tao-surface-glass {
|
|
100
|
+
--tao-surface-backdrop: none;
|
|
101
|
+
}
|
|
102
|
+
}
|