I'm creating a dynamic grid system using sass and gulp-sass to compile.
I have this code:
$col-margin: 15px
.row
width: 100%
max-width: 1170px
margin: 0 auto
display: flex
flex-wrap: wrap
// cols
=col($cols)
width: calc(((100% * $cols) /12) - ($col-margin * 2))
margin: $col-margin
box-sizing: border-box
In other words, the margin is 15px. When compiling the terminal, using gulp-sass I get this error:
[20:22:31] Starting 'sass'...
[20:22:31] Starting 'watch'...
[20:22:31] Finished 'watch' after 31 ms
Error in plugin 'sass'
Message:
assets\gs.sass
Error: Incompatible units: 'px' and '%'.
on line 10 of assets/gs.sass
>> width: ((100% * $cols) /12) - ($col-margin * 2);
-----------^
[20:22:31] Finished 'sass' after 95 ms
[20:22:31] Starting 'default'...
[20:22:31] Finished 'default' after 20 μs