Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                // list(css,number)
// usage:
// +list('corporate', 5)
mixin list(css, number)
  ul(class != css)
    - for (var n=1; n <=number; n++)
       li
 
 
       

.wrapper
  h1 Just a Pen with all dependencies
  h2 scss libs
  ul
    li 
      a(href="http://susy.readthedocs.io/") susy 2
    li 
      a(href="https://bourbon.netlify.com/docs/5.0.0/") bourbon 5
    li 
      a(href="https://include-media.com/documentation/") include-media
      
  h2 mixins
  ul
    li debug-map($map) - 
      i sass map debug mixin
    li dummy-image('800/450', sea) - 
      i Random covers from Unsplash
      
  h2 js libs
  ul
    li fixie.js - 
      i placehoder and lipsum generator
  
              
            
!

CSS

              
                @import "bourbon@5.*";
// Susy Doc : http://susydocs.oddbird.net/en/latest/
@import "susy";

//     _            _           _                           _ _
//    (_)          | |         | |                         | (_)
//     _ _ __   ___| |_   _  __| | ___   _ __ ___   ___  __| |_  __ _
//    | | '_ \ / __| | | | |/ _` |/ _ \ | '_ ` _ \ / _ \/ _` | |/ _` |
//    | | | | | (__| | |_| | (_| |  __/ | | | | | |  __/ (_| | | (_| |
//    |_|_| |_|\___|_|\__,_|\__,_|\___| |_| |_| |_|\___|\__,_|_|\__,_|
//
//      Simple, elegant and maintainable media queries in Sass
//                        v1.4.9
//
//                http://include-media.com
//
//         Authors: Eduardo Boucas (@eduardoboucas)
//                  Hugo Giraudel (@hugogiraudel)
//
//      This project is licensed under the terms of the MIT license

$breakpoints: (
  'phone': 320px,
  'tablet': 768px,
  'desktop': 1024px
) !default;


$media-expressions: (
  'screen': 'screen',
  'print': 'print',
  'handheld': 'handheld',
  'landscape': '(orientation: landscape)',
  'portrait': '(orientation: portrait)',
  'retina2x': '(-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi), (min-resolution: 2dppx)',
  'retina3x': '(-webkit-min-device-pixel-ratio: 3), (min-resolution: 350dpi), (min-resolution: 3dppx)'
) !default;

$unit-intervals: (
  'px': 1,
  'em': 0.01,
  'rem': 0.1,
  '': 0
) !default;


$im-media-support: true !default;


$im-no-media-breakpoint: 'desktop' !default;

@function im-log($message) {
  @if feature-exists('at-error') {
    @error $message;
  } @else {
    @warn $message;
    $_: noop();
  }

  @return $message;
}

@mixin log($message) {
  @if im-log($message) {}
}


///
/// Function with no `@return` called next to `@warn` in Sass 3.3
/// to trigger a compiling error and stop the process.
///
@function noop() {}


@function im-intercepts-static-breakpoint($conditions...) {
  $no-media-breakpoint-value: map-get($breakpoints, $im-no-media-breakpoint);

  @if not $no-media-breakpoint-value {
    @if im-log('`#{$im-no-media-breakpoint}` is not a valid breakpoint.') {}
  }

  @each $condition in $conditions {
    @if not map-has-key($media-expressions, $condition) {
      $operator: get-expression-operator($condition);
      $prefix: get-expression-prefix($operator);
      $value: get-expression-value($condition, $operator);

      @if ($prefix == 'max' and $value <= $no-media-breakpoint-value) or
          ($prefix == 'min' and $value > $no-media-breakpoint-value) {
        @return false;
      }
    } @else if not index($im-no-media-expressions, $condition) {
      @return false;
    }
  }

  @return true;
}


@function get-expression-operator($expression) {
  @each $operator in ('>=', '>', '<=', '<', '≥', '≤') {
    @if str-index($expression, $operator) {
      @return $operator;
    }
  }

  // It is not possible to include a mixin inside a function, so we have to
  // rely on the `im-log(..)` function rather than the `log(..)` mixin. Because
  // functions cannot be called anywhere in Sass, we need to hack the call in
  // a dummy variable, such as `$_`. If anybody ever raise a scoping issue with
  // Sass 3.3, change this line in `@if im-log(..) {}` instead.
  $_: im-log('No operator found in `#{$expression}`.');
}


@function get-expression-dimension($expression, $operator) {
  $operator-index: str-index($expression, $operator);
  $parsed-dimension: str-slice($expression, 0, $operator-index - 1);
  $dimension: 'width';

  @if str-length($parsed-dimension) > 0 {
    $dimension: $parsed-dimension;
  }

  @return $dimension;
}


@function get-expression-prefix($operator) {
  @return if(index(('<', '<=', '≤'), $operator), 'max', 'min');
}

@function get-expression-value($expression, $operator) {
  $operator-index: str-index($expression, $operator);
  $value: str-slice($expression, $operator-index + str-length($operator));

  @if map-has-key($breakpoints, $value) {
    $value: map-get($breakpoints, $value);
  } @else {
    $value: to-number($value);
  }

  $interval: map-get($unit-intervals, unit($value));

  @if not $interval {
    // It is not possible to include a mixin inside a function, so we have to
    // rely on the `im-log(..)` function rather than the `log(..)` mixin. Because
    // functions cannot be called anywhere in Sass, we need to hack the call in
    // a dummy variable, such as `$_`. If anybody ever raise a scoping issue with
    // Sass 3.3, change this line in `@if im-log(..) {}` instead.
    $_: im-log('Unknown unit `#{unit($value)}`.');
  }

  @if $operator == '>' {
    $value: $value + $interval;
  } @else if $operator == '<' {
    $value: $value - $interval;
  }

  @return $value;
}

@function parse-expression($expression) {
  // If it is part of $media-expressions, it has no operator
  // then there is no need to go any further, just return the value
  @if map-has-key($media-expressions, $expression) {
    @return map-get($media-expressions, $expression);
  }

  $operator: get-expression-operator($expression);
  $dimension: get-expression-dimension($expression, $operator);
  $prefix: get-expression-prefix($operator);
  $value: get-expression-value($expression, $operator);

  @return '(#{$prefix}-#{$dimension}: #{$value})';
}

@function slice($list, $start: 1, $end: length($list)) {
  @if length($list) < 1 or $start > $end {
    @return ();
  }

  $result: ();

  @for $i from $start through $end {
    $result: append($result, nth($list, $i));
  }

  @return $result;
}

@function to-number($value) {
  @if type-of($value) == 'number' {
    @return $value;
  } @else if type-of($value) != 'string' {
    $_: im-log('Value for `to-number` should be a number or a string.');
  }

  $first-character: str-slice($value, 1, 1);
  $result: 0;
  $digits: 0;
  $minus: ($first-character == '-');
  $numbers: ('0': 0, '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9);

  // Remove +/- sign if present at first character
  @if ($first-character == '+' or $first-character == '-') {
    $value: str-slice($value, 2);
  }

  @for $i from 1 through str-length($value) {
    $character: str-slice($value, $i, $i);

    @if not (index(map-keys($numbers), $character) or $character == '.') {
      @return to-length(if($minus, -$result, $result), str-slice($value, $i))
    }

    @if $character == '.' {
      $digits: 1;
    } @else if $digits == 0 {
      $result: $result * 10 + map-get($numbers, $character);
    } @else {
      $digits: $digits * 10;
      $result: $result + map-get($numbers, $character) / $digits;
    }
  }

  @return if($minus, -$result, $result);
}

@function to-length($value, $unit) {
  $units: ('px': 1px, 'cm': 1cm, 'mm': 1mm, '%': 1%, 'ch': 1ch, 'pc': 1pc, 'in': 1in, 'em': 1em, 'rem': 1rem, 'pt': 1pt, 'ex': 1ex, 'vw': 1vw, 'vh': 1vh, 'vmin': 1vmin, 'vmax': 1vmax);

  @if not index(map-keys($units), $unit) {
    $_: im-log('Invalid unit `#{$unit}`.');
  }

  @return $value * map-get($units, $unit);
}

@mixin media-context($tweakpoints: (), $tweak-media-expressions: ()) {
  // Save global configuration
  $global-breakpoints: $breakpoints;
  $global-media-expressions: $media-expressions;

  // Update global configuration
  $breakpoints: map-merge($breakpoints, $tweakpoints) !global;
  $media-expressions: map-merge($media-expressions, $tweak-media-expressions) !global;

  @content;

  // Restore global configuration
  $breakpoints: $global-breakpoints !global;
  $media-expressions: $global-media-expressions !global;
}

@mixin media($conditions...) {
  @if ($im-media-support and length($conditions) == 0) or
      (not $im-media-support and im-intercepts-static-breakpoint($conditions...)) {
    @content;
  } @else if ($im-media-support and length($conditions) > 0) {
    @media #{unquote(parse-expression(nth($conditions, 1)))} {
      // Recursive call
      @include media(slice($conditions, 2)...) {
        @content;
      }
    }
  }
}
// ./ Include-media




// ---------------------------------------------------------------
// SETTINGS
// ---------------------------------------------------------------
$global-box-sizing: border-box !default;
$max-width: 960px !default;
$base-font-size: 1em !default;
$base-font-family: $font-stack-helvetica;
$base-line-height: 1.5em; // With a unit to work with suzy
$base-spacing: $base-line-height !default;
$small-spacing: $base-spacing / 2 !default;
$base-border-radius: 4px !default;

// $susy: (
//     container: $max-width,
//   	container-position: center,
//     columns: 8,
//     gutters: .15,
//     math: fluid,
//     output: float,
//     gutter-position: after,
//     debug: (
//         image: show,
//         color: rgba(#5d6c7d, .25),
//         output: overlay,
//         toggle: bottom left,
//     ),
//     use-custom: (
//       background-image: false,
//       background-options: false,
//       box-sizing: false,
//       clearfix: false,
//       rem: true,
//     )
// ) !default;

$breakpoints: (
	'phone': 480px, 
	'tablet': 768px, 
	'desktop': 1024px
) !default;

// ---------------------------------------------------------------
// @function
// ---------------------------------------------------------------


// ---------------------------------------------------------------
// @mixins
// ---------------------------------------------------------------
@mixin debug-map($map) {
    @if(type-of($map) == 'map'){
		@at-root {
			@debug-map {
				__toString__: inspect($map);
				__length__: length($map);
				__depth__: depth($map);
				__keys__: map-keys($map);
				__properties__ {
					@each $key, $value in $map {
						#{'(' + type-of($value) + ') ' + $key}: inspect($value);
					}
				}
			}
		}
	}
	@else {
	  @at-root {
  		@debug-map {
  			__TYPE__: type-of($map);
  			__VALUE__: $map;
  		}
	  }
	}
}
// ---------------------------------------------------------------
// Base
// ---------------------------------------------------------------
html {
  box-sizing: $global-box-sizing;
  font-size: 100%;
}
body{
  font-size: modular-scale(1);
  font-family: $base-font-family;
  
  margin: 0;
  padding: 0;
}

// Set box-sizing globally to handle padding and border widths
*,
*::before,
*::after {
  box-sizing: inherit;
}

img {
  width: 100%;
  height: auto;
  //display: block;
}

p:first-of-type {
  margin-top:0;
}

// ---------------------------------------------------------------
// Utilities
// ---------------------------------------------------------------

.clearfix{
  @include clearfix();
}

// Set the base layout
$base-layout: layout($max-width 8 1/4 after fluid) !default;
.wrapper {
  @include container($base-layout);
}



// ---------------------------------------------------
// SETTINGS
// ---------------------------------------------------

$button-sizes: () !default;
$button-shapes: () !default;

$btn-settings :(
  $button-sizes,
  $button-shapes
) !default;

// -------------------------------------------------
// Buutons
// -------------------------------------------------
%btn-theme {
  //@include base-heading-styles;
  background-color: white;
  border: 1px solid silver;

  color: silver;

  &:hover,
  &:focus{
    background-color: black;
    border: 1px solid white;
  }
}


.btn{
    @extend %btn-theme;
    padding: 9px 35px;
    display:inline-block;
    
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
    white-space:nowrap;
    cursor: pointer;
    
    transition: background-color 1.2s;

    & > span {
        line-height: 1.8;
    }
}
.btn--inline {
    vertical-align: baseline;
    font-size: inherit;
    line-height: inherit;
    height: auto;
    padding: .1em .5em;
}

.btn--small {
  font-size: 1em;
  //line-height: 1.5;
  //height: 40px;
}

.btn--large {
  font-size: 2rem;
}

.btn--huge {
  font-size: 3rem;
}

.btn--full{
  width: 100%;
}

.btn--rounded{
    border-radius: 5rem;
}
/**
medium
xx-small
x-small|small
large
x-large
xx-large
smaller
larger

*/

#{$all-buttons}{
  
  &.btn{
    @extend .btn;
  }
}




// Txt Utils

.text-center {
    text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

/** # Dummy images

Random images from https://picsum.photos/, classified by tags

Usage:
```
  .dummy-background{
    @include dummy-image('800/450', sea);
  }
```

$dummy-img-provider-url {string} - image provider url  
$dummy-images {map} - list images id's by categories

@link - https://picsum.photos/

Styleguide tools.dummy.images
*/
$dummy-img-provider-url: 'https://picsum.photos/' !default;
$dummy-images : (
  cars: (1070,1071,1072,1013,45,111),
  peoples: (1027,1005,1001,996,978,974),
  nature: (89,1035,1036,1037,1039,1064,1044,1012,1011,1006,980,977),
  animals: (1074,1003,40),
  sea: (1041,1019,1002,994,990,989,970),
  food: (999,102),
  work: (20,7,3,48,60),
  architectural: (1031,985,983),
  city: (1067,1048,1033,985,972,43),
  sport: (1077,1011,)
);

@mixin dummy-image($size: 800, $theme: cars, $background-size: cover){
  $images: map-get($dummy-images,$theme);
  $image: nth($images, random(length($images)));
  $url: $dummy-img-provider-url + $size + '/?image=' + $image ;
  background-image: url('#{$url}');
  background-repeat: no-repeat;
  background-size: $background-size;
}


.img1 {
  background-image: url(https://unsplash.it/800?image=1070);
}
.img2{
  background-image: url(https://unsplash.it/800?image=1060);
}
.img3{
  background-image: url(https://unsplash.it/800?image=1059);
}
.img4{
  background-image: url(https://unsplash.it/800?image=1025);
}
.img5{
  background-image: url(https://unsplash.it/800?image=998);
}

.bg1{
  background:url(http://subtlepatterns2015.subtlepatterns.netdna-cdn.com/patterns/low_contrast_linen.png) repeat; 
}
              
            
!

JS

              
                // Fixie.js
var fixie=function(){function e(t){if(/^\s*$/.test(t.innerHTML))switch(t.nodeName.toLowerCase()){case"b":case"em":case"strong":case"button":case"th":case"td":case"title":case"tr":t.innerHTML=r();break;case"header":case"cite":case"caption":case"mark":case"q":case"s":case"u":case"small":case"span":case"code":case"pre":case"li":case"dt":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":t.innerHTML=c();break;case"footer":case"aside":case"summary":case"blockquote":case"p":t.innerHTML=l();break;case"article":case"section":t.innerHTML=i(3,7,l,"p");break;case"a":var s=t.getAttribute("href")||t.href;""!==s&&null!==s||(t.href="#"),t.innerHTML="www."+r()+a(r())+".com";break;case"img":var u=t.getAttribute("src")||t.src,f=t.getAttribute("fixie-temp-img");if(""===u||null===u||!0===f||"true"===f){var g=t.getAttribute("width")||t.width||(t.width=250),m=t.getAttribute("height")||t.height||(t.height=100),d=t.getAttribute("title")||"";t.src=h.replace("${w}",g).replace("${h}",m).replace("${text}",d),t.setAttribute("fixie-temp-img",!0)}break;case"ol":case"ul":t.innerHTML=i(4,8,c,"li");break;case"dl":t.innerHTML=function(){for(var e="",t=0,a=n(3,5);t<a;t++)e+=i(1,1,c,"dt")+i(1,1,c,"dd");return console.log(e),e}();break;case"hr":break;case"i":var b=t.getAttribute("class");if(/(icn+|icon+)/.test(b))break;default:t.innerHTML=o()}else{var p=t.children;if(p.length)for(var v=0;v<p.length;v++)e(p[v])}}function t(t){for(var a=0;a<t.length;a++)e(t[a])}function a(e){return e.charAt(0).toUpperCase()+e.slice(1)}function r(){return f[n(0,f.length-1)]}function n(e,t){return Math.round(Math.random()*(t-e)+e)}function s(e,t,r,s){s||(s=" ");for(var i=n(e,t),c=[],o=0;o<i;o++)c.push(r());return a(c.join(s))}function i(e,t,a,r){var n="<"+r+">",i="</"+r+">";return n+s(e,t,a,i+n)+i}function c(){return s(3,5,r)}function o(){return s(4,9,r)+"."}function l(){return s(3,7,o)}var u,h="https://placehold.it/${w}x${h}&text=${text}";"function"!=typeof document.getElementsByClassName&&(document.getElementsByClassName=function(e){for(var t=[],a=new RegExp("\\b"+e+"\\b"),r=this.getElementsByTagName("*"),n=0;n<r.length;n++){var s=r[n].className;a.test(s)&&t.push(r[n])}return t});var f=["I","8-bit","ethical","reprehenderit","delectus","non","latte","fixie","mollit","authentic","1982","moon","helvetica","dreamcatcher","esse","vinyl","nulla","Carles","bushwick","bronson","clothesline","fin","frado","jug","kale","organic","local","fresh","tassel","liberal","art","the","of","bennie","chowder","daisy","gluten","hog","capitalism","is","vegan","ut","farm-to-table","etsy","incididunt","sunt","twee","yr","before","gentrify","whatever","wes","Anderson","chillwave","dubstep","sriracha","voluptate","pour-over","esse","trust-fund","Pinterest","Instagram","DSLR","vintage","dumpster","totally","selvage","gluten-free","brooklyn","placeat","delectus","sint","magna","brony","pony","party","beer","shot","narwhal","salvia","letterpress","art","party","street-art","seitan","anime","wayfarers","non-ethical","viral","iphone","anim","polaroid","gastropub","city","classy","original","brew"];return t(document.getElementsByClassName("fixie")),{init:function(){u?function(e){if(!document.querySelectorAll)return!1;try{t(document.querySelectorAll(e))}catch(e){return!1}}(u):t(document.getElementsByClassName("fixie"))},setImagePlaceholder:function(e){return h=e,this},setSelector:function(e){return"object"==typeof e?u=e.join(","):e&&(u=e),this}}}();
// ./ Fixie


              
            
!
999px

Console