Read more

Sass: Use black or white foreground color depending on the lightness of the background

Henning Koch
March 07, 2012Software engineer at makandra GmbH

This article shows how to create a Sass mixin for a colored button. The button's foreground color is dynamically chosen between either black or white, depending on the given background color.

Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

It's a nice intro into @if and @else conditionals in Sass.

Posted by Henning Koch to makandra dev (2012-03-07 22:24)