Anthony Ramine
04ad28b564
Refactor how we handle trait bounds in style_derive
...
For the traits we derive which methods don't depend on associated types (i.e.
all of them but ToAnimatedValue and ToComputedValue), we now add trait bounds
for the actual field types directly, instead of bounding the type parameters.
2017-08-27 23:31:16 +02:00
Anthony Ramine
17d97cf87b
Use darling in style_derive
...
This allows use to handle #[css] in a way simpler fashion.
2017-08-24 01:28:58 +02:00
Anthony Ramine
f275895028
Introduce style_derive::cg
2017-08-23 16:52:04 +02:00
Corey Farwell
58fd2956b3
Fix typo in comment.
2017-07-26 21:29:08 +00:00
Anthony Ramine
a3af32155f
Introduce #[css(comma)]
2017-07-11 17:14:14 +02:00
Anthony Ramine
39e29f557e
Simplify machinery to serialise optional parts of CSS values
...
We simply implement ToCss for Option<T>, printing nothing if the value is None,
and we then use SequenceWriter to skip writing of separators around empty parts.
2017-06-21 11:17:22 +02:00
Anthony Ramine
3a2e79274a
Derive ToCss for keyword structs
2017-06-17 13:46:33 +02:00
Anthony Ramine
b7c83eeb64
Limit trait bounds for derive(ToCss) to types with free variables
2017-06-17 00:36:53 +02:00
Anthony Ramine
d65a7e6f95
Avoid an unwrap in #[derive(ToCss)]
2017-06-16 13:55:26 +02:00
Anthony Ramine
43a5257a0c
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.
2017-06-13 10:19:23 +02:00
Anthony Ramine
45e8b0e8c7
Support unit variants when deriving ToCss
2017-06-07 16:47:59 +02:00
Anthony Ramine
c4f1d647a0
Derive the most trivial ToCss implementations 🌋
...
For now, all variants get serialised as the space-separated serialisations
of their fields. Unit variants are not supported.
2017-06-04 16:17:56 +02:00