mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Document how style traits can be derived
This commit is contained in:
parent
41c3be54ea
commit
ba4136b5a8
4 changed files with 44 additions and 3 deletions
|
@ -18,8 +18,12 @@ use std::fmt::{self, Write};
|
|||
/// of their name;
|
||||
/// * unit variants whose name starts with "Moz" or "Webkit" are prepended
|
||||
/// with a "-";
|
||||
/// * variants with fields get serialised as the space-separated serialisations
|
||||
/// of their fields.
|
||||
/// * if `#[css(comma)]` is found on a variant, its fields are separated by
|
||||
/// commas, otherwise, by spaces;
|
||||
/// * if `#[css(function)]` is found on a variant, the variant name gets
|
||||
/// serialised like unit variants and its fields are surrounded by parentheses;
|
||||
/// * finally, one can put `#[css(derive_debug)]` on the whole type, to
|
||||
/// implement `Debug` by a single call to `ToCss::to_css`.
|
||||
pub trait ToCss {
|
||||
/// Serialize `self` in CSS syntax, writing to `dest`.
|
||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: Write;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue