style: Reserve -- as a custom property name

I think this should be fairly low risk, let's try to get it done sooner
rather than later.

Differential Revision: https://phabricator.services.mozilla.com/D116456
This commit is contained in:
Emilio Cobos Álvarez 2023-05-21 22:01:52 +02:00 committed by Oriol Brufau
parent 44b94f66f9
commit 832807f15f

View file

@ -88,7 +88,7 @@ pub type Name = Atom;
///
/// <https://drafts.csswg.org/css-variables/#typedef-custom-property-name>
pub fn parse_name(s: &str) -> Result<&str, ()> {
if s.starts_with("--") {
if s.starts_with("--") && s.len() > 2 {
Ok(&s[2..])
} else {
Err(())