I managed to write FizzBuzz in pure CSS as kind of personal Hello World to learn how to write stylesheets. I'd like to do the same with Sass, but I'm not sure how I could make use of Sass syntax or semantics to improve on this.
Currently, I've got a .html file and .scss file that together render FizzBuzz, but the .scss file is still pure CSS code. How could I make it more concise or expressive by using Sass extensions?
Example:
body { counter-reset: i; }
div { counter-increment: i; }
div:after { content: "" counter(i); }
div:nth-child(3n) { visibility: hidden; }
div:nth-child(3n):after { visibility: visible; content: "Fizz"; }
div:nth-child(5n) { visibility: hidden; }
div:nth-child(5n):after { visibility: visible; content: "Buzz"; }
div:nth-child(15n) { visibility: hidden; }
div:nth-child(15n):after { visibility: visible; content: "FizzBuzz"; }
Source: