diff --git a/projects/addon-mobile/styles/common/card-large.less b/projects/addon-mobile/styles/common/card-large.less
index 34a672f59b690..b2acd387e9c7f 100644
--- a/projects/addon-mobile/styles/common/card-large.less
+++ b/projects/addon-mobile/styles/common/card-large.less
@@ -1,13 +1,12 @@
-[tuiCard='l'] {
- &[data-size='l'] {
- &[data-space='normal'] {
- padding: 1.25rem;
- gap: 1.25rem;
- }
+[tuiCardLarge] {
+ &[data-space='normal'] {
+ --t-padding: 1.25rem;
+ --t-gap: 1.25rem;
+ }
- &[data-space='compact'] {
- padding: 1rem;
- gap: 1rem;
- }
+ &[data-space='compact'] {
+ --t-padding: 1rem;
+ --t-gap: 1rem;
+ --t-comp: -0.125rem;
}
}
diff --git a/projects/core/styles/theme/appearance/outline.less b/projects/core/styles/theme/appearance/outline.less
index 395f44c7fa147..8052809093541 100644
--- a/projects/core/styles/theme/appearance/outline.less
+++ b/projects/core/styles/theme/appearance/outline.less
@@ -9,6 +9,7 @@
.appearance-hover({
background: var(--tui-clear);
box-shadow: inset 0 0 0 1px var(--tui-base-05);
+ cursor: pointer;
});
.appearance-active({
diff --git a/projects/demo/src/modules/experimental/card/card.module.ts b/projects/demo/src/modules/experimental/card/card.module.ts
index a3a5f20b25871..a017c3f4a337e 100644
--- a/projects/demo/src/modules/experimental/card/card.module.ts
+++ b/projects/demo/src/modules/experimental/card/card.module.ts
@@ -14,6 +14,7 @@ import {
TuiSvgModule,
} from '@taiga-ui/core';
import {
+ TuiAppearanceModule,
TuiAutoColorModule,
TuiAvatarModule,
TuiAvatarStackModule,
@@ -31,7 +32,6 @@ import {
TuiThumbnailCardModule,
TuiTitleModule,
} from '@taiga-ui/experimental';
-import {TuiProgressModule} from '@taiga-ui/kit';
import {ExampleTuiCardComponent} from './card.component';
import {TuiCardExample1} from './examples/1';
@@ -82,10 +82,10 @@ import {TuiCardExample19} from './examples/19';
TuiRepeatTimesModule,
TuiDataListModule,
TuiHostedDropdownModule,
- TuiProgressModule,
TuiButtonCloseModule,
TuiPlatformModule,
TuiLinkModule,
+ TuiAppearanceModule,
],
declarations: [
ExampleTuiCardComponent,
diff --git a/projects/demo/src/modules/experimental/card/card.template.html b/projects/demo/src/modules/experimental/card/card.template.html
index 0bc306bc42e0e..f5fa6125ecb6a 100644
--- a/projects/demo/src/modules/experimental/card/card.template.html
+++ b/projects/demo/src/modules/experimental/card/card.template.html
@@ -10,6 +10,18 @@
and is a subject to change. Expect final solution to be shipped in the next major version
+
+ A layout component used to create various cards for the interface. Define visual styles of the cards
+ yourself or combine with
+
+ Surface
+
+ for visual presets.
+
+
@@ -119,15 +131,15 @@
diff --git a/projects/demo/src/modules/experimental/card/examples/1/index.html b/projects/demo/src/modules/experimental/card/examples/1/index.html
index f5ebe33cc50bf..c54eaaa5678b6 100644
--- a/projects/demo/src/modules/experimental/card/examples/1/index.html
+++ b/projects/demo/src/modules/experimental/card/examples/1/index.html
@@ -1,4 +1,7 @@
-
+
-
+
-
+
Title
Subtitle
diff --git a/projects/demo/src/modules/experimental/card/examples/10/index.html b/projects/demo/src/modules/experimental/card/examples/10/index.html
index 4cffc1243342e..35a4776929184 100644
--- a/projects/demo/src/modules/experimental/card/examples/10/index.html
+++ b/projects/demo/src/modules/experimental/card/examples/10/index.html
@@ -1,74 +1,64 @@
-
-
- Title
- Subtitle
-
+
+ Title
+ Subtitle
+
-
-
+
-
+
+
diff --git a/projects/demo/src/modules/experimental/card/examples/10/index.less b/projects/demo/src/modules/experimental/card/examples/10/index.less
index 728927259d172..e13863a293d55 100644
--- a/projects/demo/src/modules/experimental/card/examples/10/index.less
+++ b/projects/demo/src/modules/experimental/card/examples/10/index.less
@@ -2,18 +2,11 @@
display: flex;
flex-direction: column;
gap: 1.25rem;
-
- [tuiCard][data-size='l'] {
- padding: 1rem 1.5rem;
- }
+ width: 20rem;
}
.actions {
- display: flex;
+ display: grid;
+ grid-template-columns: 1fr 1fr;
gap: 1.25rem;
-
- button {
- flex: 1;
- height: 3.75rem;
- }
}
diff --git a/projects/demo/src/modules/experimental/card/examples/11/index.html b/projects/demo/src/modules/experimental/card/examples/11/index.html
index e32f80a517c24..bea2b059d2dd5 100644
--- a/projects/demo/src/modules/experimental/card/examples/11/index.html
+++ b/projects/demo/src/modules/experimental/card/examples/11/index.html
@@ -1,5 +1,5 @@
@@ -11,8 +11,9 @@
-
-
-
-
+
-
-
-
-
-
-
-
+
diff --git a/projects/demo/src/modules/experimental/card/examples/13/index.less b/projects/demo/src/modules/experimental/card/examples/13/index.less
index 2c7a3b16833c4..294ee2562724c 100644
--- a/projects/demo/src/modules/experimental/card/examples/13/index.less
+++ b/projects/demo/src/modules/experimental/card/examples/13/index.less
@@ -1,8 +1,5 @@
-section {
- display: flex;
- gap: 1.5rem;
-}
-
-aside {
- flex: 1;
+.actions {
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ gap: inherit;
}
diff --git a/projects/demo/src/modules/experimental/card/examples/14/index.html b/projects/demo/src/modules/experimental/card/examples/14/index.html
index b84a0a642ff56..ddf01b2df22f6 100644
--- a/projects/demo/src/modules/experimental/card/examples/14/index.html
+++ b/projects/demo/src/modules/experimental/card/examples/14/index.html
@@ -1,5 +1,5 @@
-
-
-
-
-
+
+
+
-
-
-
-
-
-
+
-
+
+
+
+ Show all
+
-
- Title
- Subtitle
-
+ Title
-
+
+
+ tuiButton
+ type="button"
+ >
+ Label
+
+
+
+
+
+
+ Some text
diff --git a/projects/demo/src/modules/experimental/card/examples/17/index.html b/projects/demo/src/modules/experimental/card/examples/17/index.html
index acc5fe7916ea1..8aff64f0024e3 100644
--- a/projects/demo/src/modules/experimental/card/examples/17/index.html
+++ b/projects/demo/src/modules/experimental/card/examples/17/index.html
@@ -1,25 +1,21 @@
-
-
- Title
- Subtitle
-
+
+ Title
+ Subtitle
+
-
-
+
diff --git a/projects/demo/src/modules/experimental/card/examples/17/index.less b/projects/demo/src/modules/experimental/card/examples/17/index.less
index 4c2ab50c5a424..a3ce92c035a07 100644
--- a/projects/demo/src/modules/experimental/card/examples/17/index.less
+++ b/projects/demo/src/modules/experimental/card/examples/17/index.less
@@ -1,4 +1,3 @@
.image {
- background: url('/assets/images/illustration.jpg') no-repeat;
- background-size: cover;
+ background: url(/assets/images/illustration.jpg) no-repeat top right / 250%;
}
diff --git a/projects/demo/src/modules/experimental/card/examples/18/index.html b/projects/demo/src/modules/experimental/card/examples/18/index.html
index 5ec4a97c204a0..132a80af4fcda 100644
--- a/projects/demo/src/modules/experimental/card/examples/18/index.html
+++ b/projects/demo/src/modules/experimental/card/examples/18/index.html
@@ -1,28 +1,25 @@
-
-
- Title
- Subtitle
-
+
+ Title
+ Subtitle
+
-
-
+ Close
+
+
diff --git a/projects/demo/src/modules/experimental/card/examples/18/index.less b/projects/demo/src/modules/experimental/card/examples/18/index.less
index 35f64bafedafb..ebc56a8e640a8 100644
--- a/projects/demo/src/modules/experimental/card/examples/18/index.less
+++ b/projects/demo/src/modules/experimental/card/examples/18/index.less
@@ -1,6 +1,5 @@
-.image-dark {
- background: url('/assets/images/road-illustration.jpg') no-repeat center;
- background-size: cover;
+.image {
+ background: url('/assets/images/road-illustration.jpg') no-repeat center / cover;
&:before {
background: rgba(0, 0, 0, 0.5);
diff --git a/projects/demo/src/modules/experimental/card/examples/19/index.html b/projects/demo/src/modules/experimental/card/examples/19/index.html
index a7173cae35738..e8889f447bba6 100644
--- a/projects/demo/src/modules/experimental/card/examples/19/index.html
+++ b/projects/demo/src/modules/experimental/card/examples/19/index.html
@@ -2,11 +2,10 @@
Desktop
-
+
Normal
Radius: 24, padding: 24/20
@@ -26,12 +25,11 @@
-
+
Compact
Radius: 16, padding: 20/16
@@ -55,11 +53,10 @@
iOS/Android
-
+
Normal
Radius: 24, padding: 20/16
@@ -79,12 +76,11 @@
-
+
Compact
Radius: 16, padding: 16/14
diff --git a/projects/demo/src/modules/experimental/card/examples/2/index.html b/projects/demo/src/modules/experimental/card/examples/2/index.html
index 2973ba7f336da..8a96ad6c3dc42 100644
--- a/projects/demo/src/modules/experimental/card/examples/2/index.html
+++ b/projects/demo/src/modules/experimental/card/examples/2/index.html
@@ -1,4 +1,7 @@
-
+
-
+
Title
Subtitle
diff --git a/projects/demo/src/modules/experimental/card/examples/3/index.html b/projects/demo/src/modules/experimental/card/examples/3/index.html
index b2e9450c93bdb..c497103883156 100644
--- a/projects/demo/src/modules/experimental/card/examples/3/index.html
+++ b/projects/demo/src/modules/experimental/card/examples/3/index.html
@@ -1,4 +1,7 @@
-
+
-
+
Title
Subtitle
diff --git a/projects/demo/src/modules/experimental/card/examples/4/index.html b/projects/demo/src/modules/experimental/card/examples/4/index.html
index 80edf46d4e3dc..8a25550db16b6 100644
--- a/projects/demo/src/modules/experimental/card/examples/4/index.html
+++ b/projects/demo/src/modules/experimental/card/examples/4/index.html
@@ -1,4 +1,7 @@
-
+
-
+
Title
Subtitle
diff --git a/projects/demo/src/modules/experimental/card/examples/5/index.html b/projects/demo/src/modules/experimental/card/examples/5/index.html
index 58088d8418863..28763b559b418 100644
--- a/projects/demo/src/modules/experimental/card/examples/5/index.html
+++ b/projects/demo/src/modules/experimental/card/examples/5/index.html
@@ -1,5 +1,5 @@
@@ -18,7 +18,7 @@
@@ -34,7 +34,7 @@
Flights
@@ -52,7 +52,7 @@
diff --git a/projects/demo/src/modules/experimental/card/examples/5/index.less b/projects/demo/src/modules/experimental/card/examples/5/index.less
index 659262ce86738..994070ff005da 100644
--- a/projects/demo/src/modules/experimental/card/examples/5/index.less
+++ b/projects/demo/src/modules/experimental/card/examples/5/index.less
@@ -9,12 +9,12 @@
color: #333;
}
-.money[tuiSurface] {
+.money {
background: #ffdd2d;
color: #333;
}
-.poster[tuiSurface] {
+.poster {
background: rgb(88, 192, 190);
padding: 0.75rem;
color: #fff;
@@ -34,7 +34,7 @@
}
}
-.fly[tuiSurface] {
+.fly {
background: rgb(101, 174, 234);
padding: 0.75rem;
color: #fff;
@@ -50,8 +50,8 @@
}
}
-.google[tuiSurface],
-.microsoft[tuiSurface] {
+.google,
+.microsoft {
padding: 0.75rem;
background: var(--tui-base-02);
height: 8rem;
@@ -62,7 +62,7 @@
}
}
-.google[tuiSurface] {
+.google {
[tuiSubtitle] {
color: red;
}
@@ -72,7 +72,7 @@
}
}
-.microsoft[tuiSurface] {
+.microsoft {
[tuiSubtitle] {
color: #00b92d;
}
diff --git a/projects/demo/src/modules/experimental/card/examples/6/index.html b/projects/demo/src/modules/experimental/card/examples/6/index.html
index e6fd9331b63ae..8030ad639fc31 100644
--- a/projects/demo/src/modules/experimental/card/examples/6/index.html
+++ b/projects/demo/src/modules/experimental/card/examples/6/index.html
@@ -1,46 +1,44 @@
-
-
-
-
- Lorem Ipsum is simply dummy text of the printing and typesetting industry.
-
-
+
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry.
+
-
-
-
- It is a long established fact that a reader will be distracted by the readable content of a page
- when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal
- distribution of letters, as opposed to using 'Content here, content here', making it look like
- readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their
- default model text.
-
-
-
-
+
+ It is a long established fact that a reader will be distracted by the readable content of a page when looking at
+ its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as
+ opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing
+ packages and web page editors now use Lorem Ipsum as their default model text.
+
-
-
Text without fade out when overflow content
+
+ Text without fade out when overflow content
It is a long established fact that a reader will be distracted by the readable content of a page when looking at
its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as
opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing
packages and web page editors now use Lorem Ipsum as their default model text.
-
{{ text.innerText }}
diff --git a/projects/demo/src/modules/experimental/card/examples/6/index.less b/projects/demo/src/modules/experimental/card/examples/6/index.less
index 2cc57e51845ad..e252245e982bf 100644
--- a/projects/demo/src/modules/experimental/card/examples/6/index.less
+++ b/projects/demo/src/modules/experimental/card/examples/6/index.less
@@ -6,7 +6,6 @@
}
.fade {
- .scrollbar-hidden();
width: 100%;
height: 2rem;
white-space: nowrap;
@@ -14,7 +13,6 @@
}
.fade-vertical {
- .scrollbar-hidden();
height: 5rem;
overflow: auto;
}
diff --git a/projects/demo/src/modules/experimental/card/examples/7/index.html b/projects/demo/src/modules/experimental/card/examples/7/index.html
index 96c8272f7a08e..630e9682ab679 100644
--- a/projects/demo/src/modules/experimental/card/examples/7/index.html
+++ b/projects/demo/src/modules/experimental/card/examples/7/index.html
@@ -1,18 +1,13 @@
-
-
-
-
+
-
+
+
+
+ 2222
+
+
+
-
-
-
-
- 2222
-
-
-
-
+
diff --git a/projects/demo/src/modules/experimental/card/examples/7/index.less b/projects/demo/src/modules/experimental/card/examples/7/index.less
index 1b720d2235e64..2281d1fdc1f3a 100644
--- a/projects/demo/src/modules/experimental/card/examples/7/index.less
+++ b/projects/demo/src/modules/experimental/card/examples/7/index.less
@@ -5,17 +5,9 @@
gap: 1rem;
}
-.surface[tuiSurface] {
+.card {
height: 6.5rem;
width: 6.5rem;
- padding: 0.75rem;
- background: var(--tui-base-02);
- cursor: pointer;
-}
-
-.selected {
- z-index: 1;
- color: var(--tui-primary);
}
.mir {
@@ -26,19 +18,12 @@
background: linear-gradient(45deg, #ffaa00d1, #ffaa00), url(/assets/taiga-ui/icons/tuiIconStarLarge.svg);
}
-.card-list {
- .scrollbar-hidden();
+.cards {
display: flex;
flex-direction: row;
gap: 0.25rem;
- width: 100%;
- overflow-x: scroll;
- overflow-y: hidden;
- margin-left: -0.4375rem;
- padding-left: 0.4375rem;
- z-index: 2;
-
- tui-thumbnail-card {
- flex-shrink: 0;
- }
+ width: stretch;
+ margin: 0 -0.4375rem;
+ padding: 0 0.4375rem;
+ overflow: auto;
}
diff --git a/projects/demo/src/modules/experimental/card/examples/8/index.html b/projects/demo/src/modules/experimental/card/examples/8/index.html
index 28db44b053ca1..a700adde4bbd4 100644
--- a/projects/demo/src/modules/experimental/card/examples/8/index.html
+++ b/projects/demo/src/modules/experimental/card/examples/8/index.html
@@ -2,7 +2,7 @@
Desktop
@@ -40,7 +40,7 @@
Header
iOS/Android
diff --git a/projects/demo/src/modules/experimental/card/examples/9/index.html b/projects/demo/src/modules/experimental/card/examples/9/index.html
index 5d684fc6b0634..fbab751614b9d 100644
--- a/projects/demo/src/modules/experimental/card/examples/9/index.html
+++ b/projects/demo/src/modules/experimental/card/examples/9/index.html
@@ -2,7 +2,7 @@
Desktop
@@ -36,7 +36,7 @@
iOS/Android
diff --git a/projects/demo/src/modules/experimental/card/examples/import/insert-template.md b/projects/demo/src/modules/experimental/card/examples/import/insert-template.md
index 2334deb74f1ff..e1f776077d081 100644
--- a/projects/demo/src/modules/experimental/card/examples/import/insert-template.md
+++ b/projects/demo/src/modules/experimental/card/examples/import/insert-template.md
@@ -1,6 +1,6 @@
```html
-
+
diff --git a/projects/demo/src/modules/experimental/surface/examples/1/base.less b/projects/demo/src/modules/experimental/surface/examples/1/base.less
index 3d14b1f311452..edb78291a157d 100644
--- a/projects/demo/src/modules/experimental/surface/examples/1/base.less
+++ b/projects/demo/src/modules/experimental/surface/examples/1/base.less
@@ -12,8 +12,7 @@
}
}
-.highlight {
- background: var(--tui-primary);
- box-shadow: none;
- color: var(--tui-primary-text);
+[tuiSurface] {
+ padding: 1.25rem;
+ border-radius: var(--tui-radius-l);
}
diff --git a/projects/demo/src/modules/experimental/surface/examples/1/index.html b/projects/demo/src/modules/experimental/surface/examples/1/index.html
index 0bb4487a36a12..49a01f7ec1ac9 100644
--- a/projects/demo/src/modules/experimental/surface/examples/1/index.html
+++ b/projects/demo/src/modules/experimental/surface/examples/1/index.html
@@ -11,6 +11,7 @@
Overlay
diff --git a/projects/demo/src/modules/experimental/surface/examples/2/index.less b/projects/demo/src/modules/experimental/surface/examples/2/index.less
index 149b14b3d18e3..1c9efb4ee432c 100644
--- a/projects/demo/src/modules/experimental/surface/examples/2/index.less
+++ b/projects/demo/src/modules/experimental/surface/examples/2/index.less
@@ -3,3 +3,8 @@
grid-template-columns: repeat(3, 8rem);
gap: 1rem;
}
+
+[tuiSurface] {
+ padding: 1.25rem;
+ border-radius: var(--tui-radius-l);
+}
diff --git a/projects/demo/src/modules/experimental/surface/examples/4/index.html b/projects/demo/src/modules/experimental/surface/examples/4/index.html
index 07a5469e03359..0757d44b6fb79 100644
--- a/projects/demo/src/modules/experimental/surface/examples/4/index.html
+++ b/projects/demo/src/modules/experimental/surface/examples/4/index.html
@@ -14,5 +14,7 @@
type="video/mp4"
/>
- Big Buck Bunny
+
+ Big Buck Bunny
+
diff --git a/projects/demo/src/modules/experimental/surface/examples/5/index.html b/projects/demo/src/modules/experimental/surface/examples/5/index.html
index 4243d64a6d075..b6a70c46eb57c 100644
--- a/projects/demo/src/modules/experimental/surface/examples/5/index.html
+++ b/projects/demo/src/modules/experimental/surface/examples/5/index.html
@@ -1,6 +1,8 @@
Item {{ index + 1 }}
- General purpose container used in Taiga UI interfaces
+
+ General purpose container used in Taiga UI interfaces. Often used in conjunction with
+
+ Card
+
+ component.
+
+
+ Note that
+ padding
+ and
+ border-radius
+ are not part of the surface. Take a look at
+
+ Card
+
+ component for that.
+
@@ -45,7 +68,7 @@
>
Text should have vertical compensation to look properly aligned, either with unequal
padding
- as in this example or with negative
+ or with negative
margin
. Typical value is
0.25rem
diff --git a/projects/experimental/components/badge/badge.style.less b/projects/experimental/components/badge/badge.style.less
index 945484ccebbed..3882d2b1e766e 100644
--- a/projects/experimental/components/badge/badge.style.less
+++ b/projects/experimental/components/badge/badge.style.less
@@ -13,6 +13,7 @@
padding: var(--t-padding);
height: var(--t-size);
min-width: var(--t-size);
+ width: fit-content;
font: var(--tui-font-text-s);
&._dot:before {
diff --git a/projects/experimental/components/chip/chip.style.less b/projects/experimental/components/chip/chip.style.less
index 6449fd7c040e9..4417ede287ef3 100644
--- a/projects/experimental/components/chip/chip.style.less
+++ b/projects/experimental/components/chip/chip.style.less
@@ -11,6 +11,7 @@ tui-chip,
border-radius: var(--tui-radius-m);
padding: var(--t-padding);
height: var(--t-size);
+ width: fit-content;
.interactive({
cursor: pointer;
diff --git a/projects/experimental/components/thumbnail-card/thumbnail-card.style.less b/projects/experimental/components/thumbnail-card/thumbnail-card.style.less
index 0e6b5c10991a3..2a5e0175793e1 100644
--- a/projects/experimental/components/thumbnail-card/thumbnail-card.style.less
+++ b/projects/experimental/components/thumbnail-card/thumbnail-card.style.less
@@ -3,6 +3,7 @@
:host {
position: relative;
display: inline-flex;
+ flex-shrink: 0;
background: #000;
color: #fff;
transform-style: preserve-3d;
diff --git a/projects/experimental/directives/card/card.directive.ts b/projects/experimental/directives/card/card.directive.ts
index 5ad734b5d6127..3f73412febd2f 100644
--- a/projects/experimental/directives/card/card.directive.ts
+++ b/projects/experimental/directives/card/card.directive.ts
@@ -1,23 +1,32 @@
import {Directive, Inject, Input} from '@angular/core';
import {TuiDirectiveStylesService} from '@taiga-ui/cdk';
-import {TuiSizeL} from '@taiga-ui/core';
import {TuiCardComponent} from './card.component';
@Directive({
- selector: '[tuiCard]',
+ selector: '[tuiCardMedium]',
host: {
- tuiCard: '',
- '[attr.data-size]': 'size || "m"',
- '[attr.data-space]': 'space',
+ tuiCardMedium: '',
},
})
-export class TuiCardDirective {
- @Input('tuiCard')
- size: TuiSizeL | '' = 'm';
+export class TuiCardMediumDirective {
+ constructor(
+ @Inject(TuiDirectiveStylesService) directiveStyles: TuiDirectiveStylesService,
+ ) {
+ directiveStyles.addComponent(TuiCardComponent);
+ }
+}
- @Input()
- space: 'compact' | 'normal' = 'normal';
+@Directive({
+ selector: '[tuiCardLarge]',
+ host: {
+ tuiCardLarge: '',
+ '[attr.data-space]': 'space || "normal"',
+ },
+})
+export class TuiCardLargeDirective {
+ @Input('tuiCardLarge')
+ space: '' | 'compact' | 'normal' = 'normal';
constructor(
@Inject(TuiDirectiveStylesService) directiveStyles: TuiDirectiveStylesService,
diff --git a/projects/experimental/directives/card/card.module.ts b/projects/experimental/directives/card/card.module.ts
index 4431b105f6691..7c0b922e123c4 100644
--- a/projects/experimental/directives/card/card.module.ts
+++ b/projects/experimental/directives/card/card.module.ts
@@ -1,10 +1,10 @@
import {NgModule} from '@angular/core';
import {TuiCardComponent} from './card.component';
-import {TuiCardDirective} from './card.directive';
+import {TuiCardLargeDirective, TuiCardMediumDirective} from './card.directive';
@NgModule({
- declarations: [TuiCardComponent, TuiCardDirective],
- exports: [TuiCardDirective],
+ declarations: [TuiCardComponent, TuiCardLargeDirective, TuiCardMediumDirective],
+ exports: [TuiCardLargeDirective, TuiCardMediumDirective],
})
export class TuiCardModule {}
diff --git a/projects/experimental/directives/card/card.styles.less b/projects/experimental/directives/card/card.styles.less
index 8c8fbdc2fb0dd..09783bb4dbe15 100644
--- a/projects/experimental/directives/card/card.styles.less
+++ b/projects/experimental/directives/card/card.styles.less
@@ -1,73 +1,109 @@
@import '@taiga-ui/core/styles/taiga-ui-local';
-[tuiCard] {
+[tuiCardMedium],
+[tuiCardLarge] {
.clearbtn();
+
position: relative;
display: flex;
align-items: flex-start;
- justify-content: space-between;
- background: var(--tui-base-02);
- border-radius: 0.75rem;
- box-sizing: border-box;
- padding: 0.75rem;
- gap: 0.75rem;
flex-shrink: 0;
- flex-direction: column;
text-decoration: none;
- width: var(--t-size);
- height: var(--t-size);
overscroll-behavior: contain;
- &,
- & > * {
- .scrollbar-hidden();
+ &[tuiTitle],
+ [tuiTitle] {
+ font-weight: bold;
+ }
+
+ [tuiTitle],
+ [tuiSubtitle] {
+ max-width: 100%;
}
- &[data-size='m'] {
- --t-size: 8.75rem;
+ > * {
+ .scrollbar-hidden();
}
+}
- [tuiTitle] {
- font-weight: bold;
+[tuiCardMedium] {
+ width: 8.75rem;
+ height: 8.75rem;
+ flex-direction: column;
+ justify-content: space-between;
+ padding: 0.75rem;
+ border-radius: var(--tui-radius-l);
+ box-sizing: border-box;
+
+ &[tuiTitle] {
+ padding: 0.625rem 0.75rem;
}
- &[tuiCell] {
- box-sizing: border-box;
+ [tuiTitle] {
+ margin: -0.125rem 0;
}
[tuiSubtitle] {
color: var(--tui-text-01);
}
+}
- [tuiTitle],
- [tuiSubtitle] {
- max-width: 100%;
+[tuiCardLarge][data-space] {
+ --t-gap: 0.75rem;
+ --t-radius: var(--tui-radius-l);
+ --t-comp: -0.25rem;
+ --t-padding: 0.75rem;
+ --t-dim: calc(var(--t-padding) + var(--t-comp));
+
+ font: var(--tui-font-text-m);
+ padding: var(--t-padding);
+ border-radius: var(--t-radius);
+ box-sizing: border-box;
+
+ &[data-space='normal'] {
+ --t-radius: 1.5rem;
+ --t-padding: 1.5rem;
+ --t-gap: 1.5rem;
}
- &[data-size='l'] {
- --t-size: 100%;
- height: auto;
- font-size: 1rem;
+ &[data-space='compact'] {
+ --t-radius: 1rem;
+ --t-padding: 1.25rem;
+ --t-gap: 1.25rem;
+ }
- & > * {
- width: 100%;
- }
+ &:not([tuiCell], [tuiHeader]) {
+ flex-direction: column;
+ gap: var(--t-gap);
+ align-items: stretch;
- [tuiCell] {
- padding: 0.5rem;
- margin: 0 -0.5rem;
+ > :last-child {
+ margin-top: auto;
}
+ }
- &[data-space='normal'] {
- border-radius: 1.5rem;
- padding: 1.5rem;
- gap: 1.5rem;
- }
+ &[tuiHeader] {
+ padding: var(--t-dim) var(--t-dim) var(--t-dim) var(--t-padding);
+ }
- &[data-space='compact'] {
- border-radius: 1rem;
- padding: 1.25rem;
- gap: 1.25rem;
+ [tuiCell] {
+ width: 100%;
+ padding: 0.5rem;
+ margin: -0.5rem -0.5rem -0.75rem;
+ border-radius: var(--tui-radius-l);
+ }
+
+ > [tuiHeader] {
+ margin: var(--t-comp) var(--t-comp) calc(1.5 * var(--t-comp)) 0;
+
+ [tuiLink] {
+ margin-right: calc(-1 * var(--t-comp));
}
}
+
+ > [tuiLink]:last-child {
+ display: block;
+ width: fit-content;
+ margin-bottom: var(--t-comp);
+ }
}
diff --git a/projects/experimental/directives/cell/cell.styles.less b/projects/experimental/directives/cell/cell.styles.less
index 798d26b050c20..1135a0726f59f 100644
--- a/projects/experimental/directives/cell/cell.styles.less
+++ b/projects/experimental/directives/cell/cell.styles.less
@@ -4,7 +4,6 @@
--tui-height: calc(var(--tui-height-s) - 0.5rem);
--t-padding: 0.125rem 1rem;
- .transition(background);
.clearbtn();
position: relative;
display: flex;
@@ -155,8 +154,8 @@
}
@media (hover: hover) and (pointer: fine) {
- a[tuiCell]:hover,
- button[tuiCell]:hover {
+ a[tuiCell]:not([tuiSurface]):hover,
+ button[tuiCell]:not([tuiSurface]):hover {
background: var(--tui-clear);
cursor: pointer;
}
diff --git a/projects/experimental/directives/surface/surface.style.less b/projects/experimental/directives/surface/surface.style.less
index 9e87e7fe5dd64..57bec957df3a0 100644
--- a/projects/experimental/directives/surface/surface.style.less
+++ b/projects/experimental/directives/surface/surface.style.less
@@ -1,21 +1,27 @@
@import '@taiga-ui/core/styles/taiga-ui-local';
// prettier-ignore
-[tuiSurface][data-surface] {
- .clearbtn();
+[data-surface] {
.transition();
--tui-gap: 0.25rem;
position: relative;
- border-radius: var(--tui-radius-l);
box-sizing: border-box;
- padding: 1rem 1.25rem;
+ background: none;
background-size: cover;
background-repeat: no-repeat;
overflow: hidden;
isolation: isolate;
- outline-color: var(--tui-focus);
- transition-property: backdrop-filter, background, border-radius, box-shadow, mask, transform;
+ appearance: none;
+ border: 0;
+ font-size: inherit;
+ line-height: inherit;
+ text-decoration: none;
+ transition-property: backdrop-filter, background, border-radius, box-shadow, mask, transform !important;
+
+ &:focus-visible {
+ outline-color: var(--tui-focus);
+ }
// Fix for https://bugs.chromium.org/p/chromium/issues/detail?id=1486408
@supports (not (-moz-appearance: none)) and (not (-webkit-hyphens: none)) {
@@ -25,14 +31,14 @@
}
}
-button[tuiSurface][data-surface] {
+button[data-surface] {
cursor: pointer;
}
-[tuiSurface][data-surface]:before,
-[tuiSurface][data-surface]:after,
-[tuiSurface][tuiSurfaceLayer]:before,
-[tuiSurface][tuiSurfaceLayer]:after {
+[data-surface]:before,
+[data-surface]:after,
+[tuiSurfaceLayer]:before,
+[tuiSurfaceLayer]:after {
.fullsize();
.transition();
content: '';
@@ -106,13 +112,13 @@ input[tuiSurfaceLayer] {
}
@media (hover: hover) and (pointer: fine) {
- [tuiSurface][data-surface]:hover & {
+ [data-surface]:hover & {
box-shadow:
inset 0 0,
inset 0 0 0 calc(var(--tui-gap) / 2) var(--tui-base-03);
}
- [tuiSurface][data-surface]:hover &:checked {
+ [data-surface]:hover &:checked {
filter: brightness(0.9);
box-shadow:
inset 0 0 0 calc(var(--tui-gap) / 2),
@@ -121,14 +127,13 @@ input[tuiSurfaceLayer] {
}
}
-[tuiSurface][data-surface='elevated'] {
+[data-surface='elevated'] {
box-shadow: var(--tui-shadow);
- border-radius: var(--tui-radius-xl);
background: var(--tui-elevation-01);
}
-button[tuiSurface][data-surface='elevated'],
-a[tuiSurface][data-surface='elevated'] {
+button[data-surface='elevated'],
+a[data-surface='elevated'] {
&:active {
box-shadow: var(--tui-shadow);
transform: scale(0.95);
@@ -143,13 +148,12 @@ a[tuiSurface][data-surface='elevated'] {
}
}
-[tuiSurface][data-surface='flat'] {
- border-radius: var(--tui-radius-xl);
+[data-surface='flat'] {
background: var(--tui-clear);
}
-button[tuiSurface][data-surface='flat'],
-a[tuiSurface][data-surface='flat'] {
+button[data-surface='flat'],
+a[data-surface='flat'] {
&:active {
transform: scale(0.95);
}