{"record":{"id":"c46c246dd10ada72","repo":"swc-project/swc","slug":"expected-at-the-start-of-custom-property-name","errorCode":null,"errorMessage":"Expected '--' at the start of custom property name","messagePattern":"Expected '--' at the start of custom property name","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"crates/swc_css_parser/src/parser/values_and_units/mod.rs","lineNumber":1907,"sourceCode":"        }\n    }\n}\n\nimpl<I> Parse<CustomPropertyName> for Parser<I>\nwhere\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!()","sourceCodeStart":1889,"sourceCodeEnd":1925,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_css_parser/src/parser/values_and_units/mod.rs#L1889-L1925","documentation":"Fired while parsing a CustomPropertyName: an Ident token was present, but its value did not start with `--`, which the CSS custom properties spec requires for custom property names. Input at fault is a declaration whose property looks like a custom property context but has a normal name, e.g. using a non-`--` prefixed name where --var syntax is mandatory.","triggerScenarios":"Thrown at crates/swc_css_parser/src/parser/values_and_units/mod.rs:1907 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Prefix the property name with '--' (e.g. '--brand-color')","Use a normal declaration if a standard property was intended"],"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"}