Skip to content

feat(docs): added color tables to background utilities - #3782

Open
duvalale wants to merge 4 commits into
mainfrom
ouds/main-ad-utilities-bg-doc-improvements
Open

duvalale wants to merge 4 commits into
mainfrom
ouds/main-ad-utilities-bg-doc-improvements

Conversation

@duvalale

@duvalale duvalale commented Sep 2, 2026

Copy link
Copy Markdown
Member

Related issues

Closes #3489

Description

Improves background documentation by displaying them in color tables like in color utilities docs.

Checklists

Progression (for Core Team only)

Live previews

@netlify

netlify Bot commented Sep 2, 2026

Copy link
Copy Markdown

Deploy Preview for boosted ready!

Name Link
🔨 Latest commit 16c8c60
🔍 Latest deploy log https://app.netlify.com/projects/boosted/deploys/6aaa4e8920e7f00008bbf53a
😎 Deploy Preview https://deploy-preview-3782--boosted.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@duvalale
duvalale marked this pull request as ready for review September 3, 2026 09:27
@boosted-bot boosted-bot moved this from In Progress / Draft to Need Dev Review in 🟣 [Orange-Boosted-Bootstrap] PRs Board Sep 3, 2026
@duvalale
duvalale force-pushed the ouds/main-ad-utilities-bg-doc-improvements branch from 7c68469 to cbcf0a2 Compare September 3, 2026 15:06
@louismaximepiton
louismaximepiton requested review from louismaximepiton and a lite review from Copilot September 3, 2026 16:03
@louismaximepiton

Copy link
Copy Markdown
Member

Just a quick comment, but it would be great to also have the associated theme that should be used in combination of the class

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The updated background documentation no longer clearly surfaces the per-utility recommended data-bs-theme values (a key requirement of #3489), and the current table rendering introduces at least one misleading preview case (transparent).

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates the background utilities documentation to present background-related utilities in a tabular “color table” format (similar to the color utilities docs), and extends the shared ColorTable shortcode to support non-token-based class lists.

Changes:

  • Replaces several <Example> blocks in utilities/background.mdx with <ColorTable> instances for Bootstrap compatibility and OUDS background/surface/always/opacity groupings.
  • Enhances ColorTable.astro to support basicClasses (non-token-driven rows) and an optional hasBackdrop flag, and refactors token collection into a single tokens list.
File summaries
File Description
site/src/content/docs/utilities/background.mdx Switches background utility documentation examples to ColorTable tables, including Bootstrap-compatibility and OUDS token-backed sections.
site/src/components/shortcodes/ColorTable.astro Adds support for basicClasses-driven tables and optional backdrop indication, and refactors token extraction/rendering accordingly.
Review details

Suppressed comments (1)

site/src/components/shortcodes/ColorTable.astro:140

  • Same issue as the light-mode column: the preview class name for basicClasses is derived from getUsage(token.colorName) without colorPrefix, which can break the default getUsage implementation and is inconsistent with the usage cell.

Pass colorPrefix and use a boolean value for class:list for clarity.

                    class:list={['w-100 h-100 mb-none d-flex justify-content-center align-items-center', basicClasses.length > 0 ? { [ getUsage(token.colorName).replace('.', '')]: token.colorName } : {}]}
  • Files reviewed: 2/2 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread site/src/components/shortcodes/ColorTable.astro Outdated
Comment on lines +76 to +79
<ColorTable
colorPrefix="ouds/color/bg/"
tokenRegexp={/\$ouds-color-(bg-(?<colorName>.*)-light)/}
getUsage={(colorName) => `.bg-${colorName}`} />
Comment on lines +89 to +92
<ColorTable
colorPrefix="ouds/color/transparent/"
basicClasses={['transparent']}
getUsage={(colorName) => `.bg-${colorName}`} />
@MaxLardenois MaxLardenois removed their assignment Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Need Dev Review

Development

Successfully merging this pull request may close these issues.

Organize background colors the same way that they are organized in Foundation > Colors

5 participants