@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.
Files changed (71) hide show
  1. package/components/appearance.less +51 -0
  2. package/components/avatar.less +192 -0
  3. package/components/badge.less +127 -0
  4. package/components/block.less +118 -0
  5. package/components/button.less +135 -0
  6. package/components/checkbox.less +84 -0
  7. package/components/chip.less +131 -0
  8. package/components/comment.less +63 -0
  9. package/components/compass.less +49 -0
  10. package/components/group.less +172 -0
  11. package/components/icon.less +83 -0
  12. package/components/icons.less +79 -0
  13. package/components/label.less +51 -0
  14. package/components/like.less +67 -0
  15. package/components/link.less +69 -0
  16. package/components/message.less +33 -0
  17. package/components/notification.less +181 -0
  18. package/components/pin.less +164 -0
  19. package/components/progress-bar.less +117 -0
  20. package/components/radio.less +59 -0
  21. package/components/status.less +40 -0
  22. package/components/switch.less +104 -0
  23. package/components/textfield.less +362 -0
  24. package/components/title.less +80 -0
  25. package/components/toast.less +44 -0
  26. package/mixins/appearance.less +56 -0
  27. package/mixins/appearance.scss +57 -0
  28. package/mixins/browsers.less +23 -0
  29. package/mixins/browsers.scss +23 -0
  30. package/mixins/date-picker.less +152 -0
  31. package/mixins/date-picker.scss +152 -0
  32. package/mixins/miscellaneous.less +168 -0
  33. package/mixins/miscellaneous.scss +162 -0
  34. package/mixins/slider.less +67 -0
  35. package/mixins/slider.scss +67 -0
  36. package/package.json +9 -2
  37. package/taiga-ui-fonts.less +4 -0
  38. package/taiga-ui-theme.less +4 -0
  39. package/theme/appearance/accent.less +14 -0
  40. package/theme/appearance/action.less +38 -0
  41. package/theme/appearance/flat.less +23 -0
  42. package/theme/appearance/floating.less +21 -0
  43. package/theme/appearance/glass.less +30 -0
  44. package/theme/appearance/outline.less +78 -0
  45. package/theme/appearance/primary.less +48 -0
  46. package/theme/appearance/secondary.less +77 -0
  47. package/theme/appearance/status.less +125 -0
  48. package/theme/appearance/table.less +68 -0
  49. package/theme/appearance/textfield.less +80 -0
  50. package/theme/appearance.less +12 -0
  51. package/theme/palette.less +161 -0
  52. package/theme/variables.less +71 -0
  53. package/utils.less +6 -0
  54. package/utils.scss +6 -0
  55. package/variables/media.less +23 -0
  56. package/variables/media.scss +23 -0
  57. package/basic/keyframes.less +0 -19
  58. package/basic/main.less +0 -80
  59. package/markup/tui-container.less +0 -64
  60. package/markup/tui-form.less +0 -145
  61. package/markup/tui-island.less +0 -200
  62. package/markup/tui-list.less +0 -136
  63. package/markup/tui-mobile-only.less +0 -5
  64. package/markup/tui-required.less +0 -13
  65. package/markup/tui-row.less +0 -139
  66. package/markup/tui-skeleton.less +0 -43
  67. package/markup/tui-space.less +0 -52
  68. package/markup/tui-table.less +0 -184
  69. package/markup/tui-text.less +0 -61
  70. package/project.json +0 -35
  71. package/taiga-ui-global.less +0 -14
@@ -0,0 +1,23 @@
1
+ .firefox-only(@ruleset) {
2
+ @supports (-moz-appearance: none) {
3
+ @ruleset();
4
+ }
5
+ }
6
+
7
+ .safari-only(@ruleset) {
8
+ @supports (-webkit-hyphens: none) {
9
+ @ruleset();
10
+ }
11
+ }
12
+
13
+ .ios-only(@ruleset) {
14
+ @supports (-webkit-touch-callout: none) {
15
+ @ruleset();
16
+ }
17
+ }
18
+
19
+ .chrome-only(@ruleset) {
20
+ @supports (not (-moz-appearance: none)) and (not (-webkit-hyphens: none)) {
21
+ @ruleset();
22
+ }
23
+ }
@@ -0,0 +1,23 @@
1
+ @mixin firefox-only {
2
+ @supports (-moz-appearance: none) {
3
+ @content;
4
+ }
5
+ }
6
+
7
+ @mixin safari-only {
8
+ @supports (-webkit-hyphens: none) {
9
+ @content;
10
+ }
11
+ }
12
+
13
+ @mixin ios-only {
14
+ @supports (-webkit-touch-callout: none) {
15
+ @content;
16
+ }
17
+ }
18
+
19
+ @mixin chrome-only {
20
+ @supports (not (-moz-appearance: none)) and (not (-webkit-hyphens: none)) {
21
+ @content;
22
+ }
23
+ }
@@ -0,0 +1,152 @@
1
+ @import 'miscellaneous.less';
2
+
3
+ .date-picker() {
4
+ .t-row {
5
+ display: flex;
6
+ justify-content: flex-start;
7
+ font: var(--tui-typography-body-m);
8
+
9
+ &:first-child {
10
+ justify-content: flex-end;
11
+ }
12
+
13
+ &:last-child {
14
+ justify-content: flex-start;
15
+ }
16
+ }
17
+
18
+ .t-cell {
19
+ position: relative;
20
+ display: flex;
21
+ align-items: center;
22
+ justify-content: center;
23
+ line-height: 2rem;
24
+ isolation: isolate;
25
+ cursor: pointer;
26
+ overflow: hidden;
27
+ border: 0.125rem solid transparent;
28
+ box-sizing: border-box;
29
+ mask: linear-gradient(
30
+ transparent calc(50% - 1rem),
31
+ #000 calc(50% - 1rem),
32
+ #000 calc(50% + 1rem),
33
+ transparent calc(50% + 1rem)
34
+ );
35
+
36
+ &:first-child {
37
+ border-inline-start-color: transparent !important;
38
+ }
39
+
40
+ &:last-child {
41
+ border-inline-end-color: transparent !important;
42
+ }
43
+
44
+ &::before,
45
+ &::after {
46
+ .fullsize(absolute, inset);
47
+
48
+ content: '';
49
+ z-index: -1;
50
+ border-radius: var(--tui-radius-m);
51
+ }
52
+
53
+ &::after {
54
+ mask:
55
+ url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 32"><path d="M0.2856 0L0.6763 0C2.9265 0 4.9876 1.259 6.0147 3.2611L10.2442 11.5048C11.5301 14.0113 11.5683 16.9754 10.3472 19.5141L5.9766 28.6007C4.9772 30.6786 2.8754 32 0.5696 32H0.285645V0Z"></path></svg>')
56
+ right/0.75rem 100% no-repeat,
57
+ linear-gradient(#000, #000) left/calc(100% - 0.7rem) 100% no-repeat;
58
+ }
59
+
60
+ &[data-range]::before {
61
+ background: var(--tui-background-neutral-1);
62
+ }
63
+
64
+ :host._picking &[data-range]::before {
65
+ background: var(--tui-background-neutral-1-hover);
66
+ }
67
+
68
+ &[data-range='middle'] {
69
+ border-color: var(--tui-background-neutral-1);
70
+
71
+ :host._picking & {
72
+ border-color: var(--tui-background-neutral-1-hover);
73
+ }
74
+
75
+ &:not(:first-child)::before {
76
+ border-top-left-radius: 0;
77
+ border-bottom-left-radius: 0;
78
+ }
79
+
80
+ &:not(:last-child)::before {
81
+ border-top-right-radius: 0;
82
+ border-bottom-right-radius: 0;
83
+ }
84
+ }
85
+
86
+ &[data-range='start'] {
87
+ border-inline-end-color: var(--tui-background-neutral-1);
88
+ color: var(--tui-text-primary-on-accent-1);
89
+
90
+ :host._picking & {
91
+ border-inline-end-color: var(--tui-background-neutral-1-hover);
92
+ }
93
+
94
+ &:not(:last-child)::before {
95
+ right: -1rem;
96
+ }
97
+
98
+ &::after {
99
+ background: var(--tui-background-accent-1);
100
+ }
101
+ }
102
+
103
+ &[data-range='end'] {
104
+ border-inline-start-color: var(--tui-background-neutral-1);
105
+ color: var(--tui-text-primary-on-accent-1);
106
+
107
+ :host._picking & {
108
+ border-inline-start-color: var(--tui-background-neutral-1-hover);
109
+ }
110
+
111
+ &:not(:first-child)::before {
112
+ left: -1rem;
113
+ }
114
+
115
+ &::after {
116
+ background: var(--tui-background-accent-1);
117
+ transform: scale(-1, 1);
118
+ }
119
+ }
120
+
121
+ &[data-range='active'] {
122
+ color: var(--tui-text-primary-on-accent-1);
123
+
124
+ &::after {
125
+ background: var(--tui-background-accent-1);
126
+ mask: none;
127
+ }
128
+ }
129
+
130
+ &_disabled {
131
+ opacity: var(--tui-disabled-opacity);
132
+ pointer-events: none;
133
+ }
134
+
135
+ &_today {
136
+ text-decoration: underline;
137
+ text-underline-offset: 0.25rem;
138
+ }
139
+
140
+ @media @tui-mouse {
141
+ &:hover:not([data-range='start']):not([data-range='end'])::before {
142
+ background: var(--tui-background-neutral-1-hover);
143
+ }
144
+
145
+ &[data-range='start']:hover::after,
146
+ &[data-range='end']:hover::after,
147
+ &[data-range='active']:hover::after {
148
+ background: var(--tui-background-accent-1-hover);
149
+ }
150
+ }
151
+ }
152
+ }
@@ -0,0 +1,152 @@
1
+ @import 'miscellaneous';
2
+
3
+ @mixin date-picker {
4
+ .t-row {
5
+ display: flex;
6
+ justify-content: flex-start;
7
+ font: var(--tui-typography-body-m);
8
+
9
+ &:first-child {
10
+ justify-content: flex-end;
11
+ }
12
+
13
+ &:last-child {
14
+ justify-content: flex-start;
15
+ }
16
+ }
17
+
18
+ .t-cell {
19
+ position: relative;
20
+ display: flex;
21
+ align-items: center;
22
+ justify-content: center;
23
+ line-height: 2rem;
24
+ isolation: isolate;
25
+ cursor: pointer;
26
+ overflow: hidden;
27
+ border: 0.125rem solid transparent;
28
+ box-sizing: border-box;
29
+ mask: linear-gradient(
30
+ transparent calc(50% - 1rem),
31
+ #000 calc(50% - 1rem),
32
+ #000 calc(50% + 1rem),
33
+ transparent calc(50% + 1rem)
34
+ );
35
+
36
+ &:first-child {
37
+ border-inline-start-color: transparent !important;
38
+ }
39
+
40
+ &:last-child {
41
+ border-inline-end-color: transparent !important;
42
+ }
43
+
44
+ &::before,
45
+ &::after {
46
+ @include fullsize(absolute, inset);
47
+
48
+ content: '';
49
+ z-index: -1;
50
+ border-radius: var(--tui-radius-m);
51
+ }
52
+
53
+ &::after {
54
+ mask:
55
+ url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 32"><path d="M0.2856 0L0.6763 0C2.9265 0 4.9876 1.259 6.0147 3.2611L10.2442 11.5048C11.5301 14.0113 11.5683 16.9754 10.3472 19.5141L5.9766 28.6007C4.9772 30.6786 2.8754 32 0.5696 32H0.285645V0Z"></path></svg>')
56
+ right/0.75rem 100% no-repeat,
57
+ linear-gradient(#000, #000) left/calc(100% - 0.7rem) 100% no-repeat;
58
+ }
59
+
60
+ &[data-range]::before {
61
+ background: var(--tui-background-neutral-1);
62
+ }
63
+
64
+ :host._picking &[data-range]::before {
65
+ background: var(--tui-background-neutral-1-hover);
66
+ }
67
+
68
+ &[data-range='middle'] {
69
+ border-color: var(--tui-background-neutral-1);
70
+
71
+ :host._picking & {
72
+ border-color: var(--tui-background-neutral-1-hover);
73
+ }
74
+
75
+ &:not(:first-child)::before {
76
+ border-top-left-radius: 0;
77
+ border-bottom-left-radius: 0;
78
+ }
79
+
80
+ &:not(:last-child)::before {
81
+ border-top-right-radius: 0;
82
+ border-bottom-right-radius: 0;
83
+ }
84
+ }
85
+
86
+ &[data-range='start'] {
87
+ border-inline-end-color: var(--tui-background-neutral-1);
88
+ color: var(--tui-text-primary-on-accent-1);
89
+
90
+ :host._picking & {
91
+ border-inline-end-color: var(--tui-background-neutral-1-hover);
92
+ }
93
+
94
+ &:not(:last-child)::before {
95
+ right: -1rem;
96
+ }
97
+
98
+ &::after {
99
+ background: var(--tui-background-accent-1);
100
+ }
101
+ }
102
+
103
+ &[data-range='end'] {
104
+ border-inline-start-color: var(--tui-background-neutral-1);
105
+ color: var(--tui-text-primary-on-accent-1);
106
+
107
+ :host._picking & {
108
+ border-inline-start-color: var(--tui-background-neutral-1-hover);
109
+ }
110
+
111
+ &:not(:first-child)::before {
112
+ left: -1rem;
113
+ }
114
+
115
+ &::after {
116
+ background: var(--tui-background-accent-1);
117
+ transform: scale(-1, 1);
118
+ }
119
+ }
120
+
121
+ &[data-range='active'] {
122
+ color: var(--tui-text-primary-on-accent-1);
123
+
124
+ &::after {
125
+ background: var(--tui-background-accent-1);
126
+ mask: none;
127
+ }
128
+ }
129
+
130
+ &_disabled {
131
+ opacity: var(--tui-disabled-opacity);
132
+ pointer-events: none;
133
+ }
134
+
135
+ &_today {
136
+ text-decoration: underline;
137
+ text-underline-offset: 0.25rem;
138
+ }
139
+
140
+ @media ($tui-mouse) {
141
+ &:hover:not([data-range='start']):not([data-range='end'])::before {
142
+ background: var(--tui-background-neutral-1-hover);
143
+ }
144
+
145
+ &[data-range='start']:hover::after,
146
+ &[data-range='end']:hover::after,
147
+ &[data-range='active']:hover::after {
148
+ background: var(--tui-background-accent-1-hover);
149
+ }
150
+ }
151
+ }
152
+ }
@@ -0,0 +1,168 @@
1
+ @import 'browsers.less';
2
+
3
+ .interactive(@ruleset) {
4
+ &:is(a, button, select, textarea, input, label, .tui-interactive):not(:disabled) {
5
+ @ruleset();
6
+ }
7
+ }
8
+
9
+ // centering with translate
10
+ .center-left() {
11
+ position: absolute;
12
+ left: 50%;
13
+ transform: translate(-50%, 0);
14
+ }
15
+
16
+ .center-top() {
17
+ position: absolute;
18
+ top: 50%;
19
+ transform: translate(0, -50%);
20
+ }
21
+
22
+ .center-all() {
23
+ position: absolute;
24
+ top: 50%;
25
+ left: 50%;
26
+ transform: translate(-50%, -50%);
27
+ }
28
+
29
+ //.fullsize
30
+ // @deprecated TODO remove in 5.0 in favor of inset: 0
31
+ .fullsize(@position: absolute, @mode: height) {
32
+ position: @position;
33
+ top: 0;
34
+ left: 0;
35
+
36
+ & when (@mode = height) {
37
+ inline-size: 100%;
38
+ block-size: 100%;
39
+ }
40
+
41
+ & when (@mode = inset) {
42
+ bottom: 0;
43
+ right: 0;
44
+ }
45
+ }
46
+
47
+ .button-clear() {
48
+ appearance: none;
49
+ padding: 0;
50
+ border: 0;
51
+ background: none;
52
+ font: inherit;
53
+ line-height: inherit;
54
+ text-decoration: none;
55
+ }
56
+
57
+ .button-base() {
58
+ .button-clear();
59
+
60
+ position: relative;
61
+ display: inline-flex;
62
+ align-items: center;
63
+ flex-shrink: 0;
64
+ box-sizing: border-box;
65
+ white-space: nowrap;
66
+ overflow: hidden;
67
+ vertical-align: middle;
68
+ max-inline-size: 100%;
69
+ // StackBlitz changes "0rem" to "0" breaking calc
70
+ gap: calc(var(--t-gap, ~'0rem') - 2 * var(--t-margin, 0rem));
71
+
72
+ > img,
73
+ > tui-icon,
74
+ > [tuiAvatar],
75
+ > tui-badge,
76
+ > [tuiBadge],
77
+ > [tuiRadio],
78
+ > [tuiSwitch],
79
+ > [tuiCheckbox],
80
+ &[tuiIcons]::before,
81
+ &[tuiIcons]::after {
82
+ margin: var(--t-margin);
83
+ }
84
+ }
85
+
86
+ // TODO remove @speed in 5.0
87
+ // transition
88
+ .transition(@param: all, @speed: var(--tui-duration, 300ms)) {
89
+ transition-property: @param;
90
+ transition-duration: @speed;
91
+ transition-timing-function: ease-in-out;
92
+ }
93
+
94
+ // gradient
95
+ .gradient(@start-color, @end-color, @angle: 45deg) {
96
+ background-image: linear-gradient(@angle, @start-color 0%, @end-color 100%);
97
+ }
98
+
99
+ // typical properties for text overflow with ellipsis
100
+ .text-overflow(@type: nowrap) {
101
+ white-space: @type;
102
+ overflow: hidden;
103
+ text-overflow: ellipsis;
104
+ }
105
+
106
+ .scrollbar-hidden() {
107
+ /* stylelint-disable*/
108
+ scrollbar-width: none;
109
+ -ms-overflow-style: none;
110
+ /* stylelint-enable*/
111
+
112
+ &::-webkit-scrollbar,
113
+ &::-webkit-scrollbar-thumb {
114
+ display: none;
115
+ }
116
+ }
117
+
118
+ // hide an element visually without hiding it from screen readers
119
+ .sr-only() {
120
+ position: absolute;
121
+ clip: rect(1px, 1px, 1px, 1px);
122
+ clip-path: inset(50%);
123
+ block-size: 1px;
124
+ inline-size: 1px;
125
+ margin: -1px;
126
+ overflow: hidden;
127
+ padding: 0;
128
+ }
129
+
130
+ // prevent scrolling to focused element on IOS
131
+ .tui-prevent-ios-scroll() {
132
+ .ios-only({
133
+ &:focus {
134
+ animation: tuiPreventIOSScroll 0.001s;
135
+ }
136
+ });
137
+
138
+ @keyframes tuiPreventIOSScroll {
139
+ 0% {
140
+ opacity: 0;
141
+ }
142
+
143
+ 100% {
144
+ opacity: 1;
145
+ }
146
+ }
147
+ }
148
+
149
+ .text-truncate() {
150
+ .text-overflow();
151
+
152
+ flex: 1;
153
+ min-inline-size: 0;
154
+ max-inline-size: max-content;
155
+ }
156
+
157
+ .tui-line-clamp(@count: 3) {
158
+ display: -webkit-box;
159
+ -webkit-box-orient: block-axis;
160
+ -webkit-line-clamp: @count;
161
+ line-clamp: @count;
162
+ overflow: hidden;
163
+ text-overflow: ellipsis;
164
+ }
165
+
166
+ .tui-mask(@x, @y, @r) {
167
+ mask: radial-gradient(circle at @x @y, transparent @r, black @r);
168
+ }
@@ -0,0 +1,162 @@
1
+ @import 'browsers';
2
+
3
+ @mixin interactive {
4
+ &:is(a, button, select, textarea, input, label, .tui-interactive):not(:disabled) {
5
+ @content;
6
+ }
7
+ }
8
+
9
+ // centering with translate
10
+ @mixin center-left() {
11
+ position: absolute;
12
+ left: 50%;
13
+ transform: translate(-50%, 0);
14
+ }
15
+
16
+ @mixin center-top() {
17
+ position: absolute;
18
+ top: 50%;
19
+ transform: translate(0, -50%);
20
+ }
21
+
22
+ @mixin center-all() {
23
+ position: absolute;
24
+ top: 50%;
25
+ left: 50%;
26
+ transform: translate(-50%, -50%);
27
+ }
28
+
29
+ //.fullsize
30
+ @mixin fullsize($position: absolute, $mode: height) {
31
+ position: $position;
32
+ top: 0;
33
+ left: 0;
34
+
35
+ @if ($mode == height) {
36
+ width: 100%;
37
+ height: 100%;
38
+ }
39
+
40
+ @if ($mode == inset) {
41
+ bottom: 0;
42
+ right: 0;
43
+ }
44
+ }
45
+
46
+ @mixin button-clear() {
47
+ appearance: none;
48
+ padding: 0;
49
+ border: 0;
50
+ background: none;
51
+ font: inherit;
52
+ line-height: inherit;
53
+ text-decoration: none;
54
+ }
55
+
56
+ @mixin button-base() {
57
+ @include button-clear();
58
+
59
+ position: relative;
60
+ display: inline-flex;
61
+ align-items: center;
62
+ flex-shrink: 0;
63
+ box-sizing: border-box;
64
+ white-space: nowrap;
65
+ overflow: hidden;
66
+ vertical-align: middle;
67
+ max-width: 100%;
68
+ gap: calc(var(--t-gap) - 2 * var(--t-margin));
69
+
70
+ > img,
71
+ > tui-icon,
72
+ > [tuiAvatar],
73
+ > tui-badge,
74
+ > [tuiBadge],
75
+ > [tuiRadio],
76
+ > [tuiSwitch],
77
+ > [tuiCheckbox],
78
+ &[tuiIcons]:before,
79
+ &[tuiIcons]:after {
80
+ margin: var(--t-margin);
81
+ }
82
+ }
83
+
84
+ // transition
85
+ @mixin transition($param: all, $speed: var(--tui-duration, 300ms)) {
86
+ transition-property: $param;
87
+ transition-duration: $speed;
88
+ transition-timing-function: ease-in-out;
89
+ }
90
+
91
+ // gradient
92
+ @mixin gradient($start-color, $end-color, $angle: 45deg) {
93
+ background-image: linear-gradient($angle, $start-color 0%, $end-color 100%);
94
+ }
95
+
96
+ // typical properties for text overflow with ellipsis
97
+ @mixin text-overflow($type: nowrap) {
98
+ white-space: $type;
99
+ overflow: hidden;
100
+ text-overflow: ellipsis;
101
+ }
102
+
103
+ @mixin scrollbar-hidden() {
104
+ /* stylelint-disable*/
105
+ scrollbar-width: none;
106
+ -ms-overflow-style: none;
107
+ /* stylelint-enable*/
108
+
109
+ &::-webkit-scrollbar,
110
+ &::-webkit-scrollbar-thumb {
111
+ display: none;
112
+ }
113
+ }
114
+
115
+ // hide an element visually without hiding it from screen readers
116
+ @mixin sr-only() {
117
+ position: absolute;
118
+ clip: rect(1px, 1px, 1px, 1px);
119
+ clip-path: inset(50%);
120
+ height: 1px;
121
+ width: 1px;
122
+ margin: -1px;
123
+ overflow: hidden;
124
+ padding: 0;
125
+ }
126
+
127
+ // prevent scrolling to focused element on IOS
128
+ @mixin tui-prevent-ios-scroll() {
129
+ &:focus {
130
+ animation: tuiPreventIOSScroll 0.001s;
131
+ }
132
+
133
+ @keyframes tuiPreventIOSScroll {
134
+ 0% {
135
+ opacity: 0;
136
+ }
137
+
138
+ 100% {
139
+ opacity: 1;
140
+ }
141
+ }
142
+ }
143
+
144
+ @mixin text-truncate() {
145
+ @include text-overflow();
146
+ flex: 1;
147
+ min-inline-size: 0;
148
+ max-inline-size: max-content;
149
+ }
150
+
151
+ @mixin tui-line-clamp($count: 3) {
152
+ display: -webkit-box;
153
+ -webkit-box-orient: vertical;
154
+ -webkit-line-clamp: $count;
155
+ line-clamp: $count;
156
+ overflow: hidden;
157
+ text-overflow: ellipsis;
158
+ }
159
+
160
+ @mixin tui-mask($x, $y, $r) {
161
+ mask: radial-gradient(circle at $x $y, transparent $r, black $r);
162
+ }