Skip to content

UI: Default Checkbox size via var() fallback - #82356

Closed
mirka wants to merge 4 commits into
trunkfrom
update/ui-css-var-fallbacks
Closed

mirka wants to merge 4 commits into
trunkfrom
update/ui-css-var-fallbacks

Conversation

@mirka

@mirka mirka commented Sep 2, 2026 •

Copy link
Copy Markdown
Member

What?

Start the --wp-ui-* default-via-fallback convention, converting Checkbox as the first stylesheet.

Why?

--wp-ui-* custom properties are public API. They inherit. If a component assigns the default on the class that uses the variable, that assignment overwrites any ancestor value, so consumers cannot theme from a wrapper.

#81242 is the prior instance of this, for --focus-color on outset-ring__focus.

How?

  1. Delete --wp-ui-checkbox-input-size: 16px from .root. Read var(--wp-ui-checkbox-input-size, 16px) on width and use aspect-ratio: 1 for the square.
  2. Document the rule under Public --wp-ui-* defaults in packages/ui/CONTRIBUTING.md.

Testing Instructions

  1. Run Storybook and open Design System / Components / Form / Primitives / Checkbox / Default.
  2. Confirm the control is 16px by 16px.
  3. In the inspector, set --wp-ui-checkbox-input-size: 32px on a parent of the checkbox. The box should become 32px by 32px.
  4. Toggle WordPress global CSS. Default size should stay 16px. The ancestor override should still apply.

Screenshots

Checked checkbox

No visual changes.

@mirka mirka added the [Type] Enhancement A suggestion for improvement. label Sep 2, 2026
@mirka mirka self-assigned this Sep 2, 2026
@github-actions github-actions Bot added the [Package] UI /packages/ui label Sep 2, 2026
@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

📦 Bundle size

Size Change: 0 B

Total Size: 8.01 MB

95c2913 Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 7e82040 trunk % Change
timeToFirstByte 64.45 ms +14.04% -7.29% 69.5 ms +3.96% -10.86% -7.27%
largestContentfulPaint 104 ms +3.85% -7.69% 104 ms +5.77% -1.92% 0%
lcpMinusTtfb 34.5 ms +8.55% -4.2% 36.35 ms +19.67% -10.32% -5.09%
wpBeforeTemplate 30.17 ms +25.59% -2.82% 29.94 ms +25.68% -2.07% 0.77%
wpTemplate 29.03 ms +6.44% -6.72% 29.12 ms +3.16% -4.36% -0.31%
wpTotal 60.47 ms +13.49% -7.16% 65.16 ms +3.61% -11.82% -7.2%
wpMemoryUsage 7.54 MB +0% -0% 7.50 MB +0% -0% 0.46%
wpDbQueries 17 +0% -0% 17 +0% -0% 0%

front-end-classic-theme

Metric 7e82040 trunk % Change
timeToFirstByte 52.2 ms +15.9% -2.11% 53.65 ms +14.82% -4.94% -2.7%
largestContentfulPaint 102 ms +7.84% -1.96% 100 ms +12% -2% 2%
lcpMinusTtfb 48.55 ms +0.82% -1.13% 47.6 ms +2% -3.26% 2%
wpBeforeTemplate 27.36 ms +16.23% -0.91% 27.95 ms +15.96% -3.4% -2.11%
wpTemplate 21.71 ms +6.73% -3.22% 22.13 ms +3.52% -6.01% -1.9%
wpTotal 49 ms +17.2% -2.12% 50.46 ms +12.49% -5.29% -2.89%
wpMemoryUsage 6.16 MB +0% -0% 6.12 MB +0% -0% 0.58%
wpDbQueries 14 +0% -0% 14 +0% -0% 0%

media-processing

Metric 7e82040 trunk % Change
mediaProcessingJpeg 411.13 ms +1.99% -0.67% 406.52 ms +4.52% -0.32% 1.13%
mediaProcessingAvif 6238.33 ms +0.37% -0.25% 6247.66 ms +0.21% -0.04% -0.15%
mediaProcessingJpegToAvif 4435.96 ms +0.53% -0.17% 4435.79 ms +0.12% -0.38% 0%

media-upload

Metric 7e82040 trunk % Change
jpegUploadProcessing 1434.64 ms +37.45% -0.93% 1431.73 ms +0.27% -0.7% 0.2%
pngUploadProcessing 231.89 ms +1.51% -7.14% 215.95 ms +3.9% -1.07% 7.38%
largeJpegUploadProcessing 1449.81 ms +1.03% -1.01% 1425.01 ms +0.47% -0.62% 1.74%
multipleImageUploadProcessing 1638.39 ms +7.14% -2.96% 1585.46 ms +9.25% -0.68% 3.34%

post-editor

Metric 7e82040 trunk % Change
serverResponse 356.51 ms +2.54% -9.62% 346.16 ms +2.23% -8.42% 2.99%
firstPaint 170.32 ms +24.84% -10.53% 210.1 ms +40.81% -9.95% -18.93%
domContentLoaded 995.11 ms +1.77% -0.61% 990.88 ms +1.39% -0.74% 0.43%
loaded 996.3 ms +1.76% -0.62% 991.94 ms +1.39% -0.75% 0.44%
firstContentfulPaint 329.38 ms +3% -3.47% 328.54 ms +2.89% -3.41% 0.26%
firstBlock 2671.06 ms +1.36% -1.22% 2674.85 ms +1.33% -1.21% -0.14%
type 17.91 ms +9.77% -16.25% 16.77 ms +12.28% -18.13% 6.8%
typeWithoutInspector 15.7 ms +12.36% -20.45% 16.54 ms +10.04% -15.9% -5.08%
typeWithTopToolbar 18.53 ms +9.88% -14.62% 19.3 ms +6.89% -17.15% -3.99%
typeContainer 7.71 ms +3.24% -10.25% 7.29 ms +11.8% -8.64% 5.76%
focus 60.37 ms +6.06% -5.57% 62.01 ms +6.87% -4.76% -2.64%
firstFocus 134.68 ms +0% -0% 133.08 ms +0% -0% 1.2%
selectAll 442.69 ms +2.32% -3.41% 450.79 ms +3.56% -1.13% -1.8%
listViewOpen 51.39 ms +8.76% -6.11% 50.47 ms +11.06% -13.81% 1.82%
inserterOpen 18.49 ms +6.06% -6.44% 18.84 ms +9.71% -7.91% -1.86%
inserterHover 2.83 ms +12.72% -2.12% 3.22 ms +9.01% -8.7% -12.11%
inserterSearch 7.27 ms +6.19% -6.46% 6.8 ms +16.62% -10.15% 6.91%
loadPatterns 486.41 ms +4.22% -1.66% 498.67 ms +10.73% -2.78% -2.46%
wpTotal 347.64 ms +2.36% -9.88% 337.57 ms +2.26% -8.66% 2.98%
wpMemoryUsage 13.13 MB +0% -0% 13.10 MB +0% -0% 0.22%
wpDbQueries 54 +0% -0% 54 +0% -0% 0%

site-editor

Metric 7e82040 trunk % Change
serverResponse 422.95 ms +2.88% -6.28% 422.99 ms +1.98% -6.22% -0.01%
firstPaint 238.43 ms +4.77% -19.18% 260.92 ms +8.3% -15.27% -8.62%
domContentLoaded 1347.63 ms +1.83% -1.24% 1337.01 ms +0.37% -1.76% 0.79%
loaded 1348.86 ms +1.83% -1.24% 1338.2 ms +0.37% -1.76% 0.8%
firstContentfulPaint 431.4 ms +4.91% -2.49% 415.28 ms +0.75% -1.63% 3.88%
firstBlock 4162.99 ms +0.45% -0.23% 4128.7 ms +0.52% -0.24% 0.83%
type 20.2 ms +17.92% -14.41% 19.84 ms +23.39% -18.09% 1.81%
navigate 101.27 ms +12.24% -4.38% 101.45 ms +14.36% -2.7% -0.18%
loadPatterns 1446.76 ms +8.1% -9.03% 1506.37 ms +7.06% -7.66% -3.96%
loadPages 1180.66 ms +9.51% -8.43% 1100.03 ms +2.88% -1.56% 7.33%
wpTotal 412.54 ms +2.99% -6.47% 412.32 ms +1.97% -6.3% 0.05%
wpMemoryUsage 12.02 MB +0% -0% 11.99 MB +0% -0% 0.3%
wpDbQueries 43 +2.33% -0% 43 +2.33% -0% 0%

95c2913 Run

@mirka

mirka commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

I will continue to sweep the entire package after this.

@mirka mirka changed the title UI: Default public CSS variables via var() fallbacks UI: Default Checkbox size via var() fallback Sep 3, 2026
@mirka

mirka commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

It's becoming clearer to me that maintaining public CSS variables like this "just in case" isn't worth the cost at the moment, and is better to remove as a YAGNI. I will pivot to removal strategy (cc @WordPress/gutenberg-components).

@mirka mirka closed this Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] UI /packages/ui [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant