{"record":{"id":"405db1575c7e4359","repo":"BigPizzaV3/CodexPlusPlus","slug":"theme-css-405db1","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":387,"sourceCode":"                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 {\n    matches!(\n        character as u32,\n        0x0000..=0x0008 | 0x000b | 0x000e..=0x001f | 0x007f..=0x009f\n            | 0x2028 | 0x2029 | 0x200e | 0x200f | 0x202a..=0x202e | 0x2066..=0x2069 | 0xfeff\n    )\n}\n\nfn validate_property_value(property: &str, value: &str) -> bool {\n    const COLOR_PROPERTIES: &[&str] = &[\n        \"color\",\n        \"background-color\",\n        \"border-color\",\n        \"border-top-color\",","sourceCodeStart":369,"sourceCodeEnd":405,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/dream_skin_package.rs#L369-L405","documentation":"Thrown by parse_safe_css at the end of parsing when no rule was successfully collected — the entire theme.css produced an empty parsed list even though it passed the earlier non-empty byte check (e.g. it contained only garbage that never formed a rule). The offending input is the overall theme.css content; the package is rejected because a skin must define at least one style rule.","triggerScenarios":"Thrown at crates/codex-plus-core/src/dream_skin_package.rs:387 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add at least one valid [data-ds-part] rule to theme.css","Verify the stylesheet is not empty or only whitespace"],"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"}