mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Implement #[animate(fallback)] for #[derive(Animate)]
This allows us to derive the Animate trait, providing a fallback function for when the 2 values aren't similar.
This commit is contained in:
parent
3751fe9fdc
commit
4a4bf89575
7 changed files with 99 additions and 121 deletions
|
@ -19,7 +19,7 @@ mod to_animated_zero;
|
|||
mod to_computed_value;
|
||||
mod to_css;
|
||||
|
||||
#[proc_macro_derive(Animate, attributes(animation))]
|
||||
#[proc_macro_derive(Animate, attributes(animate, animation))]
|
||||
pub fn derive_animate(stream: TokenStream) -> TokenStream {
|
||||
let input = syn::parse_derive_input(&stream.to_string()).unwrap();
|
||||
animate::derive(input).to_string().parse().unwrap()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue