123

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <section class="grid default-grid text-center">
  <div class="container">
    <h1>Extended Bootstrap Grid</h1>
    
    <p class="lead">More examples of the default grid can be found at <a href="https://getbootstrap.com/css/#grid" target="_blank">Bootstrap</a>.</p> 
    
    <p>Just add the custom classes and you are good to go!</p>
  </div>
</section>

<section class="grid default-grid">
  <div class="container">
    <h1>Sample <small>30px</small></h1>
    
    <div class="row sample-row">
      <div class="col-xs-6 col-sm-4 gutter-margin-xs-md"><div class="inner">col-xs-6 col-sm-4</div></div>
      <div class="col-xs-6 col-sm-8 gutter-margin-xs-md"><div class="inner">col-xs-6 col-sm-8</div></div>
    </div>
    
  </div>
</section>

<section class="grid default-grid">
  <div class="container">
    <h1>Sample <small>18px</small></h1>

    <div class="row row-xs-sm sample-row">
      <div class="col-xs-6 col-sm-4 gutter-xs-sm gutter-margin-xs-md"><div class="inner">col-xs-6 col-sm-4 <span class="label label-danger">gutter-xs-sm</label></div></div>
      <div class="col-xs-6 col-sm-8 gutter-xs-sm gutter-margin-xs-md"><div class="inner">col-xs-6 col-sm-8 <span class="label label-danger">gutter-xs-sm</span></div></div>
    </div>
    
  </div>
</section>

<section class="grid default-grid">
  <div class="container">
    <h1>Sample <small>6px</small></h1>

    <div class="row row-xs-xs sample-row">
      <div class="col-xs-6 col-sm-4 gutter-xs-xs gutter-margin-xs-md"><div class="inner">col-xs-6 col-sm-4 <span class="label label-danger">gutter-xs-xs</span></div></div>
      <div class="col-xs-6 col-sm-8 gutter-xs-xs gutter-margin-xs-md"><div class="inner">col-xs-6 col-sm-8 <span class="label label-danger">gutter-xs-xs</span></div></div>
    </div>
    
  </div>
</section>

<section class="grid default-grid">
  <div class="container">
    <h1>Sample <small>website</small></h1>

    <div class="row gutter-margin-xs-sm gutter-margin-sm-md">
      <div class="col-xs-12">
        <div class="row row-xs-xs row-sm-sm row-md-md sample-row">

          <div class="col-xs-10 gutter-xs-xs col-sm-4 gutter-sm-sm gutter-md-md gutter-margin-xs-sm text-center">
            <div class="inner logo">Logo</div>
          </div>

          <div class="col-xs-2 gutter-xs-xs visible-xs gutter-sm-sm gutter-md-md gutter-margin-xs-sm text-center">
            <a href="#" class="btn btn-info btn-square btn-sm">Menu</a>
          </div>

          <div class="col-xs-12 gutter-xs-xs col-sm-4 col-sm-push-4 gutter-sm-sm gutter-md-md gutter-margin-xs-sm text-center">
            <div class="inner">Search</div>
          </div>

          <nav class="hidden-xs col-sm-8 gutter-xs-xs gutter-sm-sm gutter-md-md gutter-margin-sm-md">
            <div class="inner">Nav</div>
          </nav>
        </div>

        <div class="row sample-row">
          <div class="col-xs-12 col-sm-6 col-md-3 gutter-margin-xs-sm gutter-margin-sm-md">
            <div class="inner">Content 1</div>
          </div>

          <div class="col-xs-12 col-sm-6 col-md-3 gutter-margin-xs-sm gutter-margin-sm-md">
            <div class="inner">Content 2</div>
          </div>

          <div class="col-xs-12 col-sm-6 col-md-3 gutter-margin-xs-sm gutter-margin-sm-md">
            <div class="inner">Content 3</div>
          </div>

          <div class="col-xs-12 col-sm-6 col-md-3 gutter-margin-xs-sm gutter-margin-sm-md">
            <div class="inner">Content 4</div>
          </div>
        </div>

        <div class="row row-xs-sm sample-row">
          <div class="col-xs-12 col-sm-8 col-md-push-4 gutter-xs-sm gutter-margin-xs-sm gutter-margin-sm-md gutter-margin-lg-lg">
            <div class="inner">Left</div>
          </div>

          <div class="col-xs-12 col-sm-4 col-md-pull-8 gutter-xs-sm gutter-margin-xs-sm gutter-margin-sm-md gutter-margin-lg-lg">
            <div class="inner">Right</div>
          </div>

          <div class="col-xs-12 col-sm-4 col-md-push-8 gutter-xs-sm gutter-margin-xs-sm gutter-margin-sm-md gutter-margin-lg-lg">
            <div class="inner">Right</div>
          </div>

          <div class="col-xs-12 col-sm-8 col-md-pull-4 gutter-xs-sm gutter-margin-xs-sm gutter-margin-sm-md gutter-margin-lg-lg">
            <div class="inner">Left</div>
          </div>
        </div>

        <div class="row row-xs-xs sample-row">
          <div class="col-xs-6 col-sm-3 col-md-2 gutter-xs-xs gutter-margin-xs-xs">
            <div class="inner">Photo 1</div>
          </div>

          <div class="col-xs-6 col-sm-3 col-md-2 gutter-xs-xs gutter-margin-xs-xs">
            <div class="inner">Photo 2</div>
          </div>

          <div class="col-xs-6 col-sm-3 col-md-2 gutter-xs-xs gutter-margin-xs-xs">
            <div class="inner">Photo 3</div>
          </div>

          <div class="col-xs-6 col-sm-3 col-md-2 gutter-xs-xs gutter-margin-xs-xs">
            <div class="inner">Photo 4</div>
          </div>

          <div class="col-xs-6 col-sm-3 col-md-2 gutter-xs-xs gutter-margin-xs-xs">
            <div class="inner">Photo 5</div>
          </div>

          <div class="col-xs-6 col-sm-3 col-md-2 gutter-xs-xs gutter-margin-xs-xs">
            <div class="inner">Photo 6</div>
          </div>

          <div class="col-xs-6 col-sm-3 col-md-2 gutter-xs-xs gutter-margin-xs-xs">
            <div class="inner">Photo 7</div>
          </div>

          <div class="col-xs-6 col-sm-3 col-md-2 gutter-xs-xs gutter-margin-xs-xs">
            <div class="inner">Photo 8</div>
          </div>

          <div class="col-xs-6 col-sm-3 col-md-2 gutter-xs-xs gutter-margin-xs-xs">
            <div class="inner">Photo 9</div>
          </div>

          <div class="col-xs-6 col-sm-3 col-md-2 gutter-xs-xs gutter-margin-xs-xs">
            <div class="inner">Photo 10</div>
          </div>

          <div class="col-xs-6 col-sm-3 col-md-2 gutter-xs-xs gutter-margin-xs-xs">
            <div class="inner">Photo 11</div>
          </div>

          <div class="col-xs-6 col-sm-3 col-md-2 gutter-xs-xs gutter-margin-xs-xs">
            <div class="inner">Photo 12</div>
          </div>
        </div>

      </div>
    </div>
  </div>
</section>
            
          
!
            
              @import "compass/css3";

/*
* Default Bootstrap grid gutter is 30px, so I've added some custom gutters
* It is now possible to make the grid more flexible for each device
*/

// page colors
$sample-primary: #EF5858;
$sample-border: darken($sample-primary, 8%);

// breakpoints
$screen-sm: 768px;
$screen-md: 992px;
$screen-lg: 1340px;

// gutters & margins (try changing this)
$grid-gutter-width-xs: 6px;
$grid-gutter-width-sm: 18px;
$grid-gutter-width-md: 30px;
$grid-gutter-width-lg: 42px;

section.grid {
  padding: 30px 0  0;
  
  h1 {
    margin-bottom: 50px;
  }
  
  p {
    margin-bottom: 24px;
  }
}

div.sample-row {
  div.inner {
    background: $sample-primary;
    border: 1px solid $sample-border;
    color: white;
    padding: 15px;

    &.logo {
      padding: 50px 0;
      min-height:123px;
    }

    // nested
    div.inner {
      background: $sample-border;
      border: 1px solid darken($sample-border, 5%);
    }
  }

  @media (min-width: $screen-sm) {
    div.inner {
      background: invert($sample-primary);
      border: 1px solid invert($sample-border);

      div.inner {
        background: invert($sample-border);
        border: 1px solid darken(invert($sample-border), 5%);
      }
    }
  }

  @media (min-width: $screen-md) {
    div.inner {
      background: adjust-hue($sample-primary, 20%); 
      border: 1px solid adjust-hue($sample-border, 20%);

      div.inner {
        background: adjust-hue($sample-border, 20%);
        border: 1px solid darken(adjust-hue($sample-border, 20%), 5%); 
      }
    }
  }

  @media (min-width: $screen-lg) { 
    div.inner {
      background: shade($sample-primary, 30%); 
      border: 1px solid shade($sample-border, 30%);

      div.inner {
        background: shade($sample-border, 30%);
        border: 1px solid darken(shade($sample-border, 30%), 5%); 
      }
    }
  }
}


/*
* Where the custom grid begins
*/

// Define all the possible gutters with their sizes
$gutters: (xs, $grid-gutter-width-xs), (sm, $grid-gutter-width-sm), (md, $grid-gutter-width-md), (lg, $grid-gutter-width-lg);

// Loop through the gutters and set the gutters + margins
@each $label, $size in $gutters {
  .gutter-xs-#{$label} { padding-left: ($size / 2); padding-right: ($size / 2); }
  .gutter-margin-xs-#{$label} { margin-bottom: $size; }
  .gutter-margin-xs-#{$label}-up { margin-top: $size; }
  .row-xs-#{$label} { margin-left: -($size / 2); margin-right: -($size / 2); }
}

@media (min-width: $screen-sm) {
  @each $label, $size in $gutters {
    .gutter-sm-#{$label} { padding-left: ($size / 2); padding-right: ($size / 2); }
    .gutter-margin-sm-#{$label} { margin-bottom: $size; }
    .gutter-margin-sm-#{$label}-up { margin-top: $size; }
    .row-sm-#{$label} { margin-left: -($size / 2); margin-right: -($size / 2); }
  }
}

@media (min-width: $screen-md) {
  @each $label, $size in $gutters {
    .gutter-md-#{$label} { padding-left: ($size / 2); padding-right: ($size / 2); }
    .gutter-margin-md-#{$label} { margin-bottom: $size; }
    .gutter-margin-md-#{$label}-up { margin-top: $size; }
    .row-md-#{$label} { margin-left: -($size / 2); margin-right: -($size / 2); }
  }
}

@media (min-width: $screen-lg) { 
  @each $label, $size in $gutters {
    .gutter-lg-#{$label} { padding-left: ($size / 2); padding-right: ($size / 2); }
    .gutter-margin-lg-#{$label} { margin-bottom: $size; }
    .gutter-margin-lg-#{$label}-up { margin-top: $size; }
    .row-lg-#{$label} { margin-left: -($size / 2); margin-right: -($size / 2); }
  }
}



            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console