Using an opacity hack as described here. The box will be red if at least one of the inputs is set to 1.
Play with the input vals on line 21.
A Pen by Riley Shaw on CodePen.
.container | |
- for i in 1..16 | |
- for j in 1..256 | |
div class="l#{i}" | |
p.on ON | |
p OFF |
Using an opacity hack as described here. The box will be red if at least one of the inputs is set to 1.
Play with the input vals on line 21.
A Pen by Riley Shaw on CodePen.
@import "compass/css3" | |
// accepts n {0,1} args to determine l#{n}'s background | |
=bgs($bools...) | |
@for $a from 1 through length($bools) | |
@if nth($bools,$a) == 1 | |
.l#{$a} | |
background: red | |
.container | |
position: fixed | |
top: 50% | |
left: 50% | |
height: 120px | |
width: 120px | |
margin: -62px | |
border: 4px solid black | |
font: bold 32px/#{60px} sans-serif | |
text-align: center | |
color: red | |
// set input vals here | |
+bgs(0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0) | |
div | |
position: absolute | |
top: 0 | |
left: 0 | |
height: 100% | |
width: 100% | |
opacity: 0.004 | |
background: white | |
p | |
position: relative | |
.on | |
color: white |