BigPizzaV3/CodexPlusPlus · error

theme.css CSS 属性无效或重复:{property}

Error message

theme.css CSS 属性无效或重复:{property}

What it means

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.

Source

Thrown at crates/codex-plus-core/src/dream_skin_package.rs:358

        let mut rule_declarations = Vec::new();
        let mut seen = HashSet::new();
        for declaration in rest[open + 1..close]
            .split(';')
            .map(str::trim)
            .filter(|value| !value.is_empty())
        {
            let (property, value) = declaration
                .split_once(':')
                .context("theme.css 声明语法无效")?;
            let property = property.trim();
            let value = value.trim();
            if !property
                .bytes()
                .enumerate()
                .all(|(index, byte)| byte.is_ascii_lowercase() || (index > 0 && byte == b'-'))
                || !seen.insert(property)
            {
                bail!("theme.css CSS 属性无效或重复:{property}");
            }
            if value.is_empty()
                || value.chars().count() > 512
                || value.contains(['{', '}', '<', '>', '!', ';'])
                || !validate_property_value(property, value)
            {
                bail!("theme.css 属性值不受 Safe CSS 支持:{property}");
            }
            declarations += 1;
            if declarations > 512 {
                bail!("theme.css 声明数量超过限制");
            }
            rule_declarations.push((property, value));
        }
        if rule_declarations.is_empty() {
            bail!("theme.css 每条规则必须至少包含一个声明");
        }
        parsed.push(SafeCssRule {

View on GitHub (pinned to f2074595a2)

Solutions

  1. Fix the property name to lowercase with hyphens only
  2. Remove the duplicate declaration within the rule
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/codex-plus-core/src/dream_skin_package.rs:358 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@f2074595a2 (2026-08-23). Data as JSON: /api/errors/7ca94d354f2a5675. Report an issue: GitHub.