You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The library provides support for rotation functions, used in animations to move an element around a central point. The rotate expressions are built instantiating `CssRotate` or `CssRotate3D` for 3D rotations.
RenoirSt supports scaling functions. You can use them by building an instance of `CssScale`.
537
+
538
+
An example can be:
539
+
```smalltalk
540
+
CascadingStyleSheetBuilder new
541
+
declareRuleSetFor: [ :selector | selector div ]
542
+
with: [ :style |
543
+
style
544
+
background: #blue;
545
+
animation: 'scale 5s linear infinite';
546
+
width: 100 px;
547
+
height: 100 px ];
548
+
declare: [ :cssBuilder |
549
+
cssBuilder
550
+
declareKeyframeRuleSetAt: 0 percent
551
+
with: [ :style |
552
+
style transform: (CssScale by: 2) ];
553
+
declareKeyframeRuleSetAt: 100 percent
554
+
with: [ :style |
555
+
style transform: (CssScale by: 4) ] ]
556
+
forKeyframesNamed: 'scale';
557
+
build.
558
+
```
559
+
Evaluating to:
560
+
```css
561
+
div
562
+
{
563
+
background: blue;
564
+
animation: scale 5slinearinfinite;
565
+
width: 100px;
566
+
height: 100px;
567
+
}
568
+
569
+
@keyframesscale
570
+
{
571
+
0%
572
+
{
573
+
transform: scale(2);
574
+
}
575
+
576
+
100%
577
+
{
578
+
transform: scale(4);
579
+
}
580
+
}
581
+
```
582
+
583
+
##### Skew `skew()``skewX()``skewY()`
584
+
585
+
The library supports the `skew` function, performing a shear transformation (also known as a shear mapping or a transvection), which displaces each point of an element by a given angle in each direction. To build skew functions, instantiate `CssSkew`.
The library also supports the `steps` function, used in the timing parameter of animation keyframes called `animation-timing-function`. Steps are a timing function that allows us to break an animation or transition into segments.
677
+
678
+
A usage example can be:
679
+
```smalltalk
680
+
CascadingStyleSheetBuilder new
681
+
declareRuleSetFor: [ :selector | selector div ]
682
+
with: [ :style |
683
+
style
684
+
background: #blue;
685
+
animationName: 'scale';
686
+
animationDuration: 5 s;
687
+
animationTimingFunction: (CssSteps by: 2);
688
+
animationIterationCount: #infinite;
689
+
width: 100 px;
690
+
height: 100 px ];
691
+
declare: [ :cssBuilder |
692
+
cssBuilder
693
+
declareKeyframeRuleSetAt: 0 percent
694
+
with: [ :style |
695
+
style transform: (CssScale by: 2) ];
696
+
declareKeyframeRuleSetAt: 100 percent
697
+
with: [ :style |
698
+
style transform: (CssScale by: 4) ] ]
699
+
forKeyframesNamed: 'scale';
700
+
build.
701
+
```
702
+
Evaluating to:
703
+
```css
704
+
div
705
+
{
706
+
background: blue;
707
+
animation-name: scale;
708
+
animation-duration: 5s;
709
+
animation-timing-function: steps(2);
710
+
animation-iteration-count: infinite;
711
+
width: 100px;
712
+
height: 100px;
713
+
}
714
+
715
+
@keyframesscale
716
+
{
717
+
0%
718
+
{
719
+
transform: scale(2);
720
+
}
721
+
722
+
100%
723
+
{
724
+
transform: scale(4);
725
+
}
726
+
}
727
+
```
728
+
729
+
##### Cubic Bezier
730
+
731
+
Renoir supports the `cubic-bezier` function, that can be used with the `transition-timing-function` property to control how a transition will change speed over its duration. It also works with the `animation-timing-function` for keyframes. To create your own cubic bezier timing function build an instance with `CssCubicBezier`.
0 commit comments