{"record":{"id":"53177a0fea169a8c","repo":"Textualize/textual","slug":"unknown-word-word-r-in-style-flags","errorCode":null,"errorMessage":"unknown word {word!r} in style flags","messagePattern":"unknown word (.+?) in style flags","errorType":"validation","errorClass":"StyleValueError","httpStatus":null,"severity":"error","filePath":"src/textual/css/_style_properties.py","lineNumber":1094,"sourceCode":"            style_flags: The style flags to set as a string. For example,\n                ``\"bold italic\"``.\n\n        Raises:\n            StyleValueError: If the value is an invalid style flag.\n        \"\"\"\n        _rich_traceback_omit = True\n        if style_flags is None:\n            if obj.clear_rule(self.name):\n                obj.refresh(children=True)\n        elif isinstance(style_flags, Style):\n            if obj.set_rule(self.name, style_flags):\n                obj.refresh(children=True)\n        else:\n            words = [word.strip() for word in style_flags.split(\" \")]\n            valid_word = VALID_STYLE_FLAGS.__contains__\n            for word in words:\n                if not valid_word(word):\n                    raise StyleValueError(\n                        f\"unknown word {word!r} in style flags\",\n                        help_text=style_flags_property_help_text(\n                            self.name, word, context=\"inline\"\n                        ),\n                    )\n            try:\n                style = Style.parse(style_flags)\n            except rich.errors.StyleSyntaxError as error:\n                if \"none\" in words and len(words) > 1:\n                    raise StyleValueError(\n                        \"cannot mix 'none' with other style flags\",\n                        help_text=style_flags_property_help_text(\n                            self.name, \" \".join(words), context=\"inline\"\n                        ),\n                    ) from None\n                raise error from None\n            if obj.set_rule(self.name, style):\n                obj.refresh(children=True)","sourceCodeStart":1076,"sourceCodeEnd":1112,"githubUrl":"https://github.com/Textualize/textual/blob/06dbeef4bb70fb718236aa418ed658ef4667a126/src/textual/css/_style_properties.py#L1076-L1112","documentation":"StyleFlagsProperty (used by rules like `text-style`) validates each whitespace-separated word against VALID_STYLE_FLAGS before delegating to rich's Style.parse. Unknown words — including misspelled flags or non-Textual web CSS keywords — raise StyleValueError naming the word.","triggerScenarios":"`styles.text_style = \"bold ittalic\"`, `styles.text_style = \"underline2\"` (if unsupported in that version), or `text-style: strike;` in TCSS. Valid flags include bold, italic, underline, reverse, none, etc.","commonSituations":"Typos, mixing in rich-only or web-CSS keywords, or flags removed/renamed across Textual versions.","solutions":["Use only documented style flags, separated by spaces","Check the VALID_STYLE_FLAGS set for your installed version if unsure"],"exampleFix":"# before\nstyles.text_style = \"bold ittalic\"\n# after\nstyles.text_style = \"bold italic\"","handlingStrategy":"validation","validationCode":"from textual.css.constants import VALID_STYLE_FLAGS\nwords = value.split()\nif all(w in VALID_STYLE_FLAGS for w in words):\n    styles.text_style = value","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Filter user-supplied style-flag words against VALID_STYLE_FLAGS before joining"],"tags":["textual","css","text-style","enum-validation"],"backgroundTag":"invalid-css-value","analyzedSha":"06dbeef4bb70fb718236aa418ed658ef4667a126","analyzedAt":"2026-08-27T02:36:57.214Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}