{
 "compat_features": [
  "css.types.if"
 ],
 "description": "The if() CSS function is an inline conditional value that returns a value based on a set of conditions.",
 "description_html": "The <code>if()</code> CSS function is an inline conditional value that returns a value based on a set of conditions.",
 "group": [
  "css"
 ],
 "kind": "feature",
 "name": "if()",
 "spec": [
  "https://drafts.csswg.org/css-values-5/#if-notation"
 ],
 "status": {
  "baseline": false,
  "by_compat_key": {
   "css.types.if": {
    "baseline": false,
    "support": {
     "chrome": "137",
     "chrome_android": "137",
     "edge": "137"
    }
   }
  },
  "support": {
   "chrome": "137",
   "chrome_android": "137",
   "edge": "137"
  }
 },
 "id": "if",
 "groups": [
  "css"
 ],
 "specs": [
  {
   "url": "https://drafts.csswg.org/css-values-5/#if-notation",
   "seriesComposition": "delta",
   "shortname": "css-values-5",
   "series": {
    "shortname": "css-values",
    "currentSpecification": "css-values-4",
    "title": "CSS Values and Units",
    "shortTitle": "CSS Values",
    "releaseUrl": "https://www.w3.org/TR/css-values/",
    "nightlyUrl": "https://drafts.csswg.org/css-values/"
   },
   "seriesVersion": "5",
   "shortTitle": "CSS Values 5",
   "seriesPrevious": "css-values-4",
   "organization": "W3C",
   "groups": [
    {
     "name": "Cascading Style Sheets (CSS) Working Group",
     "url": "https://www.w3.org/groups/wg/css/"
    }
   ],
   "release": {
    "url": "https://www.w3.org/TR/css-values-5/",
    "status": "Working Draft",
    "filename": "Overview.html"
   },
   "nightly": {
    "url": "https://drafts.csswg.org/css-values-5/",
    "status": "Editor's Draft",
    "alternateUrls": [
     "https://w3c.github.io/csswg-drafts/css-values-5/"
    ],
    "repository": "https://github.com/w3c/csswg-drafts",
    "sourcePath": "css-values-5/Overview.bs",
    "filename": "index.html"
   },
   "title": "CSS Values and Units Module Level 5",
   "source": "w3c",
   "categories": [
    "browser"
   ],
   "standing": "good",
   "tests": {
    "repository": "https://github.com/web-platform-tests/wpt",
    "testPaths": [
     "css/css-values"
    ]
   },
   "fragment": "if-notation"
  }
 ],
 "mdnUrls": [
  {
   "slug": "Web/CSS/Reference/Values/if",
   "title": "`if()` CSS function",
   "anchor": null,
   "url": "https://developer.mozilla.org/docs/Web/CSS/Reference/Values/if"
  }
 ],
 "standardPositions": [
  {
   "vendor": "mozilla",
   "url": "https://github.com/mozilla/standards-positions/issues/1167",
   "position": "",
   "concerns": []
  },
  {
   "vendor": "apple",
   "url": "https://github.com/WebKit/standards-positions/issues/453",
   "position": "",
   "concerns": []
  }
 ],
 "hasNegativeStandardPosition": false,
 "stateOfSurveys": [
  {
   "name": "State of CSS 2026",
   "url": "https://2026.stateofcss.com/en-US/usage/#favorite_new_features",
   "question": "usage",
   "subQuestion": "favorite_new_features",
   "path": "dataAPI.surveys.state_of_css.css2026.usage.favorite_new_features.freeform.allEditions.1.buckets.19.entity"
  },
  {
   "name": "State of CSS 2026",
   "url": "https://2026.stateofcss.com/en-US/usage/#css_interoperability_features",
   "question": "usage",
   "subQuestion": "css_interoperability_features",
   "path": "dataAPI.surveys.state_of_css.css2026.usage.css_interoperability_features.freeform.allEditions.1.buckets.2.entity"
  },
  {
   "name": "State of CSS 2026",
   "url": "https://2026.stateofcss.com/en-US/features/#reading_list",
   "question": "reading_list",
   "subQuestion": "reading_list",
   "path": "dataAPI.surveys.state_of_css.css2026.reading_list.reading_list.combined.allEditions.0.buckets.10.entity"
  },
  {
   "name": "State of CSS 2026",
   "url": "https://2026.stateofcss.com/en-US/other_features/#other_features_pain_points_features",
   "question": "other_features",
   "subQuestion": "other_features_pain_points_features",
   "path": "dataAPI.surveys.state_of_css.css2026.other_features.other_features_pain_points_features.freeform.allEditions.1.buckets.3.entity"
  },
  {
   "name": "State of CSS 2026",
   "url": "https://2026.stateofcss.com/en-US/other_features/#other_features_pain_points",
   "question": "other_features",
   "subQuestion": "other_features_pain_points",
   "path": "dataAPI.surveys.state_of_css.css2026.other_features.other_features_pain_points.freeform.allEditions.1.buckets.7.nestedBuckets.0.entity"
  },
  {
   "name": "State of CSS 2026",
   "url": "https://2026.stateofcss.com/en-US/_all_features/#all_features",
   "question": "_all_features",
   "subQuestion": "all_features",
   "path": "dataAPI.surveys.state_of_css.css2026._all_features.all_features.43.entity"
  },
  {
   "name": "State of CSS 2025",
   "url": "https://2025.stateofcss.com/en-US/features/#reading_list",
   "question": "reading_list",
   "subQuestion": "reading_list",
   "path": "dataAPI.surveys.state_of_css.css2025.reading_list.reading_list.combined.allEditions.1.buckets.11.entity"
  },
  {
   "name": "State of CSS 2025",
   "url": "https://2025.stateofcss.com/en-US/features/#all_features",
   "question": "features",
   "subQuestion": "all_features",
   "path": "dataAPI.surveys.state_of_css.css2025.features.all_features.60.entity"
  }
 ],
 "chromeUseCounters": {
  "percentageOfPageLoad": 0.00199838,
  "url": "https://chromestatus.com/metrics/webfeature/timeline/popularity/311"
 },
 "interop": [],
 "wpt": {
  "url": "https://wpt.fyi/results?q=feature:if"
 },
 "developerSignals": {
  "url": "https://github.com/web-platform-dx/developer-signals/issues/303",
  "votes": 91
 },
 "bugs": {
  "firefox": [
   "https://bugzil.la/1981485"
  ],
  "chrome": [
   "https://issues.chromium.org/issues/346977961"
  ],
  "firefox_android": [
   "https://bugzil.la/1981485"
  ],
  "safari": [
   "https://webkit.org/b/296995"
  ],
  "safari_ios": [
   "https://webkit.org/b/296995"
  ],
  "webview_ios": [
   "https://webkit.org/b/296995"
  ]
 },
 "useCases": [
  {
   "description": "make elements dependable (if x happens, let y) etc. I want to be able to not use javascript as some websites dont allow it. i use firefox.",
   "url": "https://github.com/web-platform-dx/developer-signals/issues/303#issuecomment-4639859203"
  },
  {
   "description": "Make some colors change depending on a flag. The flag can be set in several different ways, so I need to make it a custom property.",
   "url": "https://github.com/web-platform-dx/developer-signals/issues/303#issuecomment-4755753120"
  },
  {
   "description": "I have some places where typography scales based on the selected size of the image next to it. I know the size of the image as a variable already, I'd love to be able to set weight, letter-spacing, etc. based on the image size.",
   "url": "https://github.com/web-platform-dx/developer-signals/issues/303#issuecomment-4767720502"
  }
 ],
 "baselineLowDateAsObject": null,
 "baselineHighDateAsObject": null
}