{"record":{"id":"7317c6b0197534b2","repo":"BigPizzaV3/CodexPlusPlus","slug":"theme-css-7317c6","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":369,"sourceCode":"            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        }\n        rest = &rest[close + 1..];\n    }\n    if parsed.is_empty() {\n        bail!(\"theme.css 必须至少包含一条规则\");","sourceCodeStart":351,"sourceCodeEnd":387,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/dream_skin_package.rs#L351-L387","documentation":"Thrown by parse_safe_css when the total declaration count across all rules exceeds 512. It fires while iterating declarations (each property/value pair increments a counter), guarding against oversized stylesheets that would slow the Safe CSS compiler. The offending input is the aggregated declaration count of theme.css, not a single rule.","triggerScenarios":"Thrown at crates/codex-plus-core/src/dream_skin_package.rs:369 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reduce the number of declarations to 512 or fewer","Merge or drop redundant declarations"],"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"}