Closed nsbarsukov closed 8 months ago
@waterplea also proposed solution with contrast(0)
.
Example with multi-line text:
background: red;
border-radius: 1rem;
box-decoration-break: clone;
filter: contrast(0) brightness(0);
opacity: 0.1;
TODO: Investigate if we could use it. How we can configure the background color of the skeleton ? π€
Current implementation
It global class
.tui-skeleton
with modifiers.Learn more: https://taiga-ui.dev/skeleton
Problems:
New proposed API
Introduce new
TuiSkeletonDirective
. It usestuiWithStyles
inside to add:before
/:after
pseudo-elements. It uses power of Dependency Injection.Case 1. Configure all nested skeletons from the root element
All
TuiSkeletonDirective
injects itself insideAnd default value of its state (enabled/disabled) is equal to computed input-value of its nearest parent. But develop can overwrite it and provide explicit input-prop to any nested skeleton.
Case 2. Replace legacy
.tui-skeleton_light
class withtuiMode
-directive Before:After:
Case 3. Is
.tui-skeleton_text
actually required ? Investigate should developer always mark all text-containers (a.k.a previous class.tui-skeleton_text
). Or we could do it automatically ? For example, investigate if:after
-element could always be non-breaking space https://github.com/taiga-family/taiga-ui/blob/a276f7c9dd0417c40a24e2b2b97dfb24a908ff51/projects/styles/markup/tui-skeleton.less#L35-L37New animation for switching between skeleton and animation
Cross-fade animation. Smoothly change of
opacity
on swithching. Content dissappers / appears smoothly. Skeleton appears/dissappers smoothly.