Sep 25, 2025
By the summer of 2025, Chrome shipped an experimental CSS feature — if(). At first glance, it sounds revolutionary: finally, conditions in CSS! But is it as powerful as it sounds? Let’s go through it step by step.
What does if() actually do?
The if() function lets you assign property values based on conditions. It lives right inside the value — conceptually closer to a ternary operator than to a full-blown if statement in programming languages.
First kind of condition — style queries
If the custom property --scheme equals dark, the background becomes gray:
body {
--scheme: dark;
background: if(
style(--scheme: dark): gray;
);
}
If the value is different, the function resolves to Guaranteed-invalid value (effectively the same as initial).
body {
--scheme: color;
background: if(
style(--scheme: dark): gray;
);
}
The regular cascade just skips a broken declaration and keeps the previous value. if(), on the other hand, resets the property entirely — as if you’d explicitly written initial.
You can add another condition to handle a new value:
body {
--scheme: color;
background: if(
style(--scheme: dark): gray;
style(--scheme: color): lightblue;
);
}
And if nothing matches — there’s always an else branch, just like in “real” programming languages:
body {
--scheme: other;
background: if(
style(--scheme: dark): gray;
style(--scheme: color): lightblue;
else: tomato;
);
}
Second kind — media queries
The function also works with media expressions:
h1 {
font-size: if(
media(width > 700px): 72px;
else: 42px;
);
}
If the viewport is wider than 700 px — you get a big, bold heading. Otherwise, it stays smaller.
Third kind — feature queries
if() also supports feature queries. For example, you can set a red text color if the element() function isn’t supported:
h1 {
color: if(
not supports(element("#myid")): red;
else: white;
);
}
If you only need to tweak a single value — if() looks neat and concise.
But let’s be honest — everything we’ve seen so far could be done before, just differently.
Do we really need it?
The same checks can be done using plain directives: @container, @media, and @supports. The behavior is identical:
:root {
--scheme: other;
}
body {
background: tomato;
}
@container style(--scheme: dark) {
body { background: gray; }
}
@container style(--scheme: color) {
body { background: lightblue; }
}
@media (width > 700px) {
h1 { font-size: 72px; }
}
@supports not (element("#myid")) {
h1 { color: red; }
}
@supports (width: calc(1px * sibling-count())) {
h1 { background-color: white; }
}
In short: if() doesn’t introduce new logic. It’s pure syntactic sugar that brings existing query mechanisms down to the value level.
At first, if()-based code looks more compact. But that’s true only when you’re changing a single property — which, frankly, is pretty rare.
Not quite what we imagined
When you hear about a “real if in CSS”, you imagine comparing variables and triggering different sets of properties right inside a CSS rule:
.compare-numbers {
--a: 5;
--b: 10;
if (var(--a) > var(--b)) {
width: 100px;
height: 200px;
} else {
width: 250px;
height: 150px;
}
}
The reality turned out much simpler: if() works only inside a single property value — no comparison operators, no multiple variables, no logic blocks.
Basically, you can only check whether a variable equals a specific value. That’s it:
.selector {
--a: 5;
width: if(style(--a: 5): 100px;);
}
In JavaScript, that would look roughly like this:
let a = 5;
let width = (a === 5) ? "100px" : "";
“Imagine if JavaScript had only this kind of powerful conditional logic!”
A glimmer of hope: self queries
But not everything is disappointing.
Here’s the bright side: if() can check not only parent variables (as container style queries do) but also variables defined on the element itself.
For example:
h1 {
font-size: if(
style(--size: small): 32px;
else: 72px;
);
}
When --size isn’t defined, the else branch triggers (72 px). Add the variable directly to the element — and the condition fires:
h1 {
--size: small;
font-size: if(
style(--size: small): 32px;
else: 72px;
);
}
This may look minor, but it’s important:
traditional directives like @container only observe parents,
while if() can look at itself.
Looking ahead
How could if() evolve?
- Add comparison operators: <, >, <=, >=.
- Support multiple variable comparisons.
- Work on the rule level, not just property values.
Extra operators and variable comparisons are probably next on the roadmap.
But lifting if() to the rule level? That’s going to be hard.
Verdict: breakthrough or breakdown?
If if() stays exactly as it is now, it’s a bit of a failure.
Put it on your linter’s blacklist and move on — because in its current form, it lets you write the same messy logic as in preprocessors, only natively.
Still, there’s hope. If this experiment keeps evolving, it might become something bigger.
The current release isn’t a failure or a triumph — more like a “pre-patch before the major update.”
<!DOCTYPE html><html lang="en" class="no-js"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><script>var b=document.documentElement.classList;b.remove('no-js');if(!window.Promise||!window.sessionStorage||!!sessionStorage.getItem('muller.v2')){b.add('muller')}</script><link rel="dns-prefetch" href="https://assets.htmlacademy.org"><script async src="https://www.googletagmanager.com/gtag/js?id=G-MXPCRXM48C"></script><script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-MXPCRXM48C');
</script><script type="text/javascript">
(function(e,t){var n=e.amplitude||{_q:[],_iq:{}};var r=t.createElement("script")
;r.type="text/javascript"
;r.integrity="sha384-d/yhnowERvm+7eCU79T/bYjOiMmq4F11ElWYLmt0ktvYEVgqLDazh4+gW9CKMpYW"
;r.crossOrigin="anonymous";r.async=true
;r.src="https://cdn.amplitude.com/libs/amplitude-5.2.2-min.gz.js"
;r.onload=function(){if(!e.amplitude.runQueuedFunctions){
console.log("[Amplitude] Error: could not load SDK")}}
;var i=t.getElementsByTagName("script")[0];i.parentNode.insertBefore(r,i)
;function s(e,t){e.prototype[t]=function(){
this._q.push([t].concat(Array.prototype.slice.call(arguments,0)));return this}}
var o=function(){this._q=[];return this}
;var a=["add","append","clearAll","prepend","set","setOnce","unset"]
;for(var u=0;u<a.length;u++){s(o,a[u])}n.Identify=o;var c=function(){this._q=[]
;return this}
;var l=["setProductId","setQuantity","setPrice","setRevenueType","setEventProperties"]
;for(var p=0;p<l.length;p++){s(c,l[p])}n.Revenue=c
;var d=["init","logEvent","logRevenue","setUserId","setUserProperties","setOptOut","setVersionName","setDomain","setDeviceId","setGlobalUserProperties","identify","clearUserProperties","setGroup","logRevenueV2","regenerateDeviceId","groupIdentify","onInit","logEventWithTimestamp","logEventWithGroups","setSessionId","resetSessionId"]
;function v(e){function t(t){e[t]=function(){
e._q.push([t].concat(Array.prototype.slice.call(arguments,0)))}}
for(var n=0;n<d.length;n++){t(d[n])}}v(n);n.getInstance=function(e){
e=(!e||e.length===0?"$default_instance":e).toLowerCase()
;if(!n._iq.hasOwnProperty(e)){n._iq[e]={_q:[]};v(n._iq[e])}return n._iq[e]}
;e.amplitude=n})(window,document);
amplitude.getInstance().init("df11525b6880a3c5e2af14f9b6238408", null,{
includeUtm: true,
includeGclid: true,
includeReferrer: true,
deviceIdFromUrlParam: true
}, function (instance) {
window.amplitudeLoaded = true;
});
</script><link rel="stylesheet" href="https://assets.htmlacademy.org/css/core.v284.css"><link rel="stylesheet" href="https://assets.htmlacademy.org/css/text.v104.css"><link rel="stylesheet" href="https://assets.htmlacademy.org/css/profile.v236.css"><link rel="stylesheet" href="/css/custom.css"><style>
.page-content__inner {
max-width: 800px;
}
.post-list__meta {
margin-top: 15px;
font-size: 0.8em;
}
.post-list__meta .post-author {
margin-left: 10px;
color: #999;
}
.text-container {
max-width: 680px;
}
.text-container h1,
.text-container h2,
.text-container h3 {
border-bottom: none;
padding-bottom: 0;
}
.post-intro {
margin: 40px 0;
padding-bottom: 40px;
border-bottom: 2px solid #eee;
}
.post-intro h1 {
font-size: 44px;
line-height: 1.3;
margin-bottom: 10px;
}
.post-intro h1 {
font-size: 44px;
line-height: 1.3;
margin-bottom: 10px;
}
.post-intro .meta {
margin-top: 0;
}
.post-intro .post-author {
margin-left: 20px;
color: #999;
}
.post-intro .lead {
margin-bottom: 0;
font-size: 20px;
}
</style><link rel="stylesheet" href="/css/cookies.css"><link rel="preload" as="script" href="https://assets.htmlacademy.org/js/general.v274.js"><title>CSS if() — breakthrough or breakdown? — Blog — HTML Academy</title><meta name="description" content="Let’s unpack one of the most debated features of 2025 — the experimental if() function that landed in Chrome. We'll see how it works, where it shines, where it fails, and what it might become."><meta property="og:type" content="website"><meta property="og:site_name" content="HTML Academy"><meta name="twitter:url" property="og:url" content="https://htmlacademy.org/blog/css-if"><meta name="twitter:title" property="og:title" content="CSS if() — breakthrough or breakdown?"><meta name="twitter:description" property="og:description" content="Let’s unpack one of the most debated features of 2025 — the experimental if() function that landed in Chrome. We'll see how it works, where it shines, where it fails, and what it might become."><meta name="theme-color" content="#2f358f"></head><body><header class="page-header"><div class="page-header__inner"><div class="page-header__top"><a class="page-header__logo" href="/"><img src="https://assets.htmlacademy.org/img/logo.v2.svg" width="104" height="36" alt="HTML Academy"></a><nav class="main-menu" aria-label="Main navigation" itemscope itemtype="http://schema.org/SiteNavigationElement"><ul class="main-menu__list main-menu__list--main main-menu__list--adaptive"><li class="main-menu__item main-menu__item--logo"><a class="main-menu__link" href="/" title="HTML Academy main page"><img src="https://assets.htmlacademy.org/img/logo.v2.svg" width="104" height="36" alt="HTML Academy"></a></li><li class="main-menu__item"><a class="main-menu__link" href="/courses" title="Courses"><span class="main-menu__icon"><svg aria-hidden="true"><use xlink:href="/img/sprites/general.svg#course"></use></svg></span>Courses</a></li><li class="main-menu__item"><a class="main-menu__link" href="/tutorials" title="Tutorials"><span class="main-menu__icon"><svg aria-hidden="true"><use xlink:href="/img/sprites/general.svg#intensive"></use></svg></span>Tutorials</a></li><li class="main-menu__item"><a class="main-menu__link" href="/blog" title="Blog"><span class="main-menu__icon"><svg aria-hidden="true"><use xlink:href="/img/sprites/general.svg#hat"></use></svg></span>Blog</a></li></ul><button class="main-menu__trigger" type="button" title="Main menu"><span></span></button><div class="main-menu__dropdown" id="main-menu"><div class="main-menu__dropdown-inner"><ul class="main-menu__list main-menu__list--main"><li class="main-menu__item" itemprop="name"><a class="main-menu__link" href="/courses" itemprop="url"><span class="main-menu__icon" aria-hidden="true"><svg aria-hidden="true"><use xlink:href="/img/sprites/general.svg#course"></use></svg></span>Courses</a></li><li class="main-menu__item" itemprop="name"><a class="main-menu__link" href="/tutorials" itemprop="url"><span class="main-menu__icon" aria-hidden="true"><svg aria-hidden="true"><use xlink:href="/img/sprites/general.svg#intensive"></use></svg></span>Tutorials</a></li><li class="main-menu__item" itemprop="name"><a class="main-menu__link" href="/blog" itemprop="url"><span class="main-menu__icon" aria-hidden="true"><svg aria-hidden="true"><use xlink:href="/img/sprites/general.svg#hat"></use></svg></span>Blog</a></li></ul><ul class="main-menu__list main-menu__list--user main-menu__list--user-guest"><li class="main-menu__item" itemprop="name"><a class="main-menu__link" href="/signup?redirect_url=%2Fblog%2Fcss-if" title="Sign up" data-modal="open" data-value="register" itemprop="url"><span class="main-menu__icon" aria-hidden="true"><svg aria-hidden="true"><use xlink:href="/img/sprites/general.svg#user"></use></svg></span>Sign up</a></li><li class="main-menu__item main-menu__item--login" itemprop="name"><a class="main-menu__link" href="/login?redirect_url=%2Fblog%2Fcss-if" title="Log in" data-modal="open" data-value="login" itemprop="url"><span class="main-menu__icon" aria-hidden="true"><svg aria-hidden="true"><use xlink:href="/img/sprites/general.svg#login"></use></svg></span>Log in</a></li></ul></div></div></nav></div></div></header><div class="page-content page-content--static"><div class="page-content__inner"><nav class="breadcrumbs" itemscope itemtype="http://schema.org/SiteNavigationElement"><ul class="breadcrumbs__list"><li class="breadcrumbs__item" itemprop="name"><a href="/" itemprop="url">Home</a></li><li class="breadcrumbs__item" itemprop="name"><a href="/blog" itemprop="url">Blog</a></li></ul></nav><section class="text-container breadcrumbs-offset"><header class="post-intro"><h1>CSS if() — breakthrough or breakdown?</h1><p class="meta"><time>Sep 25, 2025</time><span class="post-author">Alexander Pershin</span></p><p class="lead">By the summer of 2025, Chrome shipped an experimental CSS feature — <code>if()</code>. At first glance, it sounds revolutionary: finally, <em>conditions in CSS</em>! But is it as powerful as it sounds? Let’s go through it step by step.</p></header><article><h2>What does <code>if()</code> actually do?</h2><p>The <code>if()</code> function lets you assign property values based on conditions. It lives <em>right inside the value</em> — conceptually closer to a ternary operator than to a full-blown <code>if</code> statement in programming languages.</p><h2>First kind of condition — style queries</h2><p>If the custom property <code>--scheme</code> equals <code>dark</code>, the background becomes gray:</p><pre><code>body {
--scheme: dark;
background: if(
<mark>style(--scheme: dark): gray;</mark>
);
}</code></pre><p>If the value is different, the function resolves to <em>Guaranteed-invalid value</em> (effectively the same as <code>initial</code>).</p><pre><code>body {
<mark>--scheme: color;</mark>
background: if(
style(--scheme: dark): gray;
);
}</code></pre><p>The regular cascade just skips a broken declaration and keeps the previous value. <code>if()</code>, on the other hand, resets the property entirely — as if you’d explicitly written <code>initial</code>.</p><p>You can add another condition to handle a new value:</p><pre><code>body {
--scheme: color;
background: if(
style(--scheme: dark): gray;
<mark>style(--scheme: color): lightblue;</mark>
);
}</code></pre><p>And if nothing matches — there’s always an <code>else</code> branch, just like in “real” programming languages:</p><pre><code>body {
--scheme: other;
background: if(
style(--scheme: dark): gray;
style(--scheme: color): lightblue;
<mark>else: tomato;</mark>
);
}</code></pre><h2>Second kind — media queries</h2><p>The function also works with media expressions:</p><pre><code>h1 {
font-size: if(
<mark>media(width > 700px)</mark>: 72px;
else: 42px;
);
}</code></pre><p>If the viewport is wider than 700 px — you get a big, bold heading. Otherwise, it stays smaller.</p><h2>Third kind — feature queries</h2><p><code>if()</code> also supports <em>feature queries</em>. For example, you can set a red text color if the <code>element()</code> function isn’t supported:</p><pre><code>h1 {
color: if(
<mark>not supports(element("#myid"))</mark>: red;
else: white;
);
}</code></pre><blockquote>
If you only need to tweak a <strong>single</strong> value — <code>if()</code> looks neat and concise.
</blockquote><p>But let’s be honest — everything we’ve seen so far could be done before, just differently.</p><h2>Do we really need it?</h2><p>The same checks can be done using plain directives: <code>@container</code>, <code>@media</code>, and <code>@supports</code>. The behavior is identical:</p><pre><code>:root {
--scheme: other;
}
body {
background: tomato;
}
@container style(--scheme: dark) {
body { background: gray; }
}
@container style(--scheme: color) {
body { background: lightblue; }
}
@media (width > 700px) {
h1 { font-size: 72px; }
}
@supports not (element("#myid")) {
h1 { color: red; }
}
@supports (width: calc(1px * sibling-count())) {
h1 { background-color: white; }
}</code></pre><p>In short: <code>if()</code> doesn’t introduce new logic. It’s pure syntactic sugar that brings existing query mechanisms down to the value level.</p><p>At first, <code>if()</code>-based code looks more compact. But that’s true only when you’re changing a single property — which, frankly, is pretty rare.</p><h2>Not quite what we imagined</h2><p>When you hear about a “real <code>if</code> in CSS”, you imagine comparing variables and triggering different sets of properties right inside a CSS rule:</p><pre><code>.compare-numbers {
--a: 5;
--b: 10;
if (var(--a) > var(--b)) {
width: 100px;
height: 200px;
} else {
width: 250px;
height: 150px;
}
}</code></pre><p>The reality turned out much simpler: <code>if()</code> works <strong>only inside a single property value</strong> — no comparison operators, no multiple variables, no logic blocks.</p><p>Basically, you can only check whether a variable equals a specific value. That’s it:</p><pre><code>.selector {
--a: 5;
width: if(style(--a: 5): 100px;);
}</code></pre><p>In JavaScript, that would look roughly like this:</p><pre><code>let a = 5;
let width = (a === 5) ? "100px" : "";</code></pre><blockquote>
“Imagine if JavaScript had <em>only</em> this kind of powerful conditional logic!”
</blockquote><h2>A glimmer of hope: self queries</h2><p>But not everything is disappointing.</p><p>Here’s the bright side: <code>if()</code> can check not only parent variables (as container style queries do) but also variables defined on the <em>element itself</em>.</p><p>For example:</p><pre><code>h1 {
font-size: if(
<mark>style(--size: small)</mark>: 32px;
else: 72px;
);
}</code></pre><p>When <code>--size</code> isn’t defined, the <code>else</code> branch triggers (72 px). Add the variable directly to the element — and the condition fires:</p><pre><code>h1 {
<mark>--size: small;</mark>
font-size: if(
style(--size: small): 32px;
else: 72px;
);
}</code></pre><p>This may look minor, but it’s important:
traditional directives like <code>@container</code> only observe parents,
while <code>if()</code> can look at <strong>itself</strong>.</p><h2>Looking ahead</h2><p>How could <code>if()</code> evolve?</p><ul><li>Add comparison operators: <code><</code>, <code>></code>, <code><=</code>, <code>>=</code>.</li><li>Support multiple variable comparisons.</li><li>Work on the rule level, not just property values.</li></ul><p>Extra operators and variable comparisons are probably next on the roadmap.
But lifting <code>if()</code> to the rule level? That’s going to be hard.</p><h2>Verdict: breakthrough or breakdown?</h2><p>If <code>if()</code> stays exactly as it is now, it’s a bit of a failure.
Put it on your linter’s blacklist and move on — because in its current form, it lets you write the same messy logic as in preprocessors, only natively.</p><p>Still, there’s hope. If this experiment keeps evolving, it might become something bigger.
The current release isn’t a failure or a triumph — more like a “pre-patch before the major update.”</p></article></section></div></div><footer class="page-footer page-footer--tiny"><div class="page-footer__inner"><p><a href="/docs/cookies">Cookies</a> ∙
<a href="/docs/privacy">Privacy</a> ∙
<a href="/docs/agreement">License Agreement</a> ∙
<a href="/docs/about">About</a> ∙
<a href="/contacts">Contacts</a> ∙
© HTML Academy OÜ, 2019−2026
</p><div class="page-footer__financial"><img src="https://assets.htmlacademy.org/img/visa-white.svg?cs=96e54ec8c587db9d4b1d8d328ffd87c2ebfd9555" alt="VISA" title="VISA" width="35" height="35"><img src="https://assets.htmlacademy.org/img/mastercard-horizontal.v2.svg" alt="Mastercard" title="Mastercard" width="35" height="35"></div></div></footer><div class="modal"><div class="modal__inner"><div class="modal__wrapper js-login hidden"><button class="modal__close icon-close" type="button" title="Close" data-modal="close"></button><h4 class="modal__header">Log in</h4><ul class="modal__social"><li class="modal__social-link modal__social-link--fb"><a href="/login/fb?redirect_url=%2Fblog%2Fcss-if" rel="nofollow" title="Log in via Facebook"><svg aria-hidden="true"><use xlink:href="/img/sprites/general.svg#facebook"></use></svg></a></li><li class="modal__social-link modal__social-link--google"><a href="/login/google?redirect_url=%2Fblog%2Fcss-if" rel="nofollow" title="Log in via Google"><svg height="30" width="30" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path fill="#ffffff" d="M457.732 216.625c2.628 14.041 4.063 28.743 4.063 44.098C461.796 380.688 381.481 466 260.204 466c-116.023 0-210-93.977-210-210s93.977-210 210-210c56.704 0 104.077 20.867 140.44 54.73l-59.204 59.197v-.135c-22.046-21.002-50-31.762-81.236-31.762-69.297 0-125.604 58.537-125.604 127.841 0 69.29 56.306 127.968 125.604 127.968 62.87 0 105.653-35.965 114.46-85.312h-114.46v-81.902h197.528z"/></svg></a></li></ul><div class="modal__or"><span>or</span></div><form class="modal__form form" action="/login?redirect_url=%2Fblog%2Fcss-if" autocomplete="off" method="post" data-submit="o"><input type="hidden" name="csrf_name" value="csrf69aed50ac24f6"><input type="hidden" name="csrf_value" value="f2636b3ae18f00329566752f946c1e92"><div class="form__group"><label class="sr-only" for="login-email">Email</label><input class="field field--text field--full-width" type="email" name="email" placeholder="Email" value="" id="login-email"></div><div class="form__group"><label class="sr-only" for="login-password">Password</label><input class="field field--text field--full-width ym-disable-keys" type="password" name="password" placeholder="Password" id="login-password"></div><input class="button button--full-width" type="submit" data-submit-text="Logging in…" value="Log in"></form><p class="modal__forgot-password"><a href="/recover" data-modal="open" data-value="recover">Forgot your password?</a></p><a class="modal__bottom-link" href="/signup" data-modal="open" data-value="register">Sign up</a></div><div class="modal__wrapper js-register hidden"><button class="modal__close icon-close" type="button" title="Close" data-modal="close"></button><h4 class="modal__header">Sign up</h4><ul class="modal__social"><li class="modal__social-link modal__social-link--fb"><a href="/login/fb?redirect_url=%2Fblog%2Fcss-if" rel="nofollow" title="Log in via Facebook"><svg aria-hidden="true"><use xlink:href="/img/sprites/general.svg#facebook"></use></svg></a></li><li class="modal__social-link modal__social-link--google"><a href="/login/google?redirect_url=%2Fblog%2Fcss-if" rel="nofollow" title="Log in via Google"><svg height="30" width="30" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path fill="#ffffff" d="M457.732 216.625c2.628 14.041 4.063 28.743 4.063 44.098C461.796 380.688 381.481 466 260.204 466c-116.023 0-210-93.977-210-210s93.977-210 210-210c56.704 0 104.077 20.867 140.44 54.73l-59.204 59.197v-.135c-22.046-21.002-50-31.762-81.236-31.762-69.297 0-125.604 58.537-125.604 127.841 0 69.29 56.306 127.968 125.604 127.968 62.87 0 105.653-35.965 114.46-85.312h-114.46v-81.902h197.528z"/></svg></a></li></ul><div class="modal__or"><span>or</span></div><form class="modal__form form" action="/signup?redirect_url=%2Fblog%2Fcss-if" autocomplete="off" method="post"><input type="hidden" name="csrf_name" value="csrf69aed50ac24f6"><input type="hidden" name="csrf_value" value="f2636b3ae18f00329566752f946c1e92"><div class="form__group"><label class="sr-only" for="email">
Email
<span class="required"><span class="sr-only">Required field</span><span class="required__star">*</span></span></label><div class="form__group-fields"><input class="field field--text field--full-width" type="email" name="email" value="" id="email" required placeholder="Email"></div></div><div class="form__group"><label class="sr-only" for="password">
Password
<span class="required"><span class="sr-only">Required field</span><span class="required__star">*</span></span></label><div class="form__group-fields"><input class="field field--text field--full-width" type="password" name="password" value="" id="password" required placeholder="Password"></div></div><div class="form__group"><label class="checkbox"><input class="checkbox__input" type="checkbox" name="agreement" value="1" required><span class="checkbox__text"><span>By signing up, you agree to our <a href="/docs/agreement" target="_blank">License Agreement</a> and <a href="/docs/privacy" target="_blank">Privacy Policy</a>.</span></span></label></div><input class="button button--full-width" type="submit" data-submit-text="Signing up…" value="Sign up"></form><a class="modal__bottom-link" href="/login?redirect_url=%2Fblog%2Fcss-if" data-modal="open" data-value="login">Log in</a></div><div class="modal__wrapper modal__wrapper--no-btn-bottom js-recover hidden"><button class="modal__close icon-close" type="button" title="Close" data-modal="close"></button><h4 class="modal__header">Restore access</h4><p class="modal__text-accent">Have you forgotten your password or lost access to your profile? Enter your email connected to your profile and we will send you a link to restore access.</p><form class="modal__form form" action="/recover" autocomplete="off" method="post" data-submit="o"><input type="hidden" name="csrf_name" value="csrf69aed50ac24f6"><input type="hidden" name="csrf_value" value="f2636b3ae18f00329566752f946c1e92"><div class="form__group"><label class="sr-only" for="recovery-email">Email</label><input class="field field--text field--full-width" type="email" name="email" placeholder="Email" value="" id="recovery-email"></div><script src='https://www.google.com/recaptcha/api.js'></script><div class="form__group"><div class="g-recaptcha" data-sitekey="6LetCTEqAAAAANROWtPzfC7Rfg9iIRiRt2k2FPn7"></div></div><input class="button button--full-width" type="submit" data-submit-text="Sending…" value="Send"></form><p class="modal__text">Forgot to connect your email to the profile? Email us and we’ll help.</p></div></div></div><div class="banner-bottom" id="cookies_disclaimer_container"><div class="banner-bottom__inner"><p>We are using cookies to gather information which will help you use our website most effectively. You can read about this <a href="/docs/cookies">here</a> or disable this feature if you want. By continuing to browse the site, you agree to our use of cookies.</p><button class="button button--green" type="button" id="cookies_disclaimer_button">Agree</button></div></div><script type="text/javascript">
(function (n) {
var c = document.getElementById('cookies_disclaimer_container');
var b = document.getElementById('cookies_disclaimer_button');
b.onclick = function() {
c.remove();
var d = new Date();
d.setTime(d.getTime() + 60 * 60* 24 * 365 * 1000);
document.cookie = n + "=1; path=/; expires=" + d.toUTCString();
};
})('hidden_cookies_disclaimer');
</script><script async src="https://assets.htmlacademy.org/js/general.v274.js" data-assets="https://assets.htmlacademy.org" data-require="modal,form,nav"></script></body></html>