Sass Relational Operators

You are Here:

What is Relational Operators?

Relational operators returns a Boolean value indicates whether numbers are greater than, Less than, greater than or equal to, or less than or equal to one another.

Example

SASS TO CSS CONVERTER
//Check your console @debug 1px > 1in; // false @debug 20px < 24px; // true @debug 9ms >= 55ms; // false @debug 999ms <= 1s; // true

Sass Relational Operators

The following table provides a list of relational operators available in Sass.

OperatorExplanationOperationResult
>Greater than1px > 1infalse
<Less than20px < 24pxtrue
>=Greater than or equal to9ms >= 55msfalse
<=Less than or equal to999ms <= 1strue

Relational Operators using Incompatible Units

Numbers with incompatible units can’t be compared.

Example

SASS TO CSS CONVERTER
//Check your console @debug 1px > 1s; // Error

Reminder

Hi Developers, we almost covered 99.1% of Sass Tutorials with examples for quick and easy learning.

We are working to cover every Single Concept in Sass.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author