Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md Add guidelines for adding animations #2920

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions tutorials/Web/Style_Dsl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,32 @@ object AppStylesheet : StyleSheet() {
}
```

### Animation example
To specify an animation query, you can use the 'animation' function, which takes in the relevant query and a style block.
You can also move the animation or control its time.
``` kotlin
object AppStyleSheet : StyleSheet() {
val bounce by keyframes {
from {
property("transform", "translateX(50%)")
}

to {
property("transform", "translateX(-50%)")
}
}

val myClass by style {
animation(bounce) {
duration(2.s)
timingFunction(AnimationTimingFunction.EaseIn)
direction(AnimationDirection.Alternate)
}
}
}
```


### CSS Variables

The style DSL also provides support for CSS variables.
Expand Down