@1337exp/taoui 5.27.1 → 5.29.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/CHANGELOG.md +707 -697
- package/README.md +1 -0
- package/README.ru.md +1 -0
- package/dist/index.d.ts +252 -178
- package/dist/index.js +256 -142
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +105 -105
- package/skills/taoui/SKILL.md +1 -1
- package/skills/taoui/references/components.md +1297 -1282
- package/src/styles/contexts/stretch.css +62 -0
- package/src/styles/index.css +1 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tao UI — Stretched link context / Контекст растянутой ссылки
|
|
3
|
+
*
|
|
4
|
+
* A whole card, row or tile that is one link, while the buttons inside it still work on their own. The link keeps its
|
|
5
|
+
* place in the markup (a title, a "View" button); its `::after` is stretched over the nearest positioned ancestor, so a click anywhere
|
|
6
|
+
* on that ancestor goes to the link.
|
|
7
|
+
*
|
|
8
|
+
* .tao-stretched the container the link stretches over (it is `position: relative`)
|
|
9
|
+
* .tao-stretched-link the link itself; `<TaoStretchedLink>` is a `<TaoLink>` with this class, any `<a>` can take it
|
|
10
|
+
* .tao-stretched-raise a control that must stay clickable on its own (a button, a second link): it sits above the stretched layer
|
|
11
|
+
*
|
|
12
|
+
* --tao-stretched-radius the corners of the focus ring, so it follows the container (default: the radius of a panel)
|
|
13
|
+
*
|
|
14
|
+
* The keyboard sees one link; its focus ring goes round the whole container (inside its edge, so a container with
|
|
15
|
+
* `overflow: hidden` does not cut it).
|
|
16
|
+
*
|
|
17
|
+
* Do not put `filter`, `transform`, `perspective`, `will-change: transform` or `contain` on the link (on `:hover`
|
|
18
|
+
* too): such a property makes the link the containing block of its own `::after`, the stretched layer shrinks to the
|
|
19
|
+
* link, the pointer is no longer over it, the property goes, the layer stretches back, and so on every frame (the cursor
|
|
20
|
+
* flickers). Light the link with a colour (`background`, `color-mix`), or put the effect on an inner element. On the container it is fine.
|
|
21
|
+
*
|
|
22
|
+
* Целая карточка, строка или плитка как одна ссылка, при этом кнопки внутри нажимаются сами по себе. Ссылка остаётся на своём
|
|
23
|
+
* месте в разметке (заголовок, кнопка «Посмотреть»), её `::after` растягивается на ближайшего позиционированного предка, и клик в
|
|
24
|
+
* любом месте предка уходит в ссылку.
|
|
25
|
+
*
|
|
26
|
+
* .tao-stretched контейнер, на который растягивается ссылка (`position: relative`)
|
|
27
|
+
* .tao-stretched-link сама ссылка; `<TaoStretchedLink>` это `<TaoLink>` с этим классом, класс можно дать любому `<a>`
|
|
28
|
+
* .tao-stretched-raise элемент, который должен нажиматься сам (кнопка, вторая ссылка): он выше растянутого слоя
|
|
29
|
+
*
|
|
30
|
+
* --tao-stretched-radius скругление кольца фокуса, чтобы оно повторяло контейнер (по умолчанию радиус панели)
|
|
31
|
+
*
|
|
32
|
+
* Клавиатура видит одну ссылку; кольцо фокуса идёт по всему контейнеру (внутри его края, чтобы `overflow: hidden` не обрезал).
|
|
33
|
+
*
|
|
34
|
+
* Не давайте ссылке `filter`, `transform`, `perspective`, `will-change: transform` и `contain` (и на `:hover` тоже): такое свойство
|
|
35
|
+
* делает ссылку опорным блоком для её же `::after`, слой сжимается до ссылки, курсор оказывается уже не над ним, свойство
|
|
36
|
+
* пропадает, слой снова растягивается, и так каждый кадр (курсор мигает). Подсвечивайте ссылку цветом (`background`, `color-mix`)
|
|
37
|
+
* или вешайте эффект на внутренний элемент. Контейнеру это можно.
|
|
38
|
+
*/
|
|
39
|
+
.tao-stretched {
|
|
40
|
+
position: relative;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.tao-stretched-link::after {
|
|
44
|
+
content: '';
|
|
45
|
+
position: absolute;
|
|
46
|
+
inset: 0;
|
|
47
|
+
border-radius: var(--tao-stretched-radius, var(--tao-radius-panel));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.tao-stretched-link:focus-visible {
|
|
51
|
+
outline: none;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.tao-stretched-link:focus-visible::after {
|
|
55
|
+
outline: 2px solid var(--tao-color-accent);
|
|
56
|
+
outline-offset: -2px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.tao-stretched-raise {
|
|
60
|
+
position: relative;
|
|
61
|
+
z-index: 1;
|
|
62
|
+
}
|