{"record":{"id":"85841a3b88809dfa","repo":"BigPizzaV3/CodexPlusPlus","slug":"theme-css-85841a","errorCode":null,"errorMessage":"theme.css 每条规则必须至少包含一个声明","messagePattern":"theme\\.css 每条规则必须至少包含一个声明","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin_package.rs","lineNumber":374,"sourceCode":"                || !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        }\n        rest = &rest[close + 1..];\n    }\n    if parsed.is_empty() {\n        bail!(\"theme.css 必须至少包含一条规则\");\n    }\n    Ok(parsed)\n}\n\nfn forbidden_css_character(character: char) -> bool {","sourceCodeStart":356,"sourceCodeEnd":392,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/dream_skin_package.rs#L356-L392","documentation":"Thrown by parse_safe_css when a CSS rule block closes with zero collected declarations (e.g. 'selector { }'). Each rule must carry at least one property/value pair to be representable as a SafeCssRule; the offending input is the empty rule block just parsed in theme.css.","triggerScenarios":"Thrown at crates/codex-plus-core/src/dream_skin_package.rs:374 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove empty rule blocks","Add at least one valid declaration inside each 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"}