{"record":{"id":"afc6c254f5f1db97","repo":"BigPizzaV3/CodexPlusPlus","slug":"theme-css-safe-css-property","errorCode":null,"errorMessage":"theme.css 属性值不受 Safe CSS 支持：{property}","messagePattern":"theme\\.css 属性值不受 Safe CSS 支持：(.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin_package.rs","lineNumber":365,"sourceCode":"            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 {\n            selector,\n            part,\n            declarations: rule_declarations,\n        });\n        if parsed.len() > 128 {\n            bail!(\"theme.css 规则数量超过限制\");\n        }","sourceCodeStart":347,"sourceCodeEnd":383,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/dream_skin_package.rs#L347-L383","documentation":"Value whitelist guard in parse_safe_css: a property value is empty, longer than 512 chars, contains '{' '}' '<' '>' '!' or ';', or fails validate_property_value for that property. Only a curated set of safe values (colors, lengths, allowed filter functions) is supported per property.","triggerScenarios":"Thrown at crates/codex-plus-core/src/dream_skin_package.rs:365 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a value supported by Safe CSS for that property (e.g. plain color/length)","Remove forbidden characters (!, <, >, braces, semicolons) from the value"],"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-14T05:17:10.506Z"}