BigPizzaV3/CodexPlusPlus · error

theme.css 属性值不受 Safe CSS 支持:{property}

Error message

theme.css 属性值不受 Safe CSS 支持:{property}

What it means

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.

Source

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

            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 {
            selector,
            part,
            declarations: rule_declarations,
        });
        if parsed.len() > 128 {
            bail!("theme.css 规则数量超过限制");
        }

View on GitHub (pinned to f2074595a2)

Solutions

  1. Use a value supported by Safe CSS for that property (e.g. plain color/length)
  2. Remove forbidden characters (!, <, >, braces, semicolons) from the value
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/codex-plus-core/src/dream_skin_package.rs:365 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/afc6c254f5f1db97. Report an issue: GitHub.