pub type CSSNumber = f32;Expand description
A CSS <number> value.
Numbers may be explicit or computed by calc(), but are always stored and serialized
as their computed value.
Trait Implementations§
Source§impl<'i> Parse<'i> for CSSNumber
impl<'i> Parse<'i> for CSSNumber
Source§fn parse<'t>(
input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i, ParserError<'i>>>
fn parse<'t>( input: &mut Parser<'i, 't>, ) -> Result<Self, ParseError<'i, ParserError<'i>>>
Parse a value of this type using an existing parser.
Source§fn parse_string(input: &'i str) -> Result<Self, ParseError<'i, ParserError<'i>>>
fn parse_string(input: &'i str) -> Result<Self, ParseError<'i, ParserError<'i>>>
Parse a value from a string. Read more
Source§impl<'i> ParseNumeric<'i> for CSSNumber
impl<'i> ParseNumeric<'i> for CSSNumber
Source§fn parse_with_range<'t>(
input: &mut Parser<'i, 't>,
range: NumericRange,
) -> Result<Self, ParseError<'i, ParserError<'i>>>
fn parse_with_range<'t>( input: &mut Parser<'i, 't>, range: NumericRange, ) -> Result<Self, ParseError<'i, ParserError<'i>>>
Parses a numeric value, checking literals and clamping resolved calculations
to the given range. Intermediate calculation operands are unrestricted.
Source§impl ToCss for CSSNumber
impl ToCss for CSSNumber
Source§fn to_css<PrinterT: PrinterTrait>(
&self,
dest: &mut PrinterT,
) -> Result<(), PrinterError>
fn to_css<PrinterT: PrinterTrait>( &self, dest: &mut PrinterT, ) -> Result<(), PrinterError>
Serialize
self in CSS syntax, writing to dest.Source§fn to_css_string(
&self,
options: PrinterOptions<'_>,
) -> Result<String, PrinterError>
fn to_css_string( &self, options: PrinterOptions<'_>, ) -> Result<String, PrinterError>
Serialize
self in CSS syntax and return a string. Read more