Beginning css preprocessors



Download 2,42 Mb.
Pdf ko'rish
bet41/59
Sana01.01.2022
Hajmi2,42 Mb.
#285229
1   ...   37   38   39   40   41   42   43   44   ...   59
Bog'liq
Beginning CSS Preprocessors

Listing 3-22.  Example Demonstrating Extending Multiple Classes

.notification{

        Border-radius:50%;

}

.strongText{



        Font-weight:bold;

}

.error{



        @extend .notification;

        @extend .strongText;

        Color:#F00;

}



Chapter 3 

 advanCed SaSS



44

This code will give the output shown in Listing 

3-23

.

Listing 3-23.  Output of Listing 



3-22

.notification, .error {

  Border-radius: 50%;

}

 



.strongText, .error {

  Font-weight: bold;

}

 

.error {



  Color: #F00;

}

It is also possible to chain the selectors while extending; that is, extending one selector that already 



extends another selector. Here is the modified code of Listing 

3-24


 to demonstrate this phenomenon.

Listing 3-24.  Example Demonstrating Chaining extends

.notification{

        Border-radius:50%;

}

.strongText{



  @extend .notification;

        Font-weight:bold;

}

.error{


        @extend .strongText;

        Color:#F00;

}

The output of this code will be same as shown in Listing 



3-23

.

There might be situations where you want @extend to be ignored if the extended selector has as error or 



is not present. You can use the !optional flag in that case. This will prevent @extend from producing results. 

This is demonstrated in Listing 

3-25

.


Download 2,42 Mb.

Do'stlaringiz bilan baham:
1   ...   37   38   39   40   41   42   43   44   ...   59




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish