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.


  var articles = [{
    "title": "Sweet roll gingerbread sweet roll jelly",
    "category": "Cakes",
    "date": "1 Jan 2020"
    "title": "Bar cupcake chocolate topping brownie",
    "category": "Chocolates",
    "date": "2 Feb 2020"
    "title": "Powder tootsie roll chocolate sugar",
    "category": "Puddings",
    "date": "3 Mar 2020"

  - var i = 1;
  each article in articles
    li.articles__article(style="--animation-order:" + i)
          h2.articles__title !{article.title}

          h2.articles__title !{article.title}
    - i++;


                :root {
  --base-grid: 8px;
  --colour-body-background: #d84c6e;
  --colour-background: #fff;
  --colour-background-folded: #f5f5f5;
  --colour-background-stripes: rgba(255,255,255,.5);
  --colour-text: #1a1a1a;

*, :after, :before {
  box-sizing: border-box;
  margin: 0;

body {
  background: var(--colour-body-background);
  font-family: Bitter;
  padding: calc(var(--base-grid)*10);

.articles {
  margin: calc(var(--base-grid)*2) auto calc(var(--base-grid)*5);
  display: grid;
  grid-row-gap: calc(var(--base-grid)*8);
  grid-column-gap: calc(var(--base-grid)*6);
  grid-template-columns: repeat(auto-fit,minmax(calc(var(--base-grid)*35),1fr));
  justify-items: center;

.articles__article {
  cursor: pointer;
  display: block;
  position: relative;
  perspective: 1000px;
  animation-name: animateIn;
  animation-duration: .35s;
  animation-delay: calc(var(--animation-order)*100ms);
  animation-fill-mode: both;
  animation-timing-function: ease-in-out;

.articles__article:before {
  content: "";
  position: absolute;
  top: calc(var(--base-grid)*-2);
  left: calc(var(--base-grid)*-2);
  border: 2px dashed var(--colour-background);
  background-image: repeating-linear-gradient(-24deg,transparent,transparent 4px,var(--colour-background-stripes) 0, var(--colour-background-stripes) 5px);
  z-index: -1;

.articles__article:before {
  width: calc(var(--base-grid)*35);
  height: calc(var(--base-grid)*35);

.articles__link {
  background-color: var(--colour-body-background);
  border: 2px solid var(--colour-background);
  display: block;
  width: 100%;
  height: 100%;

.articles__link:after {
  content: "";
  position: absolute;
  top: 50%;
  right: calc(var(--base-grid)*3);
  width: calc(var(--base-grid)*2);
  height: calc(var(--base-grid)*2);
  margin-top: calc(var(--base-grid)*-1);
  clip-path: polygon(75% 0,100% 50%,75% 100%,0 100%,25% 50%,0 0);
  -webkit-clip-path: polygon(75% 0,100% 50%,75% 100%,0 100%,25% 50%,0 0);
  background-color: var(--colour-background);
  opacity: 0;
  transition: opacity .5s ease-in,transform .3s ease-in-out 0ms;

.articles__content {
  background-color: var(--colour-background);
  color: var(--colour-text);
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  padding: calc(var(--base-grid)*2);
  display: flex;
  flex-direction: column;
  border: 2px solid var(--colour-background);

.articles__content--lhs {
  clip-path: polygon(0 0,51% 0,51% 100%,0 100%);
  -webkit-clip-path: polygon(0 0,51% 0,51% 100%,0 100%);

.articles__content--rhs {
  clip-path: polygon(50% 0,100% 0,100% 100%,50% 100%);
  -webkit-clip-path: polygon(50% 0,100% 0,100% 100%,50% 100%);
  transition: transform .5s ease-in-out,background-color .4s ease-in-out;

.articles__title {
  font-size: calc(var(--base-grid)*4);
  line-height: 1.125;
  font-weight: 700;
  letter-spacing: -.02em;

.articles__footer {
  margin-top: auto;
  font-size: calc(var(--base-grid)*2);
  line-height: calc(var(--base-grid)*2);
  display: flex;
  justify-content: space-between;

.articles__link:hover .articles__content--rhs {
  background-color: var(--colour-background-folded);
  transform: rotateY(-50deg);

.articles__link:hover:after {
  opacity: 1;
  transform: translateX(calc(var(--base-grid)*1.5));
  transition: opacity .5s ease-in,transform .3s ease-in-out .25s;