Sass comparable() Function
You are Here:
Sass comparable() Function
The comparable()
function returns a Boolean value indicates whether number1 and number2 have compatible units.
Example
SASS TO CSS CONVERTER
//Check your console
@debug comparable(2px, 1px); // true
@debug comparable(100px, 3em); // false
@debug comparable(10cm, 3mm); // true
Syntax
comparable($x, $y)
Parameter Value
Value | Type | Explanation |
---|---|---|
$x | Required | A number (with or without unit) |
$y | Required | A number (with or without unit) |
Return Value
Value | Explanation |
---|---|
boolean | Returns whether $x and $y have compatible units. |
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.