monkinetic the blog

Posts tagged with '3' (10 posts)

Randomized color choices in SASS

For a bit of variety, I decided to figure out how to generate a new front page header background and link colors whenever I rebuilt the blog (new posts, etc). This is still a static site, so no wizzy javascript stuff, I just wanted to do it in SASS.

This is what I came up with.

    $colors-list: (
      // background color, link color
      #DAE076 #AD5C55,
      #A9C9C5 #4A676D,
      #AD5C55 #5E7D68,
      #374768 #718A8A,
    );
    $color-index: random(length($colors-list));
    
    // Header description box
    $colors: nth($colors-list, $color-index);
    $header-desc-background-color: nth($colors, 1);
    // Link color
    $link-color: nth($colors, 2);

I may rework this as a map (dictionary) later on so I can add other theme-y things, but it was kinda fun to work out for now.

#374768 #718a8a #dae076 #a9c9c5 #themes #programming #ad5c55 #4a676d #5e7d68 #sass #css

Steve Ivy

Finally watched the last season if Warehouse 13. Man that’s how you end a show. #warehouse13

~ # 05:37 ~

Steve Ivy

RT @t: #PDF2013 men are from earth women are from earth we should all be treated with respect & dignity — @marthadear #pdf13 (ttk.me t4QP3)

~ # 19:34 ~

Steve Ivy

Just saw twin teen sisters riding a tandem bike, the trailing one texting with both hands while the other steered. #2013

~ # 00:26 ~

Steve Ivy

Greetings from sunny Phoenix. #37degreesout http://t.co/WdV3DjQu

~ # 05:46 ~

Steve Ivy

@ccgus A3 looks amazing! Congrats! #acorn3

~ # 19:43 ~

Résumé: R Steven Ivy

#fff #999 #333