{"record":{"id":"7849027f697cac80","repo":"actualbudget/actual","slug":"invalid-property-property-property-name-cann-784902","errorCode":null,"errorMessage":"Invalid property \"${property}\". Property name cannot be empty after \"--\".","messagePattern":"Invalid property \"(.+?)\"\\. Property name cannot be empty after \"--\"\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/desktop-client/src/style/customThemes.ts","lineNumber":393,"sourceCode":"    }\n\n    // Validate property name format\n    // CSS custom property names must:\n    // - Start with --\n    // - Not be empty (not just --)\n    // - Not end with a dash\n    // - Contain only valid characters (letters, digits, underscore, dash, but not at start/end positions)\n    if (property === '--' || property === '-') {\n      throw new Error(\n        `Invalid property \"${property}\". Property name cannot be empty or contain only dashes.`,\n      );\n    }\n\n    // Check for invalid characters in property name (no brackets, spaces, special chars except dash/underscore)\n    // Property name after -- should only contain: letters, digits, underscore, and dashes (not consecutive dashes at start/end)\n    const propertyNameAfterDashes = property.substring(2);\n    if (propertyNameAfterDashes.length === 0) {\n      throw new Error(\n        `Invalid property \"${property}\". Property name cannot be empty after \"--\".`,\n      );\n    }\n\n    // Check for invalid characters (no brackets, no special characters except underscore and dash)\n    if (!/^[a-zA-Z0-9_-]+$/.test(propertyNameAfterDashes)) {\n      throw new Error(\n        `Invalid property \"${property}\". Property name contains invalid characters. Only letters, digits, underscores, and dashes are allowed.`,\n      );\n    }\n\n    // Check that property doesn't end with a dash (after the -- prefix)\n    if (property.endsWith('-')) {\n      throw new Error(\n        `Invalid property \"${property}\". Property name cannot end with a dash.`,\n      );\n    }\n","sourceCodeStart":375,"sourceCodeEnd":411,"githubUrl":"https://github.com/actualbudget/actual/blob/d4334cb6e6123f4d3bcea1ad6166608884c7e658/packages/desktop-client/src/style/customThemes.ts#L375-L411","documentation":"After stripping the '--' prefix, the property must still have a non-empty name. validateRootContent checks property.substring(2) and throws when nothing remains. This is a distinct case from the '--' literal check and catches names like '---' or '-- ' (trailing whitespace trimmed) that slip past the startsWith('--') test.","triggerScenarios":"Calling validateThemeCss with ':root { ---: x; }' or a property consisting only of dashes plus whitespace, or runtime-built names like '--' + suffix where suffix is empty after sanitization.","commonSituations":"Sanitization code stripping valid characters down to nothing, template strings where the name portion was filtered out, or typos with too many dashes.","solutions":["Add a valid name after the dashes (letters, digits, underscore, dash), e.g. '---: x;' -> '--color-bg: x;'","Fix the name-generation/sanitization code so it yields a non-empty identifier","Delete the empty property declaration","Pre-validate names with /^--[a-zA-Z0-9_-]+[a-zA-Z0-9_]$/"],"exampleFix":"// before\n:root {\n  ---: #fff;\n}\n// after\n:root {\n  --color-bg: #fff;\n}","handlingStrategy":"validation","validationCode":"function namesValidAfterPrefix(css: string): boolean {\n  const root = css.match(/:root\\s*\\{([\\s\\S]*?)\\}/);\n  if (!root) return false;\n  return root[1]\n    .split(';')\n    .map((d) => d.trim())\n    .filter(Boolean)\n    .every((d) => /^--[a-zA-Z0-9_-]+\\s*:/.test(d));\n}","typeGuard":"const hasNameAfterDashes = (prop: string): boolean => prop.substring(2).length > 0;","tryCatchPattern":"try {\n  const validated = validateThemeCss(generatedCss);\n} catch (e) {\n  if (e instanceof Error && e.message.includes('empty after \"--\"')) {\n    showError('A variable name is missing after the -- prefix.');\n  }\n}","preventionTips":["Enforce the full name pattern /^--[a-zA-Z0-9_-]+$/ at name-generation time","Reject dash-only names early in any sanitization pipeline","Test CSS generators with edge-case (empty/whitespace) inputs","Avoid manual dash-heavy typing; copy known-good names"],"tags":["css","validation","custom-themes"],"backgroundTag":"invalid-css-custom-property","analyzedSha":"d4334cb6e6123f4d3bcea1ad6166608884c7e658","analyzedAt":"2026-08-29T01:02:11.213Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}