cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              
// ======= Color Name/Variable Generator ======= //



// Change this color :)

//			||
//			||
//			||
//			||
//			||
//		|||||||
//		 |||||
//		  |||
//		   |

$base:#89fc34;




// ------- Maps ------- //

// Hue
$hue: (
  red: 0deg,
  orange: 20deg,
  yellow: 40deg,
  greenyellow: 60deg,
  green: 80deg,
  teal: 150deg,
  blue: 180deg,
  purple: 260deg,
  pink: 290deg
);

// Lightness
$lightness: (
  Black:0%,
  VeryDark: 20%,
  Dark: 40%,
  null: 41%,
	Light: 60%,
  VeryLight: 80%
);

// Saturation 
$saturation: (
  Flat: 0%,
	Dull: 30%,
  null: 31%,
  //Bright: 100%  // Not sure what to do with this yet
);




// ------- Color Identification ------- //

$hue-output: hue($base);
$saturation-output: saturation($base);
$lightness-output: lightness($base);

// Find the Hue
@each $value, $degrees in $hue {
  @if $hue-output >= $degrees {$hueColor: #{$value} !global;}

  // Find the Lightness
  @each $value, $range in $lightness {
    @if $lightness-output >= $range {$lightenColor: #{$hueColor}#{$value} !global;}

    // Find the Saturation 
    @each $value, $range in $saturation {
      @if $saturation-output >= $range {$colorName: #{$lightenColor}#{$value} !global;}
    }
  }
}

// This makes a new variable called $colorName (ex: pinkLight)





// Putting it all together
body {
  width:100%;
  height:90vh;
  padding-top:10vh;
  background-color:$base;
  background: linear-gradient(top, lighten($base, 5%), darken($base, 20%));
  font-family:'Open Sans', sans-serif;
  text-align:center;

  &:after {
    content:'#{$colorName} \A #{$base}'; // $colorName is our new variable, $base is extra
    
    color:$base;
    white-space:pre;
    font-size:2em;
    font-weight:600;
    display:inline-block;
    margin:0 auto;
    padding:0.7em 2em;
    background:lighten($base, 38%);
    border:8px solid darken($base, 38%);
    box-shadow: inset 0 0 0 4px #cdcdcd, 1px 1px 10px 0 darken($base, 20%); 
  }
  
  &:before {
    content:'I can show you the colors';
    font-size:2.2em;
    font-weight:800;
    color:darken($base, 40%);
    text-shadow:1px 1px 0 lighten($base, 30%);
    text-transform:uppercase;
    margin-bottom:2em;
    display:block;
  }
}

            
          
!
999px
Loading ..................

Console