@taiga-ui/styles 4.71.1 → 5.0.0-canary.2da416d
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/components/appearance.less +51 -0
- package/components/avatar.less +192 -0
- package/components/badge.less +127 -0
- package/components/block.less +118 -0
- package/components/button.less +135 -0
- package/components/checkbox.less +84 -0
- package/components/chip.less +131 -0
- package/components/comment.less +63 -0
- package/components/compass.less +49 -0
- package/components/group.less +172 -0
- package/components/icon.less +83 -0
- package/components/icons.less +79 -0
- package/components/label.less +51 -0
- package/components/like.less +67 -0
- package/components/link.less +69 -0
- package/components/message.less +33 -0
- package/components/notification.less +181 -0
- package/components/pin.less +164 -0
- package/components/progress-bar.less +117 -0
- package/components/radio.less +59 -0
- package/components/status.less +40 -0
- package/components/switch.less +104 -0
- package/components/textfield.less +362 -0
- package/components/title.less +80 -0
- package/components/toast.less +44 -0
- package/mixins/appearance.less +56 -0
- package/mixins/appearance.scss +57 -0
- package/mixins/browsers.less +23 -0
- package/mixins/browsers.scss +23 -0
- package/mixins/date-picker.less +152 -0
- package/mixins/date-picker.scss +152 -0
- package/mixins/miscellaneous.less +168 -0
- package/mixins/miscellaneous.scss +162 -0
- package/mixins/slider.less +67 -0
- package/mixins/slider.scss +67 -0
- package/package.json +9 -2
- package/taiga-ui-fonts.less +4 -0
- package/taiga-ui-theme.less +4 -0
- package/theme/appearance/accent.less +14 -0
- package/theme/appearance/action.less +38 -0
- package/theme/appearance/flat.less +23 -0
- package/theme/appearance/floating.less +21 -0
- package/theme/appearance/glass.less +30 -0
- package/theme/appearance/outline.less +78 -0
- package/theme/appearance/primary.less +48 -0
- package/theme/appearance/secondary.less +77 -0
- package/theme/appearance/status.less +125 -0
- package/theme/appearance/table.less +68 -0
- package/theme/appearance/textfield.less +80 -0
- package/theme/appearance.less +12 -0
- package/theme/palette.less +161 -0
- package/theme/variables.less +71 -0
- package/utils.less +6 -0
- package/utils.scss +6 -0
- package/variables/media.less +23 -0
- package/variables/media.scss +23 -0
- package/basic/keyframes.less +0 -19
- package/basic/main.less +0 -80
- package/markup/tui-container.less +0 -64
- package/markup/tui-form.less +0 -145
- package/markup/tui-island.less +0 -200
- package/markup/tui-list.less +0 -136
- package/markup/tui-mobile-only.less +0 -5
- package/markup/tui-required.less +0 -13
- package/markup/tui-row.less +0 -139
- package/markup/tui-skeleton.less +0 -43
- package/markup/tui-space.less +0 -52
- package/markup/tui-table.less +0 -184
- package/markup/tui-text.less +0 -61
- package/project.json +0 -35
- package/taiga-ui-global.less +0 -14
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
@import '@taiga-ui/styles/utils.less';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @name Chip
|
|
5
|
+
* @selector [tuiChip]
|
|
6
|
+
*
|
|
7
|
+
* @description
|
|
8
|
+
* A chip component that can be used on it's own or on buttons/links/inputs
|
|
9
|
+
*
|
|
10
|
+
* @attributes
|
|
11
|
+
* data-size — size (default: 's') ('xxs' | 'xs' | 's' | 'm')
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* <span tuiChip>Sale</span>
|
|
15
|
+
*
|
|
16
|
+
* @see-also
|
|
17
|
+
* Icons, Appearance, Badge, Block
|
|
18
|
+
*/
|
|
19
|
+
[tuiChip]:where(*&) {
|
|
20
|
+
--t-gap: 0.125rem;
|
|
21
|
+
--t-margin: -0.125rem;
|
|
22
|
+
--t-icon-size: 1rem;
|
|
23
|
+
--t-padding: 0 0.625rem;
|
|
24
|
+
--t-size: var(--tui-height-s);
|
|
25
|
+
|
|
26
|
+
.button-base();
|
|
27
|
+
|
|
28
|
+
font: var(--tui-typography-body-s);
|
|
29
|
+
border-radius: var(--tui-radius-m);
|
|
30
|
+
padding: var(--t-padding);
|
|
31
|
+
block-size: var(--t-size);
|
|
32
|
+
inline-size: fit-content;
|
|
33
|
+
max-inline-size: 100%;
|
|
34
|
+
isolation: isolate;
|
|
35
|
+
|
|
36
|
+
.interactive({
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
> tui-icon,
|
|
41
|
+
&[tuiIcons]::before,
|
|
42
|
+
&[tuiIcons]::after {
|
|
43
|
+
font-size: var(--t-icon-size) !important;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
& > [tuiIconButton] {
|
|
47
|
+
margin: -0.375rem;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
> [tuiBadge] {
|
|
51
|
+
margin-inline-end: 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&[data-size='xxs'] {
|
|
55
|
+
// StackBlitz changes "0rem" to "0" breaking calc
|
|
56
|
+
--t-gap: ~'0rem';
|
|
57
|
+
--t-padding: 0 0.25rem;
|
|
58
|
+
--t-size: 1rem;
|
|
59
|
+
--t-icon-size: 0.75rem;
|
|
60
|
+
|
|
61
|
+
font: var(--tui-typography-body-xs);
|
|
62
|
+
border-radius: var(--tui-radius-xs);
|
|
63
|
+
|
|
64
|
+
& > [tuiIconButton] {
|
|
65
|
+
margin: -0.5rem;
|
|
66
|
+
transform: scale(0.75);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&[data-size='xs'] {
|
|
71
|
+
--t-padding: 0 0.375rem;
|
|
72
|
+
--t-size: var(--tui-height-xs);
|
|
73
|
+
|
|
74
|
+
border-radius: var(--tui-radius-xs);
|
|
75
|
+
|
|
76
|
+
& > [tuiIconButton] {
|
|
77
|
+
margin: -0.375rem;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&[data-size='m'] {
|
|
82
|
+
--t-margin: -0.375rem;
|
|
83
|
+
--t-icon-size: 1.5rem;
|
|
84
|
+
--t-padding: 0 1rem;
|
|
85
|
+
--t-size: var(--tui-height-m);
|
|
86
|
+
|
|
87
|
+
font: var(--tui-typography-body-m);
|
|
88
|
+
|
|
89
|
+
& > [tuiIconButton] {
|
|
90
|
+
margin: -0.75rem;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
& > [tuiBadge] {
|
|
94
|
+
margin-inline-start: -0.375rem;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
& > img,
|
|
99
|
+
[tuiAvatar] {
|
|
100
|
+
inline-size: 1.5rem;
|
|
101
|
+
margin-inline-start: -0.375rem;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
& > [tuiFade] {
|
|
105
|
+
&:first-of-type {
|
|
106
|
+
flex: 1 0 30%;
|
|
107
|
+
max-inline-size: fit-content;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&:last-of-type {
|
|
111
|
+
flex: 0 1 auto;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
& > input[tuiChip] {
|
|
116
|
+
.fullsize();
|
|
117
|
+
|
|
118
|
+
margin: 0;
|
|
119
|
+
|
|
120
|
+
&[type='checkbox'],
|
|
121
|
+
&[type='radio'] {
|
|
122
|
+
z-index: -1;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
input[tuiChip]:where(*&) {
|
|
128
|
+
.interactive({
|
|
129
|
+
cursor: text;
|
|
130
|
+
});
|
|
131
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
@import '@taiga-ui/styles/utils.less';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @name Comment
|
|
5
|
+
* @selector [tuiComment]
|
|
6
|
+
*
|
|
7
|
+
* @description
|
|
8
|
+
* A comment bubble with an arrow
|
|
9
|
+
*
|
|
10
|
+
* @attributes
|
|
11
|
+
* data-direction — arrow direction (default: 'top') ('top' | 'bottom' | 'start' | 'end')
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* <label data-direction="top" tuiComment>Amazing product!</label>
|
|
15
|
+
*/
|
|
16
|
+
[tuiComment]:where(*&) {
|
|
17
|
+
position: relative;
|
|
18
|
+
display: inline-flex;
|
|
19
|
+
font: var(--tui-typography-ui-m);
|
|
20
|
+
color: #fff;
|
|
21
|
+
padding: 0.5rem 0.75rem;
|
|
22
|
+
min-inline-size: 2.5rem;
|
|
23
|
+
border-radius: 1rem;
|
|
24
|
+
background: var(--tui-background-accent-2);
|
|
25
|
+
align-items: center;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
|
|
28
|
+
&::before {
|
|
29
|
+
content: '';
|
|
30
|
+
position: absolute;
|
|
31
|
+
inset-block-end: 100%;
|
|
32
|
+
inset-inline-start: 50%;
|
|
33
|
+
inline-size: 1.5625rem;
|
|
34
|
+
block-size: 0.5625rem;
|
|
35
|
+
background: inherit;
|
|
36
|
+
transform: translate(calc(-50% * var(--tui-inline)));
|
|
37
|
+
mask: url("data:image/svg+xml,%3Csvg width='25' height='9' viewBox='0 0 25 9' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.23309 6.67813L7.56191 3.83178C9.4546 1.5185 10.4009 0.361853 11.5998 0.10488C12.0834 0.00123882 12.5834 0.00123882 13.0669 0.10488C14.2658 0.361853 15.2121 1.5185 17.1048 3.83178L19.4337 6.67813C20.636 8.14771 22.4346 9 24.3334 9H0.333374C2.23217 9 4.0307 8.14772 5.23309 6.67813Z' fill='black'/%3E%3C/svg%3E%0A")
|
|
38
|
+
no-repeat;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&[data-direction='bottom'] {
|
|
42
|
+
&::before {
|
|
43
|
+
inset-block: 100% auto;
|
|
44
|
+
transform: translate(calc(-50% * var(--tui-inline))) rotate(180deg);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&[data-direction='start'] {
|
|
49
|
+
&::before {
|
|
50
|
+
inset-block: 50% 100%;
|
|
51
|
+
inset-inline: auto 100%;
|
|
52
|
+
transform: translate(calc(0.785rem * var(--tui-inline)), -50%) rotate(calc(-90deg * var(--tui-inline)));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&[data-direction='end'] {
|
|
57
|
+
&::before {
|
|
58
|
+
inset-block: 50% 100%;
|
|
59
|
+
inset-inline: 100% auto;
|
|
60
|
+
transform: translate(calc(-0.785rem * var(--tui-inline)), -50%) rotate(calc(90deg * var(--tui-inline)));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
@import '@taiga-ui/styles/utils.less';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @name Compass
|
|
5
|
+
* @selector tui-compass
|
|
6
|
+
*
|
|
7
|
+
* @description
|
|
8
|
+
* A compass arrow for the map
|
|
9
|
+
*
|
|
10
|
+
* @vars
|
|
11
|
+
* --t-degrees — rotation
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* <tui-compass style="--t-degrees: 45deg"></tui-compass>
|
|
15
|
+
*
|
|
16
|
+
* @see-also
|
|
17
|
+
* Pin
|
|
18
|
+
*/
|
|
19
|
+
tui-compass:where(*&) {
|
|
20
|
+
position: relative;
|
|
21
|
+
display: inline-block;
|
|
22
|
+
color: var(--tui-background-accent-1);
|
|
23
|
+
border-radius: 50%;
|
|
24
|
+
inline-size: 1rem;
|
|
25
|
+
block-size: 1rem;
|
|
26
|
+
border: 0.1875rem solid var(--tui-background-base);
|
|
27
|
+
box-shadow: 0 0 0.1875rem rgba(0, 0, 0, 0.3);
|
|
28
|
+
transform-style: preserve-3d; // z-index doesn't work on pseudo-element
|
|
29
|
+
|
|
30
|
+
&::before {
|
|
31
|
+
content: '';
|
|
32
|
+
position: absolute;
|
|
33
|
+
top: 0;
|
|
34
|
+
left: 0.125rem;
|
|
35
|
+
mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"><path d="M0 8.99993C4 8 8 8 12 8.99993C9.91509 5.73239 8.5 3 6 0C3.5 3 2 5.5 0 8.99993Z"/></svg>');
|
|
36
|
+
transform: rotate(var(--t-degrees)) translateY(-0.625rem) translateZ(-1rem);
|
|
37
|
+
inline-size: 0.75rem;
|
|
38
|
+
block-size: 1rem;
|
|
39
|
+
background: currentColor;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&::after {
|
|
43
|
+
.fullsize(absolute, inset);
|
|
44
|
+
|
|
45
|
+
content: '';
|
|
46
|
+
border-radius: inherit;
|
|
47
|
+
background: currentColor linear-gradient(-45deg, rgba(0, 0, 0, 0.2), transparent);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @name Group
|
|
3
|
+
* @selector [tuiGroup]
|
|
4
|
+
*
|
|
5
|
+
* @description
|
|
6
|
+
* A directive to combine children into rounded flex group
|
|
7
|
+
*
|
|
8
|
+
* @attributes
|
|
9
|
+
* data-size — size (default: 'l') ('s' | 'm' | 'l')
|
|
10
|
+
* data-orientation — orientation (default: 'horizontal') ('horizontal' | 'vertical')
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* <div tuiGroup>
|
|
14
|
+
* <button tuiButton>Click me</button>
|
|
15
|
+
* <button tuiButton>Click me</button>
|
|
16
|
+
* <button tuiButton>Click me</button>
|
|
17
|
+
* </div>
|
|
18
|
+
*
|
|
19
|
+
* @see-also
|
|
20
|
+
* Button, Block, Textfield
|
|
21
|
+
*/
|
|
22
|
+
[tuiGroup]:where(*&) {
|
|
23
|
+
position: relative;
|
|
24
|
+
display: flex;
|
|
25
|
+
transform: translate3d(0, 0, 0);
|
|
26
|
+
|
|
27
|
+
--t-group-radius: var(--tui-radius-l);
|
|
28
|
+
--t-group-margin: -1px;
|
|
29
|
+
--t-group-mask: linear-gradient(
|
|
30
|
+
to right,
|
|
31
|
+
rgba(0, 0, 0, 0.5) 1px,
|
|
32
|
+
#000 2px,
|
|
33
|
+
#000 calc(100% - 2px),
|
|
34
|
+
rgba(0, 0, 0, 0.5)
|
|
35
|
+
);
|
|
36
|
+
--t-group-mask-end: linear-gradient(to right, rgba(0, 0, 0, 0.5) 1px, #000 2px);
|
|
37
|
+
--t-group-mask-start: linear-gradient(to right, #000 calc(100% - 2px), rgba(0, 0, 0, 0.5) calc(100% - 1px));
|
|
38
|
+
|
|
39
|
+
& > * {
|
|
40
|
+
z-index: 1;
|
|
41
|
+
flex: 1 1 0;
|
|
42
|
+
min-inline-size: 0;
|
|
43
|
+
mask: var(--t-group-mask);
|
|
44
|
+
mask-clip: no-clip;
|
|
45
|
+
|
|
46
|
+
&:disabled,
|
|
47
|
+
&._disabled {
|
|
48
|
+
z-index: 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&:invalid:not([data-mode]),
|
|
52
|
+
&[data-mode~='invalid'] {
|
|
53
|
+
z-index: 2;
|
|
54
|
+
|
|
55
|
+
--t-group-mask: none;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&:has(:invalid:not([data-mode])),
|
|
59
|
+
&:has([data-mode~='invalid']) {
|
|
60
|
+
z-index: 2;
|
|
61
|
+
|
|
62
|
+
--t-group-mask: none;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&:has(:focus-visible) {
|
|
66
|
+
z-index: 3;
|
|
67
|
+
|
|
68
|
+
--t-group-mask: none;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&:has([data-focus='true']) {
|
|
72
|
+
z-index: 3;
|
|
73
|
+
|
|
74
|
+
--t-group-mask: none;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&:checked:not([data-mode]),
|
|
78
|
+
&[data-mode~='checked'] {
|
|
79
|
+
z-index: 4;
|
|
80
|
+
|
|
81
|
+
--t-group-mask: none;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&:has([tuiBlock]:checked) {
|
|
85
|
+
z-index: 4;
|
|
86
|
+
|
|
87
|
+
--t-group-mask: none;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&:not(:last-child) {
|
|
91
|
+
margin-inline-end: var(--t-group-margin);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&:nth-child(n) {
|
|
95
|
+
border-radius: 0;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&:first-child {
|
|
99
|
+
border-radius: var(--t-group-radius) 0 0 var(--t-group-radius);
|
|
100
|
+
mask-image: var(--t-group-mask-start);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&:last-child {
|
|
104
|
+
border-radius: 0 var(--t-group-radius) var(--t-group-radius) 0;
|
|
105
|
+
mask-image: var(--t-group-mask-end);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&:only-child {
|
|
109
|
+
border-radius: var(--t-group-radius);
|
|
110
|
+
mask: none;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
[dir='rtl'] &:not([data-orientation='vertical']) > * {
|
|
115
|
+
&:first-child {
|
|
116
|
+
border-radius: 0 var(--t-group-radius) var(--t-group-radius) 0;
|
|
117
|
+
mask-image: var(--t-group-mask-end);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&:last-child {
|
|
121
|
+
border-radius: var(--t-group-radius) 0 0 var(--t-group-radius);
|
|
122
|
+
mask-image: var(--t-group-mask-start);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
&:only-child {
|
|
126
|
+
border-radius: var(--t-group-radius);
|
|
127
|
+
mask: none;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
&[data-size='s'],
|
|
132
|
+
&[data-size='m'] {
|
|
133
|
+
--t-group-radius: var(--tui-radius-m);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
&[data-orientation='vertical'] {
|
|
137
|
+
display: inline-flex;
|
|
138
|
+
flex-direction: column;
|
|
139
|
+
|
|
140
|
+
--t-group-mask: linear-gradient(
|
|
141
|
+
to bottom,
|
|
142
|
+
rgba(0, 0, 0, 0.5) 1px,
|
|
143
|
+
#000 2px,
|
|
144
|
+
#000 calc(100% - 2px),
|
|
145
|
+
rgba(0, 0, 0, 0.5)
|
|
146
|
+
);
|
|
147
|
+
--t-group-mask-start: linear-gradient(to bottom, #000 calc(100% - 2px), rgba(0, 0, 0, 0.5) calc(100% - 1px));
|
|
148
|
+
--t-group-mask-end: linear-gradient(to bottom, rgba(0, 0, 0, 0.5) 1px, #000 2px);
|
|
149
|
+
|
|
150
|
+
& > * {
|
|
151
|
+
min-block-size: auto;
|
|
152
|
+
flex: 0 0 auto;
|
|
153
|
+
|
|
154
|
+
&:not(:last-child) {
|
|
155
|
+
margin-inline-end: 0;
|
|
156
|
+
margin-block-end: var(--t-group-margin);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
&:first-child {
|
|
160
|
+
border-radius: var(--t-group-radius) var(--t-group-radius) 0 0;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&:last-child {
|
|
164
|
+
border-radius: 0 0 var(--t-group-radius) var(--t-group-radius);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
&:only-child {
|
|
168
|
+
border-radius: var(--t-group-radius);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
@import '@taiga-ui/styles/utils.less';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @name Icon
|
|
5
|
+
* @selector tui-icon
|
|
6
|
+
*
|
|
7
|
+
* @description
|
|
8
|
+
* Container for displaying icons colored with CSS (color/background)
|
|
9
|
+
*
|
|
10
|
+
* @vars
|
|
11
|
+
* --t-icon — depending on the data-icon, it can serve as either a mask (`svg`),
|
|
12
|
+
a background (`img`), or content (`font`) for the icon.
|
|
13
|
+
* --t-icon-bg — mask for the background
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* <tui-icon tuiIcons style="--t-icon: url('icon.svg')"></tui-icon>
|
|
17
|
+
*
|
|
18
|
+
* @see-also
|
|
19
|
+
* Icons
|
|
20
|
+
*/
|
|
21
|
+
tui-icon:where(*&) {
|
|
22
|
+
--tui-icon-size: 1em;
|
|
23
|
+
|
|
24
|
+
position: relative;
|
|
25
|
+
display: inline-flex;
|
|
26
|
+
inline-size: 1em;
|
|
27
|
+
block-size: 1em;
|
|
28
|
+
font-size: 1.5rem;
|
|
29
|
+
flex-shrink: 0;
|
|
30
|
+
border: 0 solid transparent;
|
|
31
|
+
vertical-align: middle;
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
mask: var(--t-icon-bg) no-repeat center / calc(100% + 10 * var(--tui-stroke-width)) 100%;
|
|
34
|
+
zoom: ~'calc(100% * (clamp(0px, var(--tui-font-offset) - 10px, 1px) / 0.8px))';
|
|
35
|
+
|
|
36
|
+
@media @tui-mouse {
|
|
37
|
+
&[data-appearance='icon']:hover {
|
|
38
|
+
color: var(--tui-text-secondary);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&[tuiIcons]::before,
|
|
43
|
+
&[tuiIcons]::after {
|
|
44
|
+
zoom: 1;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&[data-icon-end] {
|
|
48
|
+
&::before {
|
|
49
|
+
mask-image:
|
|
50
|
+
var(--t-icon-start),
|
|
51
|
+
radial-gradient(circle at bottom 0.1em right 0.1em, transparent calc(0.4em - 0.5px), #000 0.4em);
|
|
52
|
+
mask-composite: intersect;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&[data-icon-start='img'],
|
|
56
|
+
&[data-icon-start='font'] {
|
|
57
|
+
&::before {
|
|
58
|
+
mask: radial-gradient(circle at bottom 0.1em right 0.1em, transparent calc(0.4em - 0.5px), #000 0.4em);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&::after {
|
|
63
|
+
.fullsize();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&[data-icon-start] {
|
|
68
|
+
&::before {
|
|
69
|
+
.fullsize();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&::after {
|
|
73
|
+
transform: translate(36%, 36%);
|
|
74
|
+
|
|
75
|
+
--tui-icon-size: 0.5715em;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&[data-icon-start='font']::before,
|
|
80
|
+
&[data-icon-end='font']::after {
|
|
81
|
+
zoom: 0.667;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @name Icons
|
|
3
|
+
* @selector [tuiIcons]
|
|
4
|
+
*
|
|
5
|
+
* @description
|
|
6
|
+
* Icons directive applies styles to ::before and ::after pseudo elements
|
|
7
|
+
*
|
|
8
|
+
* @vars
|
|
9
|
+
* --t-icon-start — depending on the data-icon-start, it can serve as either a mask (`svg`),
|
|
10
|
+
a background (`img`), or content (`font`) for the ::before element
|
|
11
|
+
* --t-icon-end — depending on the data-icon-end, it can serve as either a mask (`svg`),
|
|
12
|
+
a background (`img`), or content (`font`) for the ::after element
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* <button tuiIcons style="--t-icon-start: url('icon.svg')"></button>
|
|
16
|
+
*
|
|
17
|
+
* @see-also
|
|
18
|
+
* Button, Icon, Link
|
|
19
|
+
*/
|
|
20
|
+
[tuiIcons]:where(*&) {
|
|
21
|
+
--t-icon-start: none;
|
|
22
|
+
--t-icon-end: none;
|
|
23
|
+
|
|
24
|
+
&::before,
|
|
25
|
+
&::after {
|
|
26
|
+
content: '';
|
|
27
|
+
inline-size: 1em;
|
|
28
|
+
block-size: 1em;
|
|
29
|
+
line-height: 1em;
|
|
30
|
+
font-size: var(--tui-icon-size, 1.5rem);
|
|
31
|
+
flex-shrink: 0;
|
|
32
|
+
box-sizing: content-box;
|
|
33
|
+
background: currentColor;
|
|
34
|
+
zoom: ~'calc(100% * (clamp(0px, var(--tui-font-offset) - 10px, 1px) / 0.8px))';
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&::before {
|
|
38
|
+
display: var(--t-icon-start);
|
|
39
|
+
mask:
|
|
40
|
+
var(--t-icon-start) no-repeat center / calc(~'min(1em, 100%)' + 10 * var(--tui-stroke-width))
|
|
41
|
+
~'min(1em, 100%)',
|
|
42
|
+
100% padding-box;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&::after {
|
|
46
|
+
display: var(--t-icon-end);
|
|
47
|
+
mask: var(--t-icon-end) no-repeat center / calc(~'min(1em, 100%)' + 10 * var(--tui-stroke-width))
|
|
48
|
+
~'min(1em, 100%)' padding-box;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&[data-icon-start='img']::before {
|
|
52
|
+
mask: none;
|
|
53
|
+
background: var(--t-icon-start) no-repeat center / 1em padding-box;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&[data-icon-end='img']::after {
|
|
57
|
+
mask: none;
|
|
58
|
+
background: var(--t-icon-end) no-repeat center / 1em padding-box;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&[data-icon-start='font']::before,
|
|
62
|
+
&[data-icon-end='font']::after {
|
|
63
|
+
display: grid;
|
|
64
|
+
mask: none;
|
|
65
|
+
background: none;
|
|
66
|
+
font: 1.5em / 1 var(--tui-font-icon, inherit);
|
|
67
|
+
text-align: center;
|
|
68
|
+
place-content: center;
|
|
69
|
+
text-transform: none;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&[data-icon-start='font']::before {
|
|
73
|
+
content: var(--t-icon-start);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&[data-icon-end='font']::after {
|
|
77
|
+
content: var(--t-icon-end);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
@import '@taiga-ui/styles/utils.less';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @name Label
|
|
5
|
+
* @selector [tuiLabel]
|
|
6
|
+
*
|
|
7
|
+
* @description
|
|
8
|
+
* Easy to use label ready for horizontal orientation for checkbox/radio/switch
|
|
9
|
+
* and vertical for input, select and textarea
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* <label tuiLabel><input type="checkbox" /> Click me</tui-icon>
|
|
13
|
+
*
|
|
14
|
+
* @see-also
|
|
15
|
+
* Checkbox, Radio, Title
|
|
16
|
+
*/
|
|
17
|
+
[tuiLabel]:where(*&) {
|
|
18
|
+
display: flex;
|
|
19
|
+
gap: 0.25rem;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
font: var(--tui-typography-body-s);
|
|
22
|
+
color: var(--tui-text-primary);
|
|
23
|
+
|
|
24
|
+
&:not([data-orientation='vertical']) {
|
|
25
|
+
flex-direction: row;
|
|
26
|
+
inline-size: fit-content;
|
|
27
|
+
font: var(--tui-typography-body-m);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
input[type='checkbox'],
|
|
31
|
+
input[type='radio'] {
|
|
32
|
+
margin-inline-end: 0.5rem;
|
|
33
|
+
|
|
34
|
+
&[data-size='s'] {
|
|
35
|
+
margin-inline-end: 0.25rem;
|
|
36
|
+
margin-block-start: 0.125rem;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
small {
|
|
41
|
+
font: var(--tui-typography-body-s);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
[tuiTitle] {
|
|
45
|
+
margin-block-start: 0.125rem;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
[tuiSubtitle] {
|
|
49
|
+
color: var(--tui-text-secondary);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
@import '@taiga-ui/styles/utils.less';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @name Like
|
|
5
|
+
* @selector [tuiLike]
|
|
6
|
+
*
|
|
7
|
+
* @description
|
|
8
|
+
* A stylized input type="checkbox"
|
|
9
|
+
*
|
|
10
|
+
* @attributes
|
|
11
|
+
* data-size — size (default: 'm') ('s' | 'm')
|
|
12
|
+
*
|
|
13
|
+
* @vars
|
|
14
|
+
* --t-icon-color — custom color for `:checked` state
|
|
15
|
+
* --t-icon-start — default state icon
|
|
16
|
+
* --t-icon-end — checkmark icon
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* <input tuiLike tuiIcons tuiAppearance data-appearance="secondary" />
|
|
20
|
+
*
|
|
21
|
+
* @see-also
|
|
22
|
+
* Checkbox, Switch, Radio, Appearance
|
|
23
|
+
*/
|
|
24
|
+
[tuiLike]:where(*&) {
|
|
25
|
+
inline-size: 1em;
|
|
26
|
+
block-size: 1em;
|
|
27
|
+
font-size: var(--tui-height-m);
|
|
28
|
+
border-radius: 100%;
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
margin: 0;
|
|
31
|
+
flex-shrink: 0;
|
|
32
|
+
|
|
33
|
+
&::before,
|
|
34
|
+
&::after {
|
|
35
|
+
.fullsize();
|
|
36
|
+
|
|
37
|
+
font-size: 1.25rem;
|
|
38
|
+
transition-property: transform, opacity;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&::after {
|
|
42
|
+
opacity: 0;
|
|
43
|
+
color: var(--t-icon-color, inherit);
|
|
44
|
+
transform: scale(0);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&:checked {
|
|
48
|
+
&::before {
|
|
49
|
+
opacity: 0;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&::after {
|
|
53
|
+
opacity: 1;
|
|
54
|
+
transform: scale(1);
|
|
55
|
+
transition-timing-function: cubic-bezier(0.2, 0.6, 0.5, 1.8), ease-in-out;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&[data-size='s'] {
|
|
60
|
+
font-size: var(--tui-height-s);
|
|
61
|
+
|
|
62
|
+
&::before,
|
|
63
|
+
&::after {
|
|
64
|
+
font-size: 1rem;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|