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


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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


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 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.


  - for (var x = 0; x < 12; x++)



As viewport widths can be flawed by a scrollbar on certain operating systems, we'll replace the use of `vw` with a variable: var(--vw);

The function below helps you to use it:

  = calc(50 * var(--vw))
  = vw(50)


@function vw($value) {
  @return calc(#{$value} * var(--vw));

:root {
  // Grid proportions
  --grid-width: 960;
  --grid-column-width: 60;
  --grid-columns: 12;

  // Grid logic
  --grid-gutters: calc(var(--grid-columns) - 1);

  // Grid proportion logic
  --column-proportion: calc(var(--grid-column-width) / var(--grid-width));
  --gutter-proportion: calc((1 - (var(--grid-columns) * var(--column-proportion))) / var(--grid-gutters));

  // Container Units
  --column-unit: calc(var(--column-proportion) * var(--container-width));
  --gutter-unit: calc(var(--gutter-proportion) * var(--container-width));
  --column-and-gutter-unit: calc(var(--column-unit) + var(--gutter-unit));
  // Scrollbar Fix
  --scrollbar-width: 0px;
  --viewport-width: calc(100vw - var(--scrollbar-width));
  --vw: calc(var(--viewport-width) / 100);

  // Container Width
  --container-width: #{vw(100)};

.o-grid {
  width: var(--container-width);
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), 1fr); 
  grid-column-gap: var(--gutter-unit);
  margin: auto;
  > * {
    height: 200vh;
    background: #6f2a80;

// Presentation

body {
  background: #602087;




window.addEventListener('load', () => {

  function getScrollbarWidth() {
      var outer = document.createElement('div'); = 'hidden'; = '100px';

      var widthNoScroll = outer.offsetWidth;

      // Force scrollbars = 'scroll';

      // Add innerdiv
      var inner = document.createElement('div'); = '100%';

      var widthWithScroll = inner.offsetWidth;

      // Remove divs

      return widthNoScroll - widthWithScroll;

  function setScrollbarVar(value) {'--scrollbar-width', value + 'px');

  function addScrollObserver() {

      var config = {
          threshold: 1.0

      var handleIntersect = (entries, observer) => {
          entries.forEach(entry => {
              if (entry.intersectionRatio < 1) {
              } else {

      var bodyScrollObserver = new IntersectionObserver(handleIntersect, config);