[docs] use variable styling for announcement bar#33693
Conversation
Greptile SummaryThis PR updates the Docusaurus announcement bar to use design-system CSS variables instead of hardcoded colours, simplifies the HTML markup, and adds a
Confidence Score: 4/5Not safe to merge as-is — the CSS module scoping bug produces dead code with leftover red debug styling, and the background colour resolves to near-transparent. Two P1 defects: the announcement bar CSS is unreachable due to CSS Module scoping (and contains Both changed files need attention:
|
| Filename | Overview |
|---|---|
| docs/docusaurus.config.ts | Announcement bar updated to use CSS variables and simpler markup; backgroundColor resolves to a 12%-opacity blue that will likely be invisible on a white background. |
| docs/src/theme/DocCard/styles.module.css | New .theme-announcement-bar rule added to wrong file — CSS Module scoping means it will never target the real announcement bar; also contains leftover color: red !important debug code. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["docusaurus.config.ts\nbackgroundColor: var(--theme-color-background-blue)\ntextColor: var(--theme-color-text-default)"] --> B["Docusaurus builds\nannouncement bar"]
B --> C["Inline style applied:\nbackground-color: rgba(79,67,221,0.12)\ncolor: rgba(3,6,21,1)"]
C --> D["⚠️ Background nearly transparent\n(12% opacity on white page)"]
E["DocCard/styles.module.css\n.theme-announcement-bar { color: red }"] --> F["CSS Modules build step"]
F --> G["Compiled to:\n.DocCard_theme-announcement-bar__hash {}"]
G --> H["❌ Never matches global\n.theme-announcement-bar element\n(Dead CSS)"]
Reviews (1): Last reviewed commit: "[docs] use variable styling for announce..." | Re-trigger Greptile
| .theme-announcement-bar { | ||
| font-weight: bold !important; | ||
| color: red !important; | ||
| } |
There was a problem hiding this comment.
Dead CSS and leftover debug code in wrong file
This block has two problems:
-
CSS Modules scope:
styles.module.csslocally scopes every class name at build time, so.theme-announcement-baris compiled to something like.DocCard_theme-announcement-bar__abc123. It will never match the globaltheme-announcement-barelement that Docusaurus generates for the announcement bar. The rule is effectively dead and will have no visible effect. -
color: red !important: This looks like a leftover debugging artefact and contradicts thetextColor: 'var(--theme-color-text-default)'value already set indocusaurus.config.ts.
If you intend to apply global styles to the announcement bar, the rule needs to live in a non-module stylesheet (e.g. custom.scss) and reference the global selector, for example:
// in custom.scss
.theme-announcement-bar {
font-weight: bold;
}|
Deploy preview for dagster-docs ready! Preview available at https://dagster-docs-njkjlb7po-elementl.vercel.app Direct link to changed pages: |
## Summary & Motivation **Before** <img width="1707" height="382" alt="image" src="https://github.com/user-attachments/assets/0f27ac7b-3d59-49e4-b78e-f1ebc143c401" /> <img width="1707" height="413" alt="image" src="https://github.com/user-attachments/assets/32bd13c3-d1e5-4d98-b95d-dc9f3985e422" /> **After** <img width="1703" height="493" alt="image" src="https://github.com/user-attachments/assets/df01b846-698c-4efb-867c-9be773039807" /> <img width="1699" height="488" alt="image" src="https://github.com/user-attachments/assets/782c8b7a-2c83-4f24-85cb-cbb552479350" /> ## Test Plan ## Changelog > The changelog is generated by an agent that examines merged PRs and > summarizes/categorizes user-facing changes. You can optionally replace > this text with a terse description of any user-facing changes in your PR, > which the agent will prioritize. Otherwise, delete this section.
Summary & Motivation
Before
After


Test Plan
Changelog