@taiga-ui/styles 5.0.0-canary.efd526e → 5.0.0-rc.4

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.
@@ -28,7 +28,7 @@
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
33
  border-radius: var(--tui-radius-l);
34
34
  box-sizing: border-box;
@@ -69,7 +69,7 @@
69
69
  }
70
70
 
71
71
  &[data-size='s'] {
72
- padding: 0.375rem 0.625rem;
72
+ padding: 0.375rem var(--tui-padding-s);
73
73
  font: var(--tui-typography-body-s);
74
74
  border-radius: var(--tui-radius-m);
75
75
 
@@ -112,7 +112,7 @@
112
112
  }
113
113
 
114
114
  &[data-size='m'] {
115
- padding: 0.75rem;
115
+ padding: var(--tui-padding-m);
116
116
  font: var(--tui-typography-body-s);
117
117
  border-radius: var(--tui-radius-m);
118
118
 
@@ -4,10 +4,11 @@ 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,6 +176,8 @@ 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] {
@@ -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,13 +260,19 @@ 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
  letter-spacing: calc((max(1em, 0.75rem) - 1em) * 0.4);
274
271
  transition-duration: inherit;
272
+
273
+ + .t-content {
274
+ margin-inline-start: 0;
275
+ }
275
276
  }
276
277
 
277
278
  [tuiLabel],
@@ -355,8 +356,7 @@ tui-textfield:where(*&) {
355
356
  [tuiLabel] {
356
357
  color: var(--tui-text-primary) !important;
357
358
  font: var(--t-label-font);
358
- line-height: var(--t-height);
359
- transform: translateY(var(--t-label-y));
359
+ transform: translateY(calc(var(--t-label-y) - var(--tui-font-offset) / 2));
360
360
  }
361
361
  });
362
362
  }
@@ -0,0 +1,17 @@
1
+ @import '../variables/media';
2
+
3
+ .tui-hitbox(@size) {
4
+ @media @tui-mobile {
5
+ position: relative;
6
+ overflow: visible;
7
+
8
+ &::after {
9
+ content: '';
10
+ position: absolute;
11
+ display: block !important;
12
+ inline-size: max(100%, @size);
13
+ block-size: max(100%, @size);
14
+ background: transparent;
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,17 @@
1
+ @import '../variables/media';
2
+
3
+ @mixin hitbox($size) {
4
+ @media ($tui-mobile) {
5
+ position: relative;
6
+ overflow: visible;
7
+
8
+ &::after {
9
+ content: '';
10
+ position: absolute;
11
+ display: block !important;
12
+ inline-size: max(100%, $size);
13
+ block-size: max(100%, $size);
14
+ background: transparent;
15
+ }
16
+ }
17
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taiga-ui/styles",
3
- "version": "5.0.0-canary.efd526e",
3
+ "version": "5.0.0-rc.4",
4
4
  "description": "Framework-agnostic package with styles for Taiga UI",
5
5
  "license": "Apache-2.0",
6
6
  "exports": {
@@ -27,7 +27,7 @@
27
27
  var(--tui-typography-family-text);
28
28
  --tui-typography-body-s: normal calc(var(--tui-font-offset) + 0.875rem) / calc(20 / 14)
29
29
  var(--tui-typography-family-text);
30
- --tui-typography-body-xs: normal calc(var(--tui-font-offset) + 0.6875rem) / calc(16 / 11)
30
+ --tui-typography-body-xs: normal calc(var(--tui-font-offset) + 0.75rem) / calc(16 / 12)
31
31
  var(--tui-typography-family-text);
32
32
  // Reduced
33
33
  --tui-typography-ui-l: normal calc(var(--tui-font-offset) + 1.0625rem) / calc(24 / 17)
package/utils.less CHANGED
@@ -3,4 +3,5 @@
3
3
  @import 'mixins/miscellaneous.less';
4
4
  @import 'mixins/slider.less';
5
5
  @import 'mixins/appearance.less';
6
+ @import 'mixins/hitbox.less';
6
7
  @import 'variables/media.less';
package/utils.scss CHANGED
@@ -3,4 +3,5 @@
3
3
  @import 'mixins/miscellaneous';
4
4
  @import 'mixins/slider';
5
5
  @import 'mixins/appearance';
6
+ @import 'mixins/hitbox';
6
7
  @import 'variables/media';