Beginning css preprocessors



Download 2,42 Mb.
Pdf ko'rish
bet47/59
Sana01.01.2022
Hajmi2,42 Mb.
#285229
1   ...   43   44   45   46   47   48   49   50   ...   59
Bog'liq
Beginning CSS Preprocessors

Listing 3-37.  Passing Arguments in Mixins

@mixin fancyBorder($fbColor, $fbWidth) {

  border-color: $fbColor;

  border-width: $fbWidth;

  border-style: dashed;

}

 



.specialNote{

  @include fancyBorder(#000,2px)

}

This example includes the mixin named fancyBorder, which takes two arguments: borderColor and 



borderWidth. The output of this is shown in Listing 

3-38


.

Listing 3-38.  Output of Listing 

3-37


.specialNote {

  border-color: #000;

  border-width: 2px;

  border-style: dashed;

}

Mixins can also assume default values for their arguments. Thus, when you don’t pass any value to the 



mixin, it will assume the default values. This can be demonstrated by modifying the code in Listing 

3-39


.

Listing 3-39.  Example Demonstrating Default Variables

@mixin fancyBorder($fbColor:#000, $fbWidth:2px) {

  Border-color: $fbColor;

  Border-width: $fbWidth;

  Border-style: dashed;

}

 



.specialNote{

  @include fancyBorder;

}

Mixins also allow you to pass keyword arguments. This makes mixins even more flexible by allowing 



arguments to be passed in any order. This is shown in Listing 

3-40


.


Download 2,42 Mb.

Do'stlaringiz bilan baham:
1   ...   43   44   45   46   47   48   49   50   ...   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