7
AlgoRythm
18h

My secret addiction: defining all colors/ properties in CSS3 variables so that I can easily make my website theme-compatible, and then never making any themes for it.

Hey, at least it keeps my colors consistent....

Comments
  • 2
    Isn’t that best practice anyway?
  • 1
    @Lensflare Using raw CSS? Of course, especially since IE finally died.

    In general? Probably not. Preprocessors like SASS are still largely more capable. However, I don't fuck with that stuff for personal projects. Too much hassle.

    Edit: example, you still can't use CSS3 variables in queries, but you can use SASS variables in queries. This means if you want breakpoints in raw CSS, you'll need to hard-code pixel values.
  • 1
    I do this cuz then I can copy paste the CSS and just change the main colors for similar websites 🤷
  • 2
    @Lensflare oh, and of course, it's never best practice to do something for a specific reason and then not actually reap the rewards of doing it that way
Add Comment