More Related Content
Similar to Front-end разработка. Compass
Similar to Front-end разработка. Compass (20)
Front-end разработка. Compass
- 6. Mixins (Примеси)
@mixin rounded_corners ($radius) {
#footer {
-moz-border-radius: $radius;
-moz-border-radius: 10px;
-webkit-border-radius: $radius;
-webkit-border-radius: 10px;
border-radius: $radius;
border-radius: 10px;
}
}
#footer {
@include rounded_corners(10px);
.block {
}
-moz-border-radius: 5px;
.block {
-webkit-border-radius: 5px;
@include rounded_corners(5px);
}
border-radius: 5px;
}
- 7. Арифметика и циклы
#header {
$the-border: 1px;
border-left: 1px;
border-right: 2px;
#header {
}
border-left: $the-border;
border-right: $the-border * 2;
}
@for $i from 0 through 200 {
.item-#{$i} { height: 10px * $i; }
}