⊗mkLsBsVr 12 of 42 menu

Variables in SASS

The SASS language allows you to use variables. A variable is a container in which you can store some data and use it in the right places in the code.

To create a variable, you need to come up with a name for it and put the $ sign before it. Then, after the variable name, put a colon and specify the value of this variable. Let's make a variable named var as an example:

$var: 20px;

Let's now use this variable as a property value:

p { font-size: $var; }

As a result, after compilation into CSS, our variable will be substituted with its value:

p { font-size: 20px; }

Tell me what the result of compiling the following code will be:

$color: #000; p { color: $color; }
English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline