⊗mkLsBsExDU 30 of 42 menu

How Inheritance Works in SASS

The gist of the @extend directive is that it adds an extending selector to any stylesheet where the extending selector appears (in our example, .warning):

Let's look at an example:

.warning { border: 1px solid; background-color: #ffd900; } .warning .instruction { background-image: url("/image/warning.png"); } .personalWarning { @extend .warning; border-width: 3px; }

Now let's look at the compilation result:

.warning, .personalWarning { border: 1px solid; background-color: #ffd900; } .warning .instruction, .personalWarning .instruction { background-image: url("/image/warning.png"); } .personalWarning { border-width: 3px; }

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

#product-card p{ color: #460707; padding: 10px; } #product-card-title { @extend #product-card; font-weight: 600px; }

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

.link .main-block{ font-size: 14px; text-decoration: dashed; } .active-link { @extend .link; color: red; }

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

.link .main-block{ font-weight: bold; text-decoration: none; } .active { color: red; } .active-link { @extend .link; @extend .active; }
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