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

              
                .calendar
    ol.day-names
        li Sunday
        li Monday
        li Tuesday
        li Wednesday
        li Thursday
        li Friday
        li Saturday
    ol.days
        li
            .date 1
            .event Event with Long Name
        li
            .date 2
        li
            .date 3
        li
            .date 4
        li
            .date 5
        li
            .date 6
        li
            .date 7
        li
            .date 8
        li
            .date 9
        li
            .date 10
        li
            .date 11
        li
            .date 12
        li
            .date 13
            .event.all-day.begin.span-2 Event Name
        li
            .date 14
        li
            .date 15
            .event.all-day.end Event Name
        li
            .date 16
        li
            .date 17
        li
            .date 18
        li
            .date 19
        li
            .date 20
        li
            .date 21
            .event Event Name
            .event Event Name
        li
            .date 22
            .event.span-2 Event with Longer Name
        li
            .date 23
            .event.clear &nbsp;
            .event Event Name
        li
            .date 24
        li
            .date 25
        li
            .date 26
        li
            .date 27
        li
            .date 28
        li
            .date 29
        li
            .date 30
        li
            .date 31
        li.outside
            .date 1
        li.outside
            .date 2
        li.outside
            .date 3
        li.outside
            .date 4
            
              
            
!

CSS

              
                /* ================
   Assign Variables */
:root {
  --bg-color: hsl(130, 20%, 80%);
  --calendar-bg-color: hsl(130, 20%, 100%);
  --shade-color: hsla(150, 50%, 20%, 0.1);
  --text-color: hsl(280, 30%, 20%);
  --headline-color: hsl(0, 0%, 100%);
  --rule-color: hsla(0, 0%, 50%, 0);
  --primary-color: hsl(150, 50%, 50%);
  --secondary-color: hsl(280, 50%, 50%);
}

/* ===========================
   Setup Mixins/Helper Classes */
.clearfix:after {
    content: ".";
    display: block;
    height: 0;
    clear: both;
    visibility: hidden;
}

/* ==========
   Setup Page */
*, *:before, *:after { box-sizing: border-box; }
html { height: 100% }
body {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-color);
  color: var(--text-color);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* ================
   Calendar Styling */
.calendar {
  position: relative;
  margin: 3rem;
  overflow: hidden;
  max-width: 100%;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  border-radius: 1rem;
  background: var(--calendar-bg-color);
  box-shadow: 0.25rem 0.25rem 2rem var(--shade-color), -1rem -1rem 2rem var(--bg-color);
  
  // List styling
  ol { 
    list-style: none;
    margin: 0;
    padding:0;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    li {
      width: calc(100% / 7);
      padding: 1rem;
      background: linear-gradient(-145deg, transparent, hsla(0, 0%, 0%,0.025));
    }
  }

  .days {
    flex-grow: 1;
  }

  .day-names {
    background: linear-gradient(70deg, var(--primary-color), var(--secondary-color));
    color: var(--headline-color);
    flex-shrink: 0;
    flex-grow: 0;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: bold;
    line-height: 1;
  }

  .date {
    margin-bottom: 0.25em;
    font-size: 0.875em;
    font-weight: bold;
  }
  .outside .date { opacity: 0.5 }

  .event {
    --dot-color: var(--primary-color);
    box-shadow: 0.25em 0.25em 1em 0 hsla(0, 0%, 0%,0.05) inset;
    font-size: 0.75rem;
    padding: 0 0.75em;
    line-height: 2em; 
    white-space: nowrap;
    overflow: hidden;
    border-radius: 1em;
    display: flex;
    align-items: center;
    &::before {
      content: '';
      width: 0.5em;
      height: 0.5em;
      margin-right: 0.5em;
      background: var(--dot-color);
      border-radius: 100%;
      flex-shrink: 0;
    }
    &.span-2 { width: calc(200% + 2rem); }
    &.begin { border-radius: 1em 0 0 1em;}
    &.end { border-radius: 0 1em 1em 0;}
    &.all-day { background: var(--shade-color); }
    &.clear { visibility: hidden; }
  }
 }
              
            
!

JS

              
                
              
            
!
999px

Console