{"record":{"id":"769c80619b5fa8fe","repo":"swc-project/swc","slug":"expected-valid-dashed-is-not-valid-custom-pr","errorCode":null,"errorMessage":"Expected valid dashed, '--' is not valid custom property name","messagePattern":"Expected valid dashed, '--' is not valid custom property name","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"crates/swc_css_parser/src/parser/values_and_units/mod.rs","lineNumber":1912,"sourceCode":"where\n    I: ParserInput,\n{\n    fn parse(&mut self) -> PResult<CustomPropertyName> {\n        let span = self.input.cur_span();\n\n        if !is!(self, Ident) {\n            return Err(Error::new(span, ErrorKind::Expected(\"Ident\")));\n        }\n\n        match bump!(self) {\n            Token::Ident { value, raw, .. } => {\n                if !value.starts_with(\"--\") {\n                    return Err(Error::new(\n                        span,\n                        ErrorKind::Expected(\"'--' at the start of custom property name\"),\n                    ));\n                } else if &*value == \"--\" {\n                    return Err(Error::new(\n                        span,\n                        ErrorKind::Expected(\"valid dashed, '--' is not valid custom property name\"),\n                    ));\n                }\n\n                Ok(CustomPropertyName {\n                    span,\n                    value,\n                    raw: Some(raw),\n                })\n            }\n            _ => {\n                unreachable!()\n            }\n        }\n    }\n}\n","sourceCodeStart":1894,"sourceCodeEnd":1930,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_css_parser/src/parser/values_and_units/mod.rs#L1894-L1930","documentation":"Fired by the CustomPropertyName parser: the ident is exactly '--' with nothing after the prefix. Per spec, '--' alone is not a valid custom property name; at least one character must follow the two hyphens.","triggerScenarios":"Thrown at crates/swc_css_parser/src/parser/values_and_units/mod.rs:1912 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add a name after the '--' prefix (e.g. '--spacing')","Remove the empty custom property declaration"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5176682b65416c6b5de6b47379ae1588ea3ecb3f","analyzedAt":"2026-08-17T16:16:52.067Z","contentChangedAt":"2026-08-17T16:16:52.067Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}