Skip to content

[3.0] Document the theme's CSS naming conventions - #9379

Merged
live627 merged 1 commit into
SimpleMachines:release-3.0from
albertlast:docs/css-naming
Aug 8, 2026
Merged

[3.0] Document the theme's CSS naming conventions#9379
live627 merged 1 commit into
SimpleMachines:release-3.0from
albertlast:docs/css-naming

Conversation

@albertlast

Copy link
Copy Markdown
Collaborator

Description

Documents the theme's CSS naming conventions in AGENTS.md, so that coding agents get them right the first time instead of being corrected in review.

php-cs-fixer only looks at PHP, so none of this is enforced automatically and nothing in the repository stated it. This came up in #9372, where the review asked for snake_case class names instead of kebab-case.

The new ### CSS naming subsection records three things, each checked against release-3.0 rather than assumed:

  • Class names are snake_case. 389 of the 392 class selectors in Themes/default/css/index.css follow this. The three that do not (.sceditor-container, .dz-image-preview, .g-recaptcha) are all owned by third-party code, so the section says explicitly that they are not a precedent for new classes — otherwise the next reader finds a kebab-case class and copies it.
  • Custom properties stay kebab-case (--body-bg, --primary-color-500), with a note not to "correct" them. The class-name rule is about class names only, and there are 209 kebab-case custom properties already in the theme.
  • The underscore-suffix pattern for custom properties, --component-property_variant. The variant is usually a state (--input-bg_hover, --button-border-color_active), but the same slot carries other modifiers where a component needs them (--progressbar-inner-bg_green, --genericbar-inner-box-shadow_vertical). 37 of the 246 custom properties use a suffix.

Documentation only — no code, CSS or template changes, so nothing here affects the running forum.

Issues References (Fixes|Related|Closes)

  1. Related: [3.0] Theme split (wave 3, part 4) — Give the width-limited wrappers a shared class #9372

Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
@live627
live627 merged commit 29b7b8c into SimpleMachines:release-3.0 Aug 8, 2026
4 checks passed
@jdarwood007 jdarwood007 added this to the 3.0 Alpha 5 milestone Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants