Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <!--
Associated Blog post found at: https://andromedagalactic.com/blog/when-your-sass-gets-sassy
Github repo: https://github.com/martine-dowden/getting-sassy
-->

<body>
  <main>
    <h1>How To Guide</h1>

    <h2>Step 1</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque at porttitor est. Sed interdum quis lacus sit amet convallis. Sed tristique varius leo, luctus accumsan ante rutrum non. Ut at arcu et quam pellentesque congue vel vitae sapien. Ut sit amet eleifend magna. Vestibulum eu odio ornare, faucibus lacus a, sollicitudin augue. Sed pulvinar, felis non varius maximus, metus nisi accumsan massa, non scelerisque ligula neque ut sem.</p>
    <p>Pellentesque rutrum elementum mauris vitae aliquam. Interdum et malesuada fames ac ante ipsum primis in faucibus. Curabitur venenatis vulputate sapien ut faucibus. Pellentesque bibendum nunc sed velit tristique, consectetur hendrerit erat semper. Nullam vitae sem nulla. Morbi et ipsum id augue cursus dignissim sed vitae ante. Etiam gravida dapibus sem, quis condimentum erat pulvinar sed. Curabitur at est vestibulum, euismod leo tristique, facilisis felis. Proin nec gravida turpis, in tristique felis.</p>
    <p class="info">Unattended children with get a cup of espresso and a free puppy.</p>

    <h2>Step 2</h2>
    <p>Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Proin lacinia sit amet ex nec posuere. Nam eros metus, vulputate vitae consectetur ut, vestibulum porttitor orci. Fusce condimentum ullamcorper lectus ut bibendum. Maecenas sagittis erat sed euismod tempus. Ut molestie diam vel quam tempus tincidunt. Morbi nec ipsum in urna porta varius at vitae massa.</p>
    <p class="warning">Do not use the wrong end of the chainsaw.</p>

    <h2>Step 3</h2>
    <p>Vestibulum quam neque, aliquam a varius at, gravida non quam. Quisque tempus hendrerit rutrum. Curabitur pellentesque orci est, porta vulputate lectus vestibulum ut. Aenean congue vel dui at luctus. Donec augue ex, facilisis id laoreet ut, faucibus bibendum risus. Sed iaculis, velit sagittis tristique hendrerit, turpis dolor varius ante, id suscipit ante tortor eu lorem. Sed sodales ligula et metus auctor, id fringilla est dictum. Donec vitae ex lobortis, euismod elit ac, ornare lorem.</p>
    <p class="danger">Do not press the big red button.</p>

  </main>
</body>
              
            
!

CSS

              
                //  Associated Blog post found at: https://andromedagalactic.com/blog/when-your-sass-gets-sassy
//  Github repo: https://github.com/martine-dowden/getting-sassy

@use 'sass:map';

$primary: #1a4d80;
$default: #111;
$border-color: #ddd;

$danger: red;
$warning: orange;
$info: #1a4d80;


* { box-sizing: border-box }

body {
  max-width: 75ch;
  margin: 4rem auto;
  padding: 1rem;
  color: $default;
  border-left: solid 1px $primary;
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}

h1, h2, h3 { color: $primary }

p { line-height: 1.5 }

$messages: (
  info: (icon: ℹ️, color: $info), 
  warning: (icon: ⚠️, color: $warning),
  danger: (icon: ☠️, color: $danger )
);

.panel {
  padding: 1rem;
  border: solid 1px;
  border-radius: 4px;
  &::before {
    text-transform: capitalize;
  }
}

@mixin createPanel($name, $type) {
  @debug $name $type;
  $_icon: map.get($type, icon);
  $_color: map.get($type, color);
  .#{$name} {
    @extend .panel;
    background: scale-color($_color, $lightness: +97%);
    border-color: $_color;
    &::before {
      content: "#{$_icon} #{$name}: ";
      @if $name == 'danger' {
        font-weight: bold;
      }
    }
  }
}

@each $key, $type in $messages {
  @include createPanel($key, $type)
}


              
            
!

JS

              
                
              
            
!
999px

Console