Skip to content

Clarify when var() falls back to its second argument#44015

Merged
pepelsbey merged 3 commits intomdn:mainfrom
pepelsbey:var-fallback
May 6, 2026
Merged

Clarify when var() falls back to its second argument#44015
pepelsbey merged 3 commits intomdn:mainfrom
pepelsbey:var-fallback

Conversation

@pepelsbey
Copy link
Copy Markdown
Member

@pepelsbey pepelsbey commented May 5, 2026

Description

Updates the var() syntax section with a more accurate fallback description.

Motivation

The previous wording was misleading: not every CSS-wide keyword triggers the fallback (only initial, and only for non-registered custom properties), and it ignored @property-registered properties and cyclic dependencies.

Additional details

Related issues and pull requests

Fixes #44011

@pepelsbey pepelsbey requested a review from a team as a code owner May 5, 2026 14:30
@pepelsbey pepelsbey requested review from chrisdavidmills and removed request for a team May 5, 2026 14:30
@github-actions github-actions Bot added Content:CSS Cascading Style Sheets docs size/s [PR only] 6-50 LoC changed labels May 5, 2026
@pepelsbey
Copy link
Copy Markdown
Member Author

@nchevobbe let me know if it makes it more accurate

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Preview URLs (1 page)

Flaws (2)

Found an unexpected or unresolvable flaw? Please report it here.

URL: /en-US/docs/Web/CSS/Reference/Values/var
Title: var() CSS function
Flaw count: 2

  • broken_links:
    • Link /en-US/docs/Web/CSS/Reference/Values/custom-property-name doesn't resolve
    • Link /en-US/docs/Web/CSS/Reference/Values/declaration-value doesn't resolve

(comment last updated: 2026-05-06 12:07:12)

@nchevobbe
Copy link
Copy Markdown
Contributor

@nchevobbe let me know if it makes it more accurate

that looks great to me, thanks a lot !

@pepelsbey pepelsbey changed the title Var fallback Clarify when var() falls back to its second argument May 5, 2026
Copy link
Copy Markdown
Contributor

@chrisdavidmills chrisdavidmills left a comment

Choose a reason for hiding this comment

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

Looking pretty good, @pepelsbey. Just one language suggestion, but I'll approve, so you can merge when you've looked at it.

Comment thread files/en-us/web/css/reference/values/var/index.md Outdated
Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>
@pepelsbey pepelsbey merged commit f551881 into mdn:main May 6, 2026
9 checks passed
@pepelsbey
Copy link
Copy Markdown
Member Author

Thanks everyone!

@pepelsbey pepelsbey deleted the var-fallback branch May 6, 2026 12:08
pepelsbey added a commit to pepelsbey/mdn-content that referenced this pull request May 6, 2026
* upstream/main: (150 commits)
  PWA relative links (mdn#43953)
  feat(jsondata): add `external_link` translation key (mdn#43978)
  Clarify when var() falls back to its second argument (mdn#44015)
  Correct incorrect filename on learn assessment (mdn#44012)
  FF151 Relnote CanvasRenderingContext2D.lang (mdn#44010)
  FF151: Update container style queries support (mdn#44002)
  Firefox experimental features clean-up (mdn#43887)
  FF151 Relnote: shadowrootslotassignment (mdn#43881)
  Editorial review: Document WebGPU compatibility mode (mdn#43944)
  Correction of solution (mdn#44001)
  Synchronize with BCD v7.3.14 (mdn#44007)
  Editorial review: Document texture_and_sampler_let WGSL feature (mdn#43768)
  Editorial review: Document NavigationTransition.committed (mdn#43692)
  Update window.open on document / window creation and load behavior (mdn#43913)
  FF151 Relnote: keyboardLock option for Element.requestFullScreen() (mdn#43883)
  FF118 keyboard value for Window Event tidy (mdn#43942)
  Bump yaml from 2.8.3 to 2.8.4 (mdn#44005)
  Rename Stylesheet glossary definition to Style sheet (mdn#43997)
  Clarify else-if evaluation order (mdn#43917)
  chore(dictionaries): add technical terms flagged by spelling check (mdn#43907)
  ...

# Conflicts:
#	files/en-us/web/api/svgscriptelement/async/index.md
#	files/en-us/web/api/svgscriptelement/index.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:CSS Cascading Style Sheets docs size/s [PR only] 6-50 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incomplete / misleading about var() fallback usage

4 participants