⊗mkLsBsCSED 31 of 42 menu

Extending with Compound Selector in SASS

The use of the @extend directive is not limited to class selectors. In principle, any selector can be extended, even single elements. Let's look at an example:

Let's look at an example:

.active-link { @extend a:active; } a:active { color: blue; }

As a result of compilation we will see that .active-link inherits the color property from a:active:

a:active, .active-link { color: blue; }

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

button { @extend .box:hover; } .box:hover { color: #14147e; }

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

button:active { @extend input:focus; } button:blur { @extend input:blur; } input:focus { color: #14147e; border-color: #b5b5d1; } input:blur { color: #040433; background-color: #87878f; }
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