SASS හි @extend හි දාම දිගු කිරීම්
@extend අණපත අනුක්රමික දිගු කිරීම් ද සහාය දක්වයි,
එනම්, එක් තෝරන්නෙකුට වෙනත් තෝරන්නෙකු දිගු කළ හැකි අතර,
එය අනෙක් තෝරන්නෙකු විසින් දිගු කරනු ලැබේ.
උදාහරණයක් ලෙස:
උදාහරණයක් සලකා බලමු:
.warning {
border: 1px solid;
background-color: #ffd900;
}
.personalWarning {
@extend .warning;
border-width: 3px;
}
.systemWarning {
@extend .personalWarning;
position: center;
}
සංකලනයේ ප්රතිඵලයෙන් අපට පෙනෙන පරිදි,
.systemWarning පන්තිය සහිත සියලුම අංගවලට
.warning සහ .personalWarning පන්තිවල
විලාසයන් ද ඇත:
.warning, .personalWarning, .systemWarning {
border: 1px solid;
background-color: #ffd900;
}
.personalWarning, .systemWarning {
border-width: 3px;
}
.systemWarning {
position: center;
}
පහත කේතයේ සංකලන ප්රතිඵලය කුමක්දැයි පැහැදිලි කරන්න:
div {
font-size: 10px;
color: #181402;
}
.main-block {
@extend div;
border: 2px solid orange;
}
#warning-text {
@extend .main-block;
margin-top: 10px;
}
පහත කේතයේ සංකලන ප්රතිඵලය කුමක්දැයි පැහැදිලි කරන්න:
p {
padding: 10px;
}
.main-text {
font-weight: 800px;
}
.card {
@extend p;
color: #021338;
}
.product-card {
@extend .card, .main-text;
font-size: 12px;
}
පහත කේතයේ සංකලන ප්රතිඵලය කුමක්දැයි පැහැදිලි කරන්න:
p {
padding: 5px;
}
.main-text {
@extend p;
font-size: 14px;
}
.card {
@extend .main-text;
border: 1px solid black;
}
.product-card {
@extend .card;
background-color: #e1f1f1;
}