@taiga-ui/styles 5.0.0-canary.690ebfb → 5.0.0-canary.770d87d

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.
@@ -1,4 +1,4 @@
1
- @import '@taiga-ui/styles/utils.less';
1
+ @import '../utils.less';
2
2
 
3
3
  /**
4
4
  * @name Appearance
@@ -1,4 +1,4 @@
1
- @import '@taiga-ui/styles/utils.less';
1
+ @import '../utils.less';
2
2
 
3
3
  /**
4
4
  * @name Avatar
@@ -45,6 +45,10 @@
45
45
  font-weight: bold;
46
46
  opacity: 0.999; // Kick in hardware rendering layer to avoid artifacts on the edges
47
47
 
48
+ .interactive({
49
+ cursor: pointer;
50
+ });
51
+
48
52
  &::before {
49
53
  inline-size: auto;
50
54
  block-size: auto;
@@ -143,7 +147,8 @@
143
147
 
144
148
  &._badge {
145
149
  mask: radial-gradient(
146
- circle at calc(100% - var(--t-corner-offset)) calc(100% - var(--t-corner-offset)),
150
+ circle at ~'calc(max(var(--tui-inline), 0) * 100% - var(--tui-inline) * var(--t-corner-offset))'
151
+ calc(100% - var(--t-corner-offset)),
147
152
  black 0.23rem,
148
153
  transparent 0.25rem,
149
154
  transparent 0.375rem,
@@ -154,14 +159,14 @@
154
159
  &::after {
155
160
  content: '';
156
161
  position: absolute;
157
- top: calc(100% - var(--t-corner-offset));
158
- left: calc(100% - var(--t-corner-offset));
159
162
  display: block;
163
+ inset-block-start: calc(100% - var(--t-corner-offset));
164
+ inset-inline-start: calc(100% - var(--t-corner-offset));
160
165
  inline-size: 0.55rem;
161
166
  block-size: 0.55rem;
162
167
  border-radius: 100%;
163
168
  background: var(--t-badge);
164
- transform: translate3d(-50%, -50%, 0);
169
+ transform: translate3d(calc(var(--tui-inline) * -50%), -50%, 0);
165
170
  }
166
171
  }
167
172
 
@@ -1,4 +1,4 @@
1
- @import '@taiga-ui/styles/utils.less';
1
+ @import '../utils.less';
2
2
 
3
3
  /**
4
4
  * @name Badge
@@ -75,7 +75,6 @@
75
75
  --t-margin: -0.125rem;
76
76
 
77
77
  font: var(--tui-typography-ui-2xs);
78
- line-height: 0.875rem;
79
78
 
80
79
  &[tuiStatus]::before {
81
80
  inline-size: 0.25rem;
@@ -1,4 +1,4 @@
1
- @import '@taiga-ui/styles/utils.less';
1
+ @import '../utils.less';
2
2
 
3
3
  /**
4
4
  * @name Block
@@ -1,4 +1,4 @@
1
- @import '@taiga-ui/styles/utils.less';
1
+ @import '../utils.less';
2
2
 
3
3
  /**
4
4
  * @name Button
@@ -120,6 +120,11 @@
120
120
  max-block-size: calc(var(--t-line-height) * 2);
121
121
  }
122
122
  }
123
+
124
+ &:is(a):not([href]) {
125
+ opacity: var(--tui-disabled-opacity);
126
+ pointer-events: none;
127
+ }
123
128
  }
124
129
 
125
130
  [tuiIconButton]:where(*&) {
@@ -1,4 +1,4 @@
1
- @import '@taiga-ui/styles/utils.less';
1
+ @import '../utils.less';
2
2
 
3
3
  /**
4
4
  * @name Checkbox
@@ -1,4 +1,4 @@
1
- @import '@taiga-ui/styles/utils.less';
1
+ @import '../utils.less';
2
2
 
3
3
  /**
4
4
  * @name Chip
@@ -1,4 +1,4 @@
1
- @import '@taiga-ui/styles/utils.less';
1
+ @import '../utils.less';
2
2
 
3
3
  /**
4
4
  * @name Comment
@@ -16,12 +16,11 @@
16
16
  [tuiComment]:where(*&) {
17
17
  position: relative;
18
18
  display: inline-flex;
19
- font: var(--tui-typography-body-m);
19
+ font: var(--tui-typography-ui-m);
20
20
  color: #fff;
21
21
  padding: 0.5rem 0.75rem;
22
22
  min-inline-size: 2.5rem;
23
23
  border-radius: 1rem;
24
- line-height: 1.125rem;
25
24
  background: var(--tui-background-accent-2);
26
25
  align-items: center;
27
26
  justify-content: center;
@@ -1,4 +1,4 @@
1
- @import '@taiga-ui/styles/utils.less';
1
+ @import '../utils.less';
2
2
 
3
3
  /**
4
4
  * @name Compass
@@ -30,8 +30,8 @@ tui-compass:where(*&) {
30
30
  &::before {
31
31
  content: '';
32
32
  position: absolute;
33
- top: 0;
34
- left: 0.125rem;
33
+ inset-block-start: 0;
34
+ inset-inline-start: 0.125rem;
35
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
36
  transform: rotate(var(--t-degrees)) translateY(-0.625rem) translateZ(-1rem);
37
37
  inline-size: 0.75rem;
@@ -1,4 +1,4 @@
1
- @import '@taiga-ui/styles/utils.less';
1
+ @import '../utils.less';
2
2
 
3
3
  /**
4
4
  * @name Icon
@@ -31,7 +31,7 @@ tui-icon:where(*&) {
31
31
  vertical-align: middle;
32
32
  box-sizing: border-box;
33
33
  mask: var(--t-icon-bg) no-repeat center / calc(100% + 10 * var(--tui-stroke-width)) 100%;
34
- zoom: ~'calc(100% * (min(max(var(--tui-typography-offset) - 10px, 0px), 1px) / 0.8px))';
34
+ zoom: ~'calc(100% * (clamp(0px, var(--tui-font-offset) - 10px, 1px) / 0.8px))';
35
35
 
36
36
  @media @tui-mouse {
37
37
  &[data-appearance='icon']:hover {
@@ -39,6 +39,11 @@ tui-icon:where(*&) {
39
39
  }
40
40
  }
41
41
 
42
+ &[tuiIcons]::before,
43
+ &[tuiIcons]::after {
44
+ zoom: 1;
45
+ }
46
+
42
47
  &[data-icon-end] {
43
48
  &::before {
44
49
  mask-image:
@@ -71,11 +76,6 @@ tui-icon:where(*&) {
71
76
  }
72
77
  }
73
78
 
74
- &[data-icon-start='img']::before,
75
- &[data-icon-end='img']::after {
76
- zoom: 1;
77
- }
78
-
79
79
  &[data-icon-start='font']::before,
80
80
  &[data-icon-end='font']::after {
81
81
  zoom: 0.667;
@@ -31,7 +31,7 @@
31
31
  flex-shrink: 0;
32
32
  box-sizing: content-box;
33
33
  background: currentColor;
34
- zoom: ~'calc(100% * (min(max(var(--tui-typography-offset) - 10px, 0px), 1px) / 0.8px))';
34
+ zoom: ~'calc(100% * (clamp(0px, var(--tui-font-offset) - 10px, 1px) / 0.8px))';
35
35
  }
36
36
 
37
37
  &::before {
@@ -63,7 +63,7 @@
63
63
  display: grid;
64
64
  mask: none;
65
65
  background: none;
66
- font: 1.5em / 1 var(--tui-typography-icon, inherit);
66
+ font: 1.5em / 1 var(--tui-font-icon, inherit);
67
67
  text-align: center;
68
68
  place-content: center;
69
69
  text-transform: none;
@@ -1,4 +1,4 @@
1
- @import '@taiga-ui/styles/utils.less';
1
+ @import '../utils.less';
2
2
 
3
3
  /**
4
4
  * @name Label
@@ -1,4 +1,4 @@
1
- @import '@taiga-ui/styles/utils.less';
1
+ @import '../utils.less';
2
2
 
3
3
  /**
4
4
  * @name Like
@@ -1,4 +1,4 @@
1
- @import '@taiga-ui/styles/utils.less';
1
+ @import '../utils.less';
2
2
 
3
3
  /**
4
4
  * @name Link
@@ -1,4 +1,4 @@
1
- @import '@taiga-ui/styles/utils.less';
1
+ @import '../utils.less';
2
2
 
3
3
  /**
4
4
  * @name Message
@@ -1,4 +1,4 @@
1
- @import '@taiga-ui/styles/utils.less';
1
+ @import '../utils.less';
2
2
 
3
3
  /**
4
4
  * @name Notification
@@ -28,9 +28,8 @@
28
28
  display: flow-root;
29
29
  max-block-size: 100%;
30
30
  color: var(--tui-text-primary);
31
- padding: 1rem;
31
+ padding: var(--tui-padding-l);
32
32
  font: var(--tui-typography-body-m);
33
- line-height: 1.5rem;
34
33
  border-radius: var(--tui-radius-l);
35
34
  box-sizing: border-box;
36
35
  text-align: start;
@@ -70,9 +69,8 @@
70
69
  }
71
70
 
72
71
  &[data-size='s'] {
73
- padding: 0.375rem 0.625rem;
72
+ padding: 0.375rem var(--tui-padding-s);
74
73
  font: var(--tui-typography-body-s);
75
- line-height: 1.25rem;
76
74
  border-radius: var(--tui-radius-m);
77
75
 
78
76
  &[data-icon-start] {
@@ -114,9 +112,8 @@
114
112
  }
115
113
 
116
114
  &[data-size='m'] {
117
- padding: 0.75rem;
115
+ padding: var(--tui-padding-m);
118
116
  font: var(--tui-typography-body-s);
119
- line-height: 1.25rem;
120
117
  border-radius: var(--tui-radius-m);
121
118
 
122
119
  &[data-icon-start] {
@@ -1,4 +1,4 @@
1
- @import '@taiga-ui/styles/utils.less';
1
+ @import '../utils.less';
2
2
 
3
3
  /**
4
4
  * @name Pin
@@ -16,7 +16,11 @@
16
16
  [tuiPin]:where(*&) {
17
17
  --t-size: 2rem;
18
18
 
19
- .transition(~'width, height, border, margin');
19
+ @bubble-width: 1.875rem;
20
+ @bubble-shift: translate(calc(var(--tui-inline) * -@bubble-width), -@bubble-width);
21
+ @ground-shift: translate(calc(var(--tui-inline) * -50%), -50%);
22
+
23
+ .transition(~'inline-size, block-size, border, margin');
20
24
  .button-clear();
21
25
 
22
26
  position: relative;
@@ -35,7 +39,7 @@
35
39
  background: var(--tui-background-accent-2);
36
40
  box-shadow: 0 0 0 0.125rem var(--tui-background-elevation-2);
37
41
  border: 0 solid var(--tui-background-accent-2);
38
- transform: translate(-50%, -50%);
42
+ transform: @ground-shift;
39
43
 
40
44
  .interactive({
41
45
  cursor: pointer;
@@ -64,7 +68,7 @@
64
68
  }
65
69
 
66
70
  > tui-icon {
67
- .transition(~'width, height');
71
+ .transition(~'inline-size, block-size');
68
72
 
69
73
  font-size: 1.25rem;
70
74
  align-self: center;
@@ -87,12 +91,12 @@
87
91
  }
88
92
 
89
93
  &::before {
90
- transform: scale(0.99) translate(-1.875rem, -1.875rem);
94
+ transform: scale(0.99) @bubble-shift;
91
95
  opacity: 1;
92
96
  }
93
97
 
94
98
  &::after {
95
- top: 4.5rem;
99
+ inset-block-start: 4.5rem;
96
100
  opacity: 1;
97
101
  }
98
102
  }
@@ -115,12 +119,12 @@
115
119
  }
116
120
 
117
121
  &::before {
118
- transform: scale(0.99) translate(-1.875rem, -1.875rem);
122
+ transform: scale(0.99) @bubble-shift;
119
123
  opacity: 1;
120
124
  }
121
125
 
122
126
  &::after {
123
- top: 4.5rem;
127
+ inset-block-start: 4.5rem;
124
128
  opacity: 1;
125
129
  }
126
130
  }
@@ -130,35 +134,33 @@
130
134
 
131
135
  content: '';
132
136
  position: absolute;
133
- top: 50%;
134
- left: 50%;
135
- right: -0.25rem;
136
- bottom: -0.625rem;
137
+ inset-block: 50% -0.625rem;
138
+ inset-inline: 50% -0.25rem;
137
139
  box-sizing: border-box;
138
- border-width: 2.2rem 2rem;
140
+ border-width: 2.2rem @bubble-width;
139
141
  border-style: solid;
140
142
  border-color: inherit;
141
143
  opacity: 0;
142
- transform: scale(0.57) translate(-1.875rem, -1.875rem);
143
- transform-origin: top left;
144
+ transform: scale(0.57) @bubble-shift;
145
+ transform-origin: top var(--tui-inline-start);
144
146
  pointer-events: none;
145
147
  mask: url('data:image/svg+xml,<svg width="60" height="66" viewBox="0 0 60 66" xmlns="http://www.w3.org/2000/svg"><path d="M0 30.0917C0 13.4726 13.4313 0 30.0002 0C46.5687 0 60 13.4726 60 30.0917C60 44.2105 50.4927 56.0529 37.4162 59.2986C32.5552 60.5551 31.0408 65.275 31.0408 65.275C30.8892 65.697 30.4909 66 30.0183 66C29.5453 66 29.147 65.697 28.9938 65.275C28.9938 65.275 27.481 60.5551 22.6199 59.2986C9.46433 56.0206 0 43.5901 0 30.0917ZM30 57.75C45.3259 57.75 57.75 45.3259 57.75 30C57.75 14.6741 45.3259 2.25 30 2.25C14.6741 2.25 2.25 14.6741 2.25 30C2.25 45.3259 14.6741 57.75 30 57.75Z" /></svg>')
146
148
  no-repeat;
147
149
  }
148
150
 
149
151
  &::after {
150
- .transition(~'top, opacity');
152
+ .transition(~'inset-block-start, opacity');
151
153
 
152
154
  content: '';
153
155
  position: absolute;
154
- top: 50%;
155
- left: 50%;
156
+ inset-block-start: 50%;
157
+ inset-inline-start: 50%;
156
158
  border: 0.1875rem solid currentColor;
157
159
  border-color: inherit;
158
160
  border-radius: 100%;
159
161
  box-sizing: border-box;
160
162
  box-shadow: inherit;
161
- transform: translate(-50%, -50%);
163
+ transform: @ground-shift;
162
164
  opacity: 0;
163
165
  }
164
166
  }
@@ -1,4 +1,4 @@
1
- @import '@taiga-ui/styles/utils.less';
1
+ @import '../utils.less';
2
2
 
3
3
  /**
4
4
  * @name ProgressBar
@@ -1,4 +1,4 @@
1
- @import '@taiga-ui/styles/utils.less';
1
+ @import '../utils.less';
2
2
 
3
3
  /**
4
4
  * @name Radio
@@ -1,4 +1,4 @@
1
- @import '@taiga-ui/styles/utils.less';
1
+ @import '../utils.less';
2
2
 
3
3
  /**
4
4
  * @name Switch
@@ -38,19 +38,19 @@
38
38
 
39
39
  &::before {
40
40
  inline-size: 1rem;
41
- transform: translateX(-1rem);
41
+ transform: translateX(calc(var(--tui-inline) * -1rem));
42
42
  font-size: 0.75rem;
43
43
  }
44
44
 
45
45
  &::after {
46
46
  inline-size: 1rem;
47
- box-shadow: -2.625rem 0 0 0.5rem var(--tui-background-base);
47
+ box-shadow: calc(var(--tui-inline) * -2.625rem) 0 0 0.5rem var(--tui-background-base);
48
48
  outline-width: 0.167rem;
49
49
  transform: scale(0.375);
50
50
  }
51
51
 
52
52
  &:checked::after {
53
- transform: scale(0.375) translateX(2.625rem);
53
+ transform: scale(0.375) translateX(calc(var(--tui-inline) * 2.625rem));
54
54
  }
55
55
  }
56
56
 
@@ -60,7 +60,7 @@
60
60
  }
61
61
 
62
62
  &::after {
63
- transform: scale(0.33333) translateX(4.5rem);
63
+ transform: scale(0.33333) translateX(calc(var(--tui-inline) * 4.5rem));
64
64
  }
65
65
  }
66
66
 
@@ -74,21 +74,22 @@
74
74
  block-size: 100%;
75
75
  inline-size: 1.5rem;
76
76
  transition-property: transform;
77
+ zoom: 1;
77
78
  }
78
79
 
79
80
  &::before {
80
- left: 0.125rem;
81
+ inset-inline-start: 0.125rem;
81
82
  font-size: 1rem;
82
- transform: translateX(-1.5rem);
83
+ transform: translateX(calc(var(--tui-inline) * -1.5rem));
83
84
  }
84
85
 
85
86
  &::after {
86
- right: 0;
87
87
  display: block;
88
+ inset-inline-end: 0;
88
89
  border-radius: 100%;
89
90
  background: none;
90
91
  transform: scale(0.33333);
91
- box-shadow: -4.5rem 0 0 0.75rem var(--tui-background-base);
92
+ box-shadow: calc(var(--tui-inline) * -4.5rem) 0 0 0.75rem var(--tui-background-base);
92
93
  outline: 0.375rem solid var(--tui-background-neutral-2-pressed);
93
94
  }
94
95
 
@@ -1,13 +1,14 @@
1
- @import '@taiga-ui/styles/utils.less';
1
+ @import '../utils.less';
2
2
 
3
3
  tui-textfield:where(*&) {
4
4
  .scrollbar-hidden();
5
5
  .transition(color);
6
6
 
7
- --t-height: var(--tui-height-l);
7
+ --t-height: calc(var(--tui-height-l) + 2.5 * var(--t-label) * var(--tui-font-offset));
8
8
  --t-padding: var(--tui-padding-l);
9
+ --t-label: 0;
9
10
  --t-label-y: -0.75rem;
10
- --t-label-font: var(--tui-typography-body-s);
11
+ --t-label-font: var(--tui-typography-ui-s);
11
12
  --t-end: ~'0px';
12
13
  --t-start: ~'0px';
13
14
  --t-side: ~'0px';
@@ -22,7 +23,6 @@ tui-textfield:where(*&) {
22
23
  padding: 0 var(--t-padding);
23
24
  border-radius: var(--tui-radius-l);
24
25
  font: var(--tui-typography-ui-m);
25
- line-height: 1.25rem;
26
26
  box-sizing: border-box;
27
27
  isolation: isolate;
28
28
 
@@ -101,7 +101,6 @@ tui-textfield:where(*&) {
101
101
 
102
102
  border-radius: var(--tui-radius-m);
103
103
  font: var(--tui-typography-ui-s);
104
- line-height: 1rem;
105
104
 
106
105
  &[data-icon-start] {
107
106
  --t-start: 1.5rem;
@@ -132,15 +131,14 @@ tui-textfield:where(*&) {
132
131
  }
133
132
 
134
133
  &[data-size='m'] {
135
- --t-height: var(--tui-height-m);
134
+ --t-height: calc(var(--tui-height-m) + 2.5 * var(--t-label) * var(--tui-font-offset));
136
135
  --t-padding: var(--tui-padding-m);
137
- --t-label-font: var(--tui-typography-body-xs);
136
+ --t-label-font: var(--tui-typography-ui-xs);
138
137
  --t-label-y: -0.5625rem;
139
138
  --t-max: 0.125rem;
140
139
 
141
140
  border-radius: var(--tui-radius-m);
142
141
  font: var(--tui-typography-ui-s);
143
- line-height: 1rem;
144
142
 
145
143
  &[data-icon-start] {
146
144
  --t-start: 2.125rem;
@@ -164,10 +162,6 @@ tui-textfield:where(*&) {
164
162
  }
165
163
  }
166
164
 
167
- &[data-size='l'] {
168
- --t-label: -0.7rem;
169
- }
170
-
171
165
  &:is(._disabled, [data-state='disabled']) {
172
166
  pointer-events: none;
173
167
  opacity: var(--tui-disabled-opacity);
@@ -182,9 +176,12 @@ tui-textfield:where(*&) {
182
176
  }
183
177
 
184
178
  &._with-label {
179
+ --t-label: 1;
180
+
185
181
  & > .t-template,
186
182
  .t-filler,
187
183
  [tuiInput] {
184
+ inset-block-end: 0;
188
185
  padding-block-start: calc(var(--t-height) / 3);
189
186
  padding-block-end: 0;
190
187
  }
@@ -204,10 +201,9 @@ tui-textfield:where(*&) {
204
201
  .t-filler,
205
202
  [tuiInput] {
206
203
  position: absolute;
207
- inset-block-start: 0;
208
204
  inset-inline: 0;
209
205
  inline-size: auto;
210
- block-size: 100%;
206
+ block-size: var(--t-height);
211
207
  appearance: none;
212
208
  background: none;
213
209
  font: inherit;
@@ -253,8 +249,7 @@ tui-textfield:where(*&) {
253
249
  [tuiLabel],
254
250
  &:not(tui-textfield) ~ [tuiLabel] {
255
251
  font: var(--t-label-font);
256
- line-height: var(--t-height);
257
- transform: translateY(var(--t-label-y));
252
+ transform: translateY(calc(var(--t-label-y) - var(--tui-font-offset) / 2));
258
253
  }
259
254
  }
260
255
 
@@ -265,12 +260,18 @@ tui-textfield:where(*&) {
265
260
 
266
261
  position: relative;
267
262
  display: block;
263
+ max-inline-size: calc(100% - var(--t-start));
268
264
  flex: 1;
269
265
  align-self: flex-start;
270
- font-size: inherit;
266
+ font: inherit;
271
267
  user-select: none;
272
- line-height: var(--t-height);
268
+ padding: calc(var(--t-height) / 2 - 0.625em) 0;
269
+ line-height: 1.25 !important;
273
270
  transition-duration: inherit;
271
+
272
+ + .t-content {
273
+ margin-inline-start: 0;
274
+ }
274
275
  }
275
276
 
276
277
  [tuiLabel],
@@ -354,8 +355,7 @@ tui-textfield:where(*&) {
354
355
  [tuiLabel] {
355
356
  color: var(--tui-text-primary) !important;
356
357
  font: var(--t-label-font);
357
- line-height: var(--t-height);
358
- transform: translateY(var(--t-label-y));
358
+ transform: translateY(calc(var(--t-label-y) - var(--tui-font-offset) / 2));
359
359
  }
360
360
  });
361
361
  }
@@ -1,4 +1,4 @@
1
- @import '@taiga-ui/styles/utils.less';
1
+ @import '../utils.less';
2
2
 
3
3
  [tuiToast]:where(*&) {
4
4
  .transition(transform);
@@ -20,13 +20,15 @@
20
20
  max-inline-size: ~'min(calc(100vw - 2rem), 25rem)';
21
21
  border: inherit;
22
22
  text-decoration: none;
23
+ white-space: pre-line;
24
+ text-align: start;
23
25
  overflow: hidden;
24
26
 
25
27
  .interactive({
26
28
  cursor: pointer;
27
29
  });
28
30
 
29
- > *,
31
+ > *:not(tui-shrink-wrap),
30
32
  &::after,
31
33
  &::before {
32
34
  max-inline-size: 50%;
@@ -92,7 +92,7 @@
92
92
  }
93
93
 
94
94
  &:not(:last-child)::before {
95
- right: -1rem;
95
+ inset-inline-end: -1rem;
96
96
  }
97
97
 
98
98
  &::after {
@@ -109,7 +109,7 @@
109
109
  }
110
110
 
111
111
  &:not(:first-child)::before {
112
- left: -1rem;
112
+ inset-inline-start: -1rem;
113
113
  }
114
114
 
115
115
  &::after {