* { margin: 0; padding: 0; box-sizing: border-box; }
body { display: flex; justify-content: center; align-items: center; min-height: 100vh; background-color: #ffffff; overflow: hidden; }
.container { width: 400px; height: 400px; display: grid; grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr 1fr 1fr; gap: 10px; background-color: #f2f2f2; border-radius: 20px; transition: 0.5s; }
@for $i from 0 through 8 { .item:nth-child(#{$i + 1}) { background: hsl($i * 30%, 90%, 60%); } .container:has(.item:nth-child(#{$i + 1}):hover) { $r: floor($i/3 + 1); $c: $i%3 + 1; $arr: 1fr 1fr 1fr; $rows: set-nth($arr, $r, 2fr); $cols: set-nth($arr, $c, 2fr); grid-template-columns: $cols; grid-template-rows: $rows; } }
|