Avalonia Css
Source CodeδΈ­ζ–‡
  • Documentation
    • πŸŽ†Welcome
    • πŸŒοΈβ€β™‚οΈGet started
      • About Acss
      • Processes and concepts
      • Security
      • Performance Evaluation
      • Configuring the development environment
      • Debugging
      • About source code
      • FAQ
    • ❓How-to
      • Using Acss
        • Type Resolution
        • Configuration
        • Code Source
        • Extending Resources
      • Using Acss.Controls
      • Using Acss.Fluent
      • Using MessageBox
      • Using Senior
      • Using Acss.Behaviors
    • πŸ“Acss Syntax
      • Comment
      • Resource
      • Style
      • Animation
      • Behavior
    • πŸ’ŽBest Practices
      • Define a good control template
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. Documentation
  2. Acss Syntax

Animation

Animation Syntax

Acss animations will be parsed as Avalonia animations, only the syntax is different.

Animations are placed in the Children section of the style, just like child styles.

The syntax of the animation is as follows:

^Button{
    Background: Green;
    [[
        :pointerover{
            Background: Blue;
            [[
                ::animation {
                    Duration:'0:0:.2';      // Must exist.
                    FillMode:Forward;       // Optional.
                    Delay: 0.3;             // Optional.
                    // Other Properties.    // Optional.
                    KeyFrames:[             // Write 'KeyFrames' or 'Children'. 
                        KeyFrame:(0% 0,0,1,1)[             // Cue=0%, KeySpine=0,0,1,1.
                            ScaleTransform.ScaleY: 1;
                            Opacity: 1;
                        ]
                        KeyFrame:(0:0:1 0,0,1,1)[          // KeyTime=0:0:1, KeySpine=0,0,1,1.
                            ScaleTransform.ScaleY: 1.7;
                            Opacity: 1;
                        ]
                        KeyFrame:(100%)[
                            ScaleTransform.ScaleY: 1.7;
                            Opacity: var(Uni-Opacity);     // Use Dynamic Resource.
                        ]
                    ]
                }
            ]]
        }
    ]]
}

Animation is currently poorly defined and the syntax may be subject to destructive updates.

PreviousStyleNextBehavior

Last updated 1 year ago

Was this helpful?

πŸ“