HomeNewsGenerate colour themes with ease thanks to this SCSS mixin

Generate colour themes with ease thanks to this SCSS mixin



medium bookmark / Raindrop.io | In a recent web app project, I wanted to generate a bunch of colour themes quickly. The basic UI remains the same, and the navbars or buttons get a key colour. Depending on the key colour, the text should be either black or white to be legible. I have come across this problem many times in my career. Before there were CSS preprocessors, I would find & replace colour values. Since SCSS, I can at least create variables like $button-text and $button-background. However, changing variables