{"record":{"id":"e6ce9a0f1c021830","repo":"elkowar/eww","slug":"scss-parsing-error","errorCode":null,"errorMessage":"SCSS parsing error: {}","messagePattern":"SCSS parsing error: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/eww/src/config/scss.rs","lineNumber":27,"sourceCode":"/// Also adds the CSS to the [`crate::file_database::FileDatabase`]\npub fn parse_scss_from_config(path: &Path) -> anyhow::Result<(usize, String)> {\n    let css_file = path.join(\"eww.css\");\n    let scss_file = path.join(\"eww.scss\");\n    if css_file.exists() && scss_file.exists() {\n        return Err(anyhow!(\"Encountered both an SCSS and CSS file. Only one of these may exist at a time\"));\n    }\n\n    let (s_css_path, css) = if css_file.exists() {\n        let css_file_content = std::fs::read_to_string(&css_file)\n            .with_context(|| format!(\"Given CSS file doesn't exist: {}\", css_file.display()))?;\n        let css = replace_env_var_references(css_file_content);\n        (css_file, css)\n    } else {\n        let scss_file_content =\n            std::fs::read_to_string(&scss_file).with_context(|| format!(\"Given SCSS file doesn't exist! {}\", path.display()))?;\n        let file_content = replace_env_var_references(scss_file_content);\n        let grass_config = grass::Options::default().load_path(path);\n        let css = grass::from_string(file_content, &grass_config).map_err(|err| anyhow!(\"SCSS parsing error: {}\", err))?;\n        (scss_file, css)\n    };\n\n    let mut file_db = error_handling_ctx::FILE_DATABASE.write().unwrap();\n    let file_id = file_db.insert_string(s_css_path.display().to_string(), css.clone())?;\n    Ok((file_id, css))\n}\n","sourceCodeStart":9,"sourceCodeEnd":35,"githubUrl":"https://github.com/elkowar/eww/blob/48f5aa8b379adf29da0b0bb9ca04164f65d8bdaa/crates/eww/src/config/scss.rs#L9-L35","documentation":"When the config uses eww.scss, parse_scss_from_config feeds the file through the grass SCSS compiler. Any compile error (syntax, unknown mixin, bad interpolation) is wrapped as 'SCSS parsing error: {}'.","triggerScenarios":"grass::from_string fails while compiling the contents of eww.scss during config load or reload — invalid SCSS syntax, unbalanced braces/parens, unknown functions or mixin misuse.","commonSituations":"SCSS copied from a project using dart-sass features grass doesn't implement; typo in a variable or mixin; unbalanced parentheses in an interpolation; stale cached config reloaded after a bad edit.","solutions":["Read the grass error message (it includes line/column) and fix the SCSS at that spot","Try compiling the file with `grass` or check grass's supported SCSS feature set","Simplify or replace unsupported SCSS constructs with plain CSS"],"exampleFix":"// before: unbalanced interpolation\n.foo { color: #{lighten($accent, 10%; }\n\n// after\n.foo { color: #{lighten($accent, 10%)}; }","handlingStrategy":"validation","validationCode":"# compile-check SCSS before loading\ngrass ~/.config/eww/eww.scss > /dev/null && echo OK","typeGuard":null,"tryCatchPattern":"match config::scss::parse_scss_from_config(&dir) {\n    Ok((id, css)) => /* proceed */,\n    Err(e) => eprintln!(\"stylesheet error: {e:#}\"),\n}","preventionTips":["Compile with grass/dart-sass in CI for your dotfiles","Avoid dart-sass-only features; check grass compatibility","Fix errors at the reported line immediately after edits"],"tags":["eww","scss","grass","parsing"],"backgroundTag":"schema-validation-failed","analyzedSha":"48f5aa8b379adf29da0b0bb9ca04164f65d8bdaa","analyzedAt":"2026-09-08T03:13:26.897Z","contentChangedAt":"2026-09-08T03:13:26.897Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}