mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Introduce #[css(function)] for #[derive(ToCss)]
Any variant with this attribute gets serialised as a CSS function, using the variant name as the function name.
This commit is contained in:
parent
fd1ab75af9
commit
43a5257a0c
7 changed files with 66 additions and 66 deletions
|
@ -25,7 +25,7 @@ pub fn derive_to_computed_value(stream: TokenStream) -> TokenStream {
|
|||
to_computed_value::derive(input).to_string().parse().unwrap()
|
||||
}
|
||||
|
||||
#[proc_macro_derive(ToCss)]
|
||||
#[proc_macro_derive(ToCss, attributes(css))]
|
||||
pub fn derive_to_css(stream: TokenStream) -> TokenStream {
|
||||
let input = syn::parse_derive_input(&stream.to_string()).unwrap();
|
||||
to_css::derive(input).to_string().parse().unwrap()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue