Oct 25, 2025
We’re standing at the edge of a new, curious world — a world where you can define display logic right inside CSS. What used to require JavaScript yesterday now works natively, at the level of CSS itself.
Why it matters
Modern interfaces are becoming increasingly reactive. A weather card might change its background depending on temperature. A chart could highlight segments based on live data. A form component might visually warn you when a limit is exceeded.
And all of this is logic we usually push to JavaScript:
if (temp < 10) {
element.classList.add('cold');
} else if (temp < 25) {
element.classList.add('mild');
} else {
element.classList.add('warm');
}
But if you think about it — this is just a condition that affects visual appearance. So why not let CSS itself handle it?
Imagine a component that receives variables like --temp, --limit, or --progress, and decides how to look — all on its own, without a single line of JS.
Can CSS variables be compared? Yes, they can!
Surprisingly — yes. And not just compared statically, but dynamically, in response to user interaction. Here’s a small example.
Important: right now it works only in Chrome.
In this snippet, the block reacts to two CSS variables, --x and --y. When you hover over it, the values change — and so does its appearance.
.comparison {
--x: 100px;
--y: 120px;
}
.comparison:hover {
--x: 140px;
--y: 120px;
}
On hover, the background updates instantly — with no JavaScript involved. This isn’t a trick. It’s real value comparison happening directly in CSS.
A full walkthrough of the technique is available in the step-by-step interactive demo — make sure to check it out after reading the article.
Why a special trick is needed
So, why don’t developers use CSS comparisons everywhere? It’s not even about browser support — it’s about the limitations of the core technology.
The key player here is container style queries. They let you write things like:
@container style(--theme: dark) {
...
}
But here’s the catch — these queries can only check for exact matches. They can tell if a variable equals a certain value, but that’s it. No >, <, or expressions like --temp > --max-temp — not yet.
So if you want true comparisons, you need a little creativity.
How the trick works: three possible outcomes
If you look closer, the limitation isn’t fatal. Style queries can only check equality, but a numerical comparison always has just three possible results:
- less than,
- equal,
- greater than.
Can we map all possible outcomes to just these three? Absolutely!
The key operation is ridiculously simple — subtraction. If you subtract one value from another, the result will always be:
- negative — if the first value is smaller,
- zero — if they’re equal,
- positive — if the first value is larger.
We don’t really care about the exact number — only its sign. That sign tells us which side is bigger.
And this is exactly what the new sign() function does. It returns -1, 0, or 1.
So we end up with a neat, universal expression:
--sign: sign(var(--x) - var(--y));
Now the variable --sign holds everything CSS needs to know about the comparison:
- -1 if --x is less than --y,
- 0 if they’re equal,
- 1 if --x is greater than --y.
Three outcomes — three states. That’s all we need to build conditional logic right in CSS.
From here on, we can use this value anywhere — inside an if() function or an @container query.
Step-by-step implementation
Step 1. Define the variables
.comparison:nth-child(1) { --x: 100px; --y: 120px; }
.comparison:nth-child(2) { --x: 100px; --y: 100px; }
.comparison:nth-child(3) { --x: 200px; --y: 100px; }
Step 2. Register the variable --sign
Registration ensures the browser treats --sign as a number and evaluates it right away.
@property --sign {
inherits: true;
initial-value: 0;
syntax: "";
}
Step 3. Compute the sign
.comparison {
--sign: sign(var(--x) - var(--y));
}
Step 4. React to the result
Using the new if() function:
.comparison {
--sign: sign(var(--x) - var(--y));
background-color: if(
style(--sign: -1): coral;
style(--sign: 1): lightgreen;
else: lightgray;
);
}
Or via container queries:
@container style(--sign: -1) {
.comparison-result { background-color: coral; }
}
@container style(--sign: 0) {
.comparison-result { background-color: lightgray; }
}
@container style(--sign: 1) {
.comparison-result { background-color: lightgreen; }
}
With container queries, the comparison is computed on the parent, and the styles are applied to a nested element.
Either way, pure CSS decides what styles to apply based on variable values.
Wrapping up
The tiny expression sign(var(--x) - var(--y)) turns the impossible into possible.
We’ve got a universal way to encode a comparison result into a single variable — and then use it anywhere: inside @container or if().
CSS is no longer a passive styling language. It can now make decisions based on its own variables and conditional logic, dynamically adjusting the appearance of elements.
And while this currently works only in Chrome, the Pandora’s box is already open — CSS has started to think.
<!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>Comparing CSS Variables in Pure CSS — Blog — HTML Academy</title><meta name="description" content="CSS just got smarter. You can now compare variables and apply styles conditionally — no JavaScript required. A tiny trick with sign() changes everything."><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="Comparing CSS Variables in Pure CSS"><meta name="twitter:description" property="og:description" content="CSS just got smarter. You can now compare variables and apply styles conditionally — no JavaScript required. A tiny trick with sign() changes everything."><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-variable-comparison" 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-variable-comparison" 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>Comparing CSS Variables in Pure CSS</h1><p class="meta"><time>Oct 25, 2025</time><span class="post-author">Alexander Pershin</span></p><p class="lead">We’re standing at the edge of a new, curious world — a world where you can define display logic <em>right inside CSS</em>. What used to require JavaScript yesterday now works natively, at the level of CSS itself.</p></header><article><h2>Why it matters</h2><p>Modern interfaces are becoming increasingly reactive. A weather card might change its background depending on temperature. A chart could highlight segments based on live data. A form component might visually warn you when a limit is exceeded.</p><p>And all of this is logic we usually push to JavaScript:</p><pre><code>if (temp < 10) {
element.classList.add('cold');
} else if (temp < 25) {
element.classList.add('mild');
} else {
element.classList.add('warm');
}</code></pre><p>But if you think about it — this is just a condition that affects <strong>visual appearance</strong>. So why not let CSS itself handle it?</p><p>Imagine a component that receives variables like <code>--temp</code>, <code>--limit</code>, or <code>--progress</code>, and decides how to look — all on its own, without a single line of JS.</p><h2>Can CSS variables be compared? Yes, they can!</h2><p>Surprisingly — <strong>yes</strong>. And not just compared statically, but <em>dynamically</em>, in response to user interaction. Here’s a small example.</p><p><strong>Important:</strong> right now it works only in Chrome.</p><style>
.example {
margin: 40px 0;
padding: 80px 0;
font-family: "TT Norms Pro", sans-serif;
color: black;
background-color: #f8f8f8;
background-image: radial-gradient(circle at bottom center, rgb(87, 232, 245),rgb(42, 114, 213));
}
.comparison {
position: relative;
width: 80%;
padding: 30px 0;
margin: 0 auto;
border-radius: 3px;
text-align: center;
font-size: 24px;
box-shadow: 10px 30px 50px 0 rgba(0, 0, 0, 0.2);
}
@property --sign {
inherits: true;
initial-value: 0;
syntax: "<number>";
}
.comparison {
--sign: sign(var(--x) - var(--y));
background-color: if(
style(--sign: -1): coral;
style(--sign: 1): lightgreen;
else: lightgray;
);
}
.comparison::after {
content: if(
style(--sign: -1): "--x < --y";
style(--sign: 1): "--x > --y";
else: "--x = --y";
);
}
.comparison {
--x: 100px;
--y: 120px;
}
.comparison:hover {
--x: 140px;
--y: 120px;
}
</style><div class="example"><div class="comparison">
Hover me in Chrome<br></div></div><p>In this snippet, the block reacts to two CSS variables, <code>--x</code> and <code>--y</code>. When you hover over it, the values change — and so does its appearance.</p><pre><code>.comparison {
--x: 100px;
--y: 120px;
}
.comparison:hover {
--x: 140px;
--y: 120px;
}</code></pre><p>On hover, the background updates instantly — with no JavaScript involved. This isn’t a trick. It’s <strong>real value comparison</strong> happening directly in CSS.</p><p>A full walkthrough of the technique is available in the step-by-step <a href="/tutorials/23" target="_blank">interactive demo</a> — make sure to check it out after reading the article.</p><h2>Why a special trick is needed</h2><p>So, why don’t developers use CSS comparisons everywhere? It’s not even about browser support — it’s about the limitations of the core technology.</p><p>The key player here is <strong>container style queries</strong>. They let you write things like:</p><pre><code>@container style(--theme: dark) {
...
}</code></pre><p>But here’s the catch — these queries can only check <strong>for exact matches</strong>. They can tell if a variable equals a certain value, but that’s it. No <code>></code>, <code><</code>, or expressions like <code>--temp > --max-temp</code> — not yet.</p><p>So if you want <em>true comparisons</em>, you need a little creativity.</p><h2>How the trick works: three possible outcomes</h2><p>If you look closer, the limitation isn’t fatal. Style queries can only check equality, but a numerical comparison always has just <strong>three possible results</strong>:</p><ol><li>less than,</li><li>equal,</li><li>greater than.</li></ol><p>Can we map all possible outcomes to just these three? Absolutely!</p><p>The key operation is ridiculously simple — <strong>subtraction</strong>. If you subtract one value from another, the result will always be:</p><ul><li>negative — if the first value is smaller,</li><li>zero — if they’re equal,</li><li>positive — if the first value is larger.</li></ul><p>We don’t really care about the exact number — only its <strong>sign</strong>. That sign tells us which side is bigger.</p><p>And this is exactly what the new <code>sign()</code> function does. It returns <code>-1</code>, <code>0</code>, or <code>1</code>.</p><p>So we end up with a neat, universal expression:</p><pre><code>--sign: sign(var(--x) - var(--y));</code></pre><p>Now the variable <code>--sign</code> holds everything CSS needs to know about the comparison:</p><ul><li><code>-1</code> if <code>--x</code> is less than <code>--y</code>,</li><li><code>0</code> if they’re equal,</li><li><code>1</code> if <code>--x</code> is greater than <code>--y</code>.</li></ul><p>Three outcomes — three states. That’s all we need to build conditional logic right in CSS.</p><p>From here on, we can use this value anywhere — inside an <code>if()</code> function or an <code>@container</code> query.</p><h2>Step-by-step implementation</h2><h3>Step 1. Define the variables</h3><pre><code>.comparison:nth-child(1) { --x: 100px; --y: 120px; }
.comparison:nth-child(2) { --x: 100px; --y: 100px; }
.comparison:nth-child(3) { --x: 200px; --y: 100px; }</code></pre><h3>Step 2. Register the variable <code>--sign</code></h3><p>Registration ensures the browser treats <code>--sign</code> as a number and evaluates it right away.</p><pre><code>@property --sign {
inherits: true;
initial-value: 0;
syntax: "<number>";
}</code></pre><h3>Step 3. Compute the sign</h3><pre><code>.comparison {
--sign: sign(var(--x) - var(--y));
}</code></pre><h3>Step 4. React to the result</h3><p>Using the new <code>if()</code> function:</p><pre><code>.comparison {
--sign: sign(var(--x) - var(--y));
background-color: if(
style(--sign: -1): coral;
style(--sign: 1): lightgreen;
else: lightgray;
);
}</code></pre><p>Or via container queries:</p><pre><code>@container style(--sign: -1) {
.comparison-result { background-color: coral; }
}
@container style(--sign: 0) {
.comparison-result { background-color: lightgray; }
}
@container style(--sign: 1) {
.comparison-result { background-color: lightgreen; }
}</code></pre><p>With container queries, the comparison is computed on the parent, and the styles are applied to a nested element.</p><p>Either way, <strong>pure CSS</strong> decides what styles to apply based on variable values.</p><h2>Wrapping up</h2><p>The tiny expression <code>sign(var(--x) - var(--y))</code> turns the impossible into possible.</p><p>We’ve got a universal way to encode a comparison result into a single variable — and then use it anywhere: inside <code>@container</code> or <code>if()</code>.</p><p>CSS is no longer a passive styling language. It can now <em>make decisions</em> based on its own variables and conditional logic, dynamically adjusting the appearance of elements.</p><p>And while this currently works only in Chrome, the Pandora’s box is already open — CSS has started to think.</p></div></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-variable-comparison" 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-variable-comparison" 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-variable-comparison" autocomplete="off" method="post" data-submit="o"><input type="hidden" name="csrf_name" value="csrf69aed450e5f99"><input type="hidden" name="csrf_value" value="c238240484b7887a38f35af82bdd87cc"><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-variable-comparison" 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-variable-comparison" 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-variable-comparison" autocomplete="off" method="post"><input type="hidden" name="csrf_name" value="csrf69aed450e5f99"><input type="hidden" name="csrf_value" value="c238240484b7887a38f35af82bdd87cc"><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-variable-comparison" 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="csrf69aed450e5f99"><input type="hidden" name="csrf_value" value="c238240484b7887a38f35af82bdd87cc"><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>