{"record":{"id":"7ca94d354f2a5675","repo":"BigPizzaV3/CodexPlusPlus","slug":"theme-css-css-property","errorCode":null,"errorMessage":"theme.css CSS 属性无效或重复：{property}","messagePattern":"theme\\.css CSS 属性无效或重复：(.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin_package.rs","lineNumber":358,"sourceCode":"        let mut rule_declarations = Vec::new();\n        let mut seen = HashSet::new();\n        for declaration in rest[open + 1..close]\n            .split(';')\n            .map(str::trim)\n            .filter(|value| !value.is_empty())\n        {\n            let (property, value) = declaration\n                .split_once(':')\n                .context(\"theme.css 声明语法无效\")?;\n            let property = property.trim();\n            let value = value.trim();\n            if !property\n                .bytes()\n                .enumerate()\n                .all(|(index, byte)| byte.is_ascii_lowercase() || (index > 0 && byte == b'-'))\n                || !seen.insert(property)\n            {\n                bail!(\"theme.css CSS 属性无效或重复：{property}\");\n            }\n            if value.is_empty()\n                || value.chars().count() > 512\n                || value.contains(['{', '}', '<', '>', '!', ';'])\n                || !validate_property_value(property, value)\n            {\n                bail!(\"theme.css 属性值不受 Safe CSS 支持：{property}\");\n            }\n            declarations += 1;\n            if declarations > 512 {\n                bail!(\"theme.css 声明数量超过限制\");\n            }\n            rule_declarations.push((property, value));\n        }\n        if rule_declarations.is_empty() {\n            bail!(\"theme.css 每条规则必须至少包含一个声明\");\n        }\n        parsed.push(SafeCssRule {","sourceCodeStart":340,"sourceCodeEnd":376,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/dream_skin_package.rs#L340-L376","documentation":"Declaration guard in parse_safe_css: a CSS property name contains characters other than lowercase letters and '-' (or a leading '-' position invalid), or the same property appears twice in one rule (HashSet insert failed). Only known simple property names, each declared once, are accepted.","triggerScenarios":"Thrown at crates/codex-plus-core/src/dream_skin_package.rs:358 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the property name to lowercase with hyphens only","Remove the duplicate declaration within the rule"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f2074595a281bc057525c748175c8eb9805b0673","analyzedAt":"2026-08-23T12:52:24.489Z","contentChangedAt":"2026-08-23T12:52:24.489Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}