Skip to main content

colour_literals

Function colour_literals 

Source
pub fn colour_literals(css: &str) -> Vec<ColourLiteral>
Expand description

Every declaration in css whose value writes a colour: a hex colour, a colour function (rgb(), oklch() and the rest), or a named colour in a property that takes one.

A mix or a relative colour built only from tokens has no literal in it and passes, and so do transparent, currentColor and the system colours, which name no colour of their own. Selectors, comments, strings and url() are not read, so #add as an id or a hex digit in a data URI is not a finding.