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

              
                <div class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2">
  <div class="grid grid-cols-2 justify-items-center">
    <div>
      <div class="button--alt">Button Alt.</div>
    </div>
    <div>
      <div class="button--outline">
        <div class="button">Button Out.</div>
      </div>
    </div>
  </div>
  <div class="paragraph--outline">
    <div class="paragraph">
      <h1 class="text-xl">Overflow Example</h1>
      Notice how the scrollbar and text contents don't clip outside this scrollable div.
      <h2 class="text-lg mt-4 mb-1">Lorem ipsum</h2>
      Consectetur adipiscing elit. Pellentesque finibus tempus mauris. Proin ac quam sapien. Cras maximus massa malesuada, pellentesque magna at, aliquam ligula. Sed luctus tincidunt lorem nec varius. Vivamus fringilla ligula quis nulla efficitur egestas. Fusce vestibulum risus nec maximus porta. Sed malesuada egestas sem, id vehicula sem facilisis vitae. Maecenas efficitur nunc risus, non imperdiet felis fringilla id.
      <br /><br />
      Sed hendrerit velit erat, a iaculis mauris placerat non. Phasellus vehicula elit justo, non sodales turpis egestas at. Aliquam et turpis auctor, tempus libero vitae, condimentum justo. Vivamus malesuada magna leo, sed dapibus velit blandit eget. Vestibulum luctus sapien pretium est congue pharetra. Sed non odio vitae urna condimentum scelerisque. In fringilla ante a ante efficitur consequat.
      <br /><br />
      Pellentesque mollis dolor quis neque rhoncus fermentum. Interdum et malesuada fames ac ante ipsum primis in faucibus. Mauris aliquet eget mi sit amet lobortis. Aenean viverra scelerisque arcu vitae porttitor. In hac habitasse platea dictumst. Fusce at facilisis ipsum. Morbi turpis magna, congue tincidunt metus at, ultrices blandit est. Ut fringilla diam lectus, ut ullamcorper lacus finibus id.
    </div>
  </div>
</div>
              
            
!

CSS

              
                :root {
  color-scheme: dark;
}

// Janky approach to responsiveness since I can't change
// Tailwinds' break points on CodePen.
@media only screen and (min-width: 420px) {
  .grid {
    min-width: 28em;
  }
}

@media only screen and (max-width: 420px) {
  .grid-cols-2 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

  .absolute {
    position: initial;
    transform: translate(0, 0);
  }
}

html,
body {
  height: 100%;
  background-color: black;
}

// https://css-tricks.com/notched-boxes/

/* 
 * @param $size   Bevel size.
 * @param $alt    Use alternate corners.
 */
@mixin bevel--opp($size: 12px, $alt: false) {
  @if $alt {
    clip-path: polygon(
      0% $size,
      $size 0%,
      100% 0%,
      100% 100%,
      100% calc(100% - #{$size}),
      calc(100% - #{$size}) 100%,
      100% 100%,
      0% 100%
    );
  } @else {
    clip-path: polygon(
      0% 0%,
      0% 0%,
      calc(100% - #{$size}) 0%,
      100% $size,
      100% 100%,
      100% 100%,
      $size 100%,
      0 calc(100% - #{$size})
    );
  }
}

/* 
 * @param $size   Bevel size.
 */
@mixin bevel--full($size: 12px) {
  clip-path: polygon(
    0% $size,
    $size 0%,
    calc(100% - #{$size}) 0%,
    100% $size,
    100% calc(100% - #{$size}),
    calc(100% - #{$size}) 100%,
    $size 100%,
    0 calc(100% - #{$size})
  );
}

.button {
  cursor: pointer;
  white-space: nowrap;

  color: white;
  background-color: #0070f3;
  transition: background-color 200ms;

  display: inline-block;
  text-align: center;
  width: 12em;

  padding: 1em;
  margin: 1em;

  &:hover {
    background-color: #3291ff;
  }

  @include bevel--opp();

  &--alt {
    @extend .button;
    @include bevel--opp($alt: true);
  }

  &--outline {
    @extend .button;
    background-color: #374151;
    padding: 0;

    .button {
      background-color: black;
      color: #9ca3af;

      // Offset for bottom and right borders.
      margin: 1px;
      width: calc(100% - 2px);
      padding: calc(1em - 1px) 1em;
    }
  }
}

.paragraph {
  color: #9ca3af;
  background-color: black;
  overflow-y: scroll;
  @include bevel--full($size: 1.5em);

  &--outline {
    @extend .paragraph;
    background-color: #374151;

    height: 300px;
    margin: 1em;
    overflow: hidden;

    .paragraph {
      position: relative;
      padding: 1em;

      width: calc(100% - 2px);
      height: calc(100% - 2px);
      top: 1px;
      left: 1px;
    }
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console