What problem does it solve?
Discourse UI code must survive themes, light and dark color schemes, every viewport width, and screen readers, and ad-hoc styling breaks under those conditions. This Skill encodes Discourse's frontend conventions so templates and stylesheets are themeable, responsive, and accessible by default.
Core Features & Use Cases
- BEM naming with standalone modifiers: Enforces Discourse's modified BEM convention (block, block__element, standalone .--modifier, is-/has- state classes) so themes can target and override components cleanly.
- Themeable color and theming rules: Prohibits hardcoded colors in favor of the CSS custom-property palette, semantic --token-color-* tokens, and --d-* design variables so dark mode and themes work without extra code.
- CSS repair workflows: Provides patterns for fixing regressions—scoping broad selectors, deleting stale CSS, consolidating device splits into common/ with lib/viewport mixins, and fixing overflow with containment primitives.
- Template and accessibility conventions: Covers .gjs/.hbs escaping, dIcon usage, FormKit forms, DButton variants, .sr-only text, a11y live-region announcements, and RTL logical properties.
- Use Case: When fixing a mobile overflow bug in a plugin stylesheet, the Skill directs you to scope the leaking selector, replace fixed widths with minmax(0, 1fr) and min-width: 0, move the rule into common/ with viewport mixins, and verify across viewports, palettes, and RTL.
Quick Start
Use the discourse-writing-html-css skill to review my new component's .gjs template and SCSS file for BEM naming, hardcoded colors, and responsive layout issues.