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

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

HTML

              
                

<header class="header">
  <h1>Mute Swan</h1>
  <a class="logo" href="/">
    <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/85421/muteswan-icon.svg">
  </a>
  <button class="undo" type="button">
    <span class="vh">Undo</span>
    <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/85421/undo.svg">
  </button>
  <button class="redo" type="button" disabled>
    <span class="vh">Redo</span>
    <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/85421/redo.svg">
  </button>
</header>
<main>
  <div class="pond pond--future">

    <section class="nest">
      <h2 class="date" tabindex="0">
        <time class="date__time">
         <abbr class="date__day" title="Thursday">Thursday</abbr>
         <span class="date__num">20</span>
        </time>
      </h2>
    </section>
  
    <section class="nest">
      <h2 class="date" tabindex="0">
        <time class="date__time">
         <abbr class="date__day" title="Wednesday">Wednesday</abbr>
         <span class="date__num">19</span>
        </time>
      </h2>
    </section>
  
    <section class="nest">
      <h2 class="date" tabindex="0">
        <time class="date__time">
         <abbr class="date__day" title="Tuesday">Tuesday</abbr>
         <span class="date__num">18</span>
        </time>
      </h2>
      <div class="list">
        
        <article class="item">
          <button class="item__icon item__icon--handle" type="button">
            <span class="vh">Order</span>
            <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/85421/handle.svg">
          </button>
          <div class="feather">
            <div class="feature__text">Try the live app: <a href="https://muteswan.app/" target="_blank"><b>muteswan.app</b></a></div>
          </div>
        </article>
        <article class="item item--drag-active">
          <button class="item__icon item__icon--handle" type="button">
            <span class="vh">Order</span>
            <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/85421/handle.svg">
          </button>
          <div class="feather">
            <textarea class="feature__text" rows="1" autocomplete="off">Single line example</textarea>
          </div>
          <button class="item__icon item__icon--done" type="button">
            <span class="vh">Done</span>
            <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/85421/done.svg">
          </button>
          <button class="item__icon item__icon--delete" type="button">
            <span class="vh">Delete</span>
            <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/85421/delete.svg">
          </button>
        </article>
      </div>
    </section>
  
    <section class="nest nest--today">
      <h2 class="date" tabindex="0">
        <time class="date__time">
         <abbr class="date__day" title="Monday">Monday</abbr>
         <span class="date__num">17</span>
        </time>
      </h2>
      <div class="list">
        <article class="item item--done">
          <button class="item__icon item__icon--handle" type="button">
            <span class="vh">Order</span>
            <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/85421/handle.svg">
          </button>
          <div class="feather">
            <textarea class="feature__text" rows="1" autocomplete="off">This is an example note that covers two lines</textarea>
          </div>
          <button class="item__icon item__icon--done" type="button" aria-pressed="true">
            <span class="vh">Done</span>
            <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/85421/done.svg">
          </button>
        </article>
      </div>
    </section>

  </div>
    
  <div class="pond pond--history">
    
    <section class="nest">
      <h2 class="date" tabindex="0">
        <time class="date__time">
         <abbr class="date__day" title="Sunday">Sunday</abbr>
         <span class="date__num">16</span>
        </time>
      </h2>
      <div class="list">
        <article class="item item--drop-after">
          <button class="item__icon item__icon--handle" type="button">
            <span class="vh">Order</span>
            <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/85421/handle.svg">
          </button>
          <div class="feather">
            <textarea class="feature__text" rows="1" autocomplete="off">Single line example</textarea>
          </div>
        </article>
        <!--
        <article class="item item--drop-before">
          <button class="item__icon item__icon--handle" type="button">
            <span class="vh">Order</span>
            <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/85421/handle.svg">
          </button>
          <div class="feather">
            <textarea class="feature__text" rows="1" autocomplete="off">This is an example note</textarea>
          </div>
        </article>
        -->
      </div>
    </section>
    
  </div>
  
  <footer class="footer">
    <small>v0.2.4 | <span class="vh">Copyright</span> &copy; 2020 <a href="https://dbushell.com" target="_blank">David Bushell</a></small>
    <a
      class="badge"
      target="_blank"
      href="https://play.google.com/store/apps/details?id=app.muteswan.android">
      <img
        srcset="
        https://s3-us-west-2.amazonaws.com/s.cdpn.io/85421/google-play-badge%401x.png,
        https://s3-us-west-2.amazonaws.com/s.cdpn.io/85421/google-play-badge%402x.png 2x"
        src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/85421/google-play-badge%401x.png"
        alt="Get Mute Swan on Google Play"
        width="282"
        height="84"
      />
    </a>
  </footer>
</main>

<div class="loading">
  <svg class="loading__animation" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid">
    <rect x="46.5" y="7.5" rx="27.9" ry="4.5" width="7" height="21">
      <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.9166666666666666s" repeatCount="indefinite"/>
    </rect>
    <rect x="46.5" y="7.5" rx="27.9" ry="4.5" width="7" height="21" transform="rotate(30 50 50)">
      <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.8333333333333334s" repeatCount="indefinite"/>
    </rect>
    <rect x="46.5" y="7.5" rx="27.9" ry="4.5" width="7" height="21" transform="rotate(60 50 50)">
      <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.75s" repeatCount="indefinite"/>
    </rect>
    <rect x="46.5" y="7.5" rx="27.9" ry="4.5" width="7" height="21" transform="rotate(90 50 50)">
      <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.6666666666666666s" repeatCount="indefinite"/>
    </rect>
    <rect x="46.5" y="7.5" rx="27.9" ry="4.5" width="7" height="21" transform="rotate(120 50 50)">
      <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.5833333333333334s" repeatCount="indefinite"/>
    </rect>
    <rect x="46.5" y="7.5" rx="27.9" ry="4.5" width="7" height="21" transform="rotate(150 50 50)">
      <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.5s" repeatCount="indefinite"/>
    </rect>
    <rect x="46.5" y="7.5" rx="27.9" ry="4.5" width="7" height="21" transform="rotate(180 50 50)">
      <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.4166666666666667s" repeatCount="indefinite"/>
    </rect>
    <rect x="46.5" y="7.5" rx="27.9" ry="4.5" width="7" height="21" transform="rotate(210 50 50)">
      <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.3333333333333333s" repeatCount="indefinite"/>
    </rect>
    <rect x="46.5" y="7.5" rx="27.9" ry="4.5" width="7" height="21" transform="rotate(240 50 50)">
      <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.25s" repeatCount="indefinite"/>
    </rect>
    <rect x="46.5" y="7.5" rx="27.9" ry="4.5" width="7" height="21" transform="rotate(270 50 50)">
      <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.16666666666666666s" repeatCount="indefinite"/>
    </rect>
    <rect x="46.5" y="7.5" rx="27.9" ry="4.5" width="7" height="21" transform="rotate(300 50 50)">
      <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.08333333333333333s" repeatCount="indefinite"/>
    </rect>
    <rect x="46.5" y="7.5" rx="27.9" ry="4.5" width="7" height="21" transform="rotate(330 50 50)">
      <animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="0s" repeatCount="indefinite"/>
    </rect>
  </svg>
</div>
              
            
!

CSS

              
                @function rem($px, $base: 16) {
  @return ($px / $base) + rem;
}

$darkest: #16171a;
$dark: #222629;
$lightest: #c1d3e5;
$light: #85919e;
$primary: #17a1e5;
$secondary: #e56545;

:root {
  --darkest: #{$darkest}; // 22, 23, 26;
  --dark: #{$dark};
  --lightest: #{$lightest};
  --light: #{$light};
  --primary: #{$primary};
  --secondary: #{$secondary};
  --white: #fff;

  --fonts: "Noto Sans", sans-serif;
  --display: "Comfortaa", "Noto Sans", sans-serif;

  --background: var(--darkest);
  --date-color: var(--primary);
  --text-color: var(--lightest);
  --text-focus: var(--white);

  --text-size: #{rem(16)};
  --text-line: #{rem(20)};

  --margin: #{rem(15)};
}

*,
*:before,
*:after {
  box-sizing: border-box;
}

button {
  &:focus {
    outline: none;
  }
  &::-moz-focus-inner {
    border: 0;
  }
}

html {
  background: var(--background);
  color: var(--text-color);
  line-height: 1.35;
  font-family: var(--fonts);
  text-size-adjust: none;
}

body {
  margin: 0;
}

.loading {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

.loading__animation {
  flex: 1 1 auto;
  height: rem(50);
  width: rem(50);
  color: var(--primary);
  
  rect {
    fill: currentColor;
  }
}

.header {
  align-items: center;
  background: var(--darkest);
  display: flex;
  height: rem(50);
  justify-content: flex-end;
  padding: 0 var(--margin);
  position: fixed;
  width: 100%;
  z-index: 9999;

  & > * {
    flex: 0 0 auto;
  }

  h1 {
    font-family: var(--display);
    font-size: rem(18);
    font-weight: 700;
    margin: 0;
    order: 4;
  }
}

.footer {
  padding: rem(15) var(--margin);
  color: var(--light);
  text-align: right;
  
  a {
    color: inherit;
  }
  
  small {
    display: block;
    font-size: rem(12);
    line-height: 1.5;
    opacity: 0.5;
  }
}

.badge {
  display: block;
  margin: rem(15) 0 0 auto;
  max-width: rem(120);
  
  img {
    display: block;
    height: auto;
    max-width: 100%;
  }
}

.logo {
  background: var(--darkest);
  display: block;
  margin-right: auto;
  max-width: max-content;
  position: relative;

  svg,
  img {
    display: block;
    height: auto;
    width: rem(30);
  }

  .header--offline & {
    filter: saturate(0);
  }
}

main {
  padding-top: rem(50);
}

.vh {
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  white-space: nowrap;
}

.undo,
.redo {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--light);
  cursor: pointer;
  display: flex;
  height: rem(30);
  justify-content: center;
  width: rem(30);
  margin: 0 rem(15);
  outline: none;
  padding: 0;
  transition: color 150ms;

  &[disabled] {
    opacity: 0.3;
    pointer-events: none;
  }

  * {
    pointer-events: none;
  }

  img,
  svg {
    fill: currentColor;
    max-width: rem(20);
  }
}

.undo {
  margin-right: 0;
}

.redo {
  margin-left: 0;
}

/**
 * Date
 */

.date {
  color: var(--date-color);
  font-family: var(--display);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.1em;
  margin: 0 0 rem(10) 0;
  max-width: max-content;
  padding: 0 var(--margin);
  outline: none;

  &:last-child {
    margin-bottom: 0;
  }
}

.date__time {
  display: flex;
  flex-direction: column;
}

.date__day {
  border: none;
  font-size: rem(10);
  order: 2;
  text-transform: uppercase;
  text-decoration: none;
}

.date__num {
  font-size: rem(26);
  margin-bottom: rem(2);
  order: 1;
}

/**
 * Pond
 */

.pond {
  background: var(--background);
  padding: rem(20) 0;

  &:first-child {
    padding-top: rem(30);
  }

  &:last-child {
    padding-bottom: rem(30);
  }
}

.pond--future {
  --background: var(--dark);
}

.pond--history {
  --date-color: var(--light);
  --text-color: var(--light);
}

/**
 * Nest
 */

.nest {
  padding-bottom: rem(20);
  position: relative;
  
  &:last-child {
    padding-bottom: 0;
  }
  
  &[style*="--height"] {
    height: calc(var(--height) + 30px);
  }
}

.nest--today {
  --date-color: var(--secondary);
}

/**
 * List
 */

.list {
  padding-bottom: rem(5);
  width: 100%;
}

.list--drag-over {
  position: absolute;
}

/**
 * Item
 */

.item {
  --icon-color: var(--light);
  align-items: flex-start;
  display: flex;
  padding: 0 var(--margin);
  position: relative;
  transition: padding 150ms linear;

  .feather {
    flex: 1 1 auto;
  }

  // &:after {
  //   background: linear-gradient(to right, var(--primary), var(--secondary));
  //   content: "";
  //   display: block;
  //   height: rem(2);
  //   left: 0;
  //   opacity: 0;
  //   margin-top: rem(-1);
  //   position: absolute;
  //   pointer-events: none;
  //   width: 100%;
  // }
}

.item--drop-after {
  padding-bottom: rem(30);
  
  &:after {
    opacity: 0.5;
    top: 100%;
    transform: translateY(rem(-15));
  }
}

.item--drop-before {
  padding-top: rem(30);
  
  &:after {
    opacity: 0.5;
    top: 0;
    transform: translateY(rem(15));
  }
}

.item__icon {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--icon-color);
  cursor: pointer;
  display: flex;
  height: rem(30);
  justify-content: center;
  width: rem(30);
  margin: 0;
  outline: none;
  padding: 0;
  transition: color 150ms;

  &[disabled] {
    opacity: 0.5;
    pointer-events: none;
  }

  &[aria-pressed="true"] {
    opacity: 0.5;
  }

  &:first-child {
    margin-left: rem(-5);
  }

  * {
    pointer-events: none;
  }

  img,
  svg {
    fill: currentColor;
  }
}

.item--drag-active {
  --text-color: var(--secondary);
  --icon-color: var(--secondary);
}

.item--preview {
  background: var(--darkest);
  opacity: 0.8;
  
  .feather {
    padding-right: rem(30);
  }
}

/**
 * Feather
 */

.feather {
  color: var(--text-color);
  font-size: rem(--text-size);
  line-height: rem(--text-line);
  // margin: rem(5) 0 0 0;
  padding: rem(5) 0 0 rem(5);
}

.feature__text {
  background: transparent;
  border: 0;
  display: block;
  color: inherit;
  font-family: inherit;
  font-weight: inherit;
  font-size: inherit;
  height: auto;
  line-height: inherit;
  margin: 0;
  outline: 0;
  overflow: hidden;
  padding: 0;
  resize: none;
  transition: color 150ms;
  width: 100%;

  &:focus {
    color: var(--text-focus);
  }

  .item--done & {
    text-decoration: line-through;
    opacity: 0.5;
  }
  
  a {
    color: inherit;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console