how to inheritance multiples class through sass -
i have scenario in sass .a{ background-color: red; padding :20px; h4{ padding-bottom :20px;} } // class .b{ background-color : blue; padding : 20px h4{ padding-bottom:20px} }
question: how can combine padding , h4 in sass without repeating padding , h4 properties
the straight forward way use @extend
.
%common_properties { padding: 20px; h4 { padding-bottom: 20px; } } .a { @extend %common_properties; background-color: red; } .b { @extend %common_properties; background-color: blue; }
Comments
Post a Comment