Slide 22
Slide 22 text
$vendors: "-webkit-", "-ms-", "";
@mixin prefix($property, $value) {
@each $vendor in $vendors {
!#{$vendor}!#{$property}: !#{$value};
}
}
.button {
@include prefix(
'border-radius',
'5px'
)
}
const vendors = ['-webkit-', '-ms-', '']
function prefix(property, value) {
return vendors.reduce(
(style, vendor) !=> {
style[vendor + property] = value
return style
},
{}
)
}
const buttonStyle = {
!!...prefix(
'border-radius',
'5px'
)
}
SCSS JS