Sass Equality Operators
What is Equality Operators?
The equality operators return a Boolean indicates whether or not two values are the same.
SASS Equality Operators
|==||Equal to||1px == 1px||true|
|!=||Not equal to||1px != 1em||true|
Equality Operators for Numbers
Numbers are equal if they have the same value and the same units, or if their values are equal when their units are converted between one another.
Equality Operators for Strings
Strings are unusual in that unquoted and quoted strings with the same contents are considered equal.
Equality Operators for Colors
Colors are equal if they have the same red, green, blue, and alpha values.
Equality Operators for Lists
Lists are equal if their contents are equal.
Note: Sass has following rules in checking equality between list
- Comma-separated lists aren’t equal to space-separated lists.
- Bracketed lists aren’t equal to unbracketed lists.
Equality Operators for Maps
Maps are equal if their keys and values are both equal.
Equality Operators for true, false, and null
true, false, and null are only equal to themselves.
Equality Operators for Functions
Functions are equal to the same function. Functions are compared by reference, so even if two functions have the same name and definition they’re considered different if they aren’t defined in the same place.
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
This channel is primarily useful for Full Stack Web Developer.