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

              
                main
  table.calendar
    caption.calendar__banner--month
        h1 March
    thead
      tr
        th.calendar__day__header Sun
        th.calendar__day__header Mon
        th.calendar__day__header Tues
        th.calendar__day__header Wed
        th.calendar__day__header Thurs
        th.calendar__day__header Fri
        th.calendar__day__header Sat
    tbody
      tr
        td.calendar__day__cell
        td.calendar__day__cell
        td.calendar__day__cell
        td.calendar__day__cell 1
        td.calendar__day__cell 2
        td.calendar__day__cell 3
        td.calendar__day__cell 4
      tr
        td.calendar__day__cell 5
        td.calendar__day__cell 6
        td.calendar__day__cell 7
        td.calendar__day__cell 8
        td.calendar__day__cell 9
        td.calendar__day__cell 10
        td.calendar__day__cell 11
      tr
        td.calendar__day__cell 12
        td.calendar__day__cell 13
        td.calendar__day__cell 14
        td.calendar__day__cell(data-moon-phase="New Moon") 15
        td.calendar__day__cell 16
        td.calendar__day__cell 17
        td.calendar__day__cell 18
      tr
        td.calendar__day__cell 19
        td.calendar__day__cell 20
        td.calendar__day__cell 21
        td.calendar__day__cell 22
        td.calendar__day__cell 23
        td.calendar__day__cell 24
        td.calendar__day__cell 25
      tr
        td.calendar__day__cell 26
        td.calendar__day__cell 27
        td.calendar__day__cell 28
        td.calendar__day__cell(data-moon-phase="Full Moon") 29
        td.calendar__day__cell 30
        td.calendar__day__cell(data-bank-holiday="Good Friday") 31
        td.calendar__day__cell
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Montserrat:400,700);

$red: #e66053;
$black: #4E4F4A;
$cream: #F6E9DC;

$thin-border: 2px solid $red;

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

body {
  background-color: $red;
  color: $black;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Montserrat';
  font-weight: 700;
  min-height: 100vh;
}

main {
  background-color: $cream;
  box-shadow:
     0px 0px 0px 2px $red,
     10px 10px 20px 10px fade-out($black, .5);
  flex-basis: 980px;
}

.calendar {
  table-display: fixed;
  border: $thin-border;
  width: 100%;
}

.calendar__day__header,
.calendar__day__cell {
  border: $thin-border;
  text-align: center;
  width: 100% / 7; // fix width
  vertical-align: middle;
  &:first-child {
    border-left: none;
  }
  &:last-child {
    border-right: none;
  }
}

.calendar__day__header,
.calendar__day__cell {
  padding: .75rem 0 1.5rem;
}

.calendar__banner--month {
  border: $thin-border;
  border-bottom: none;
  text-align: center;
  padding: .75rem;
  h1 {
    background-color: $black;
    color: $cream;
    display: inline-block;
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: .5rem 2rem;
    text-transform: uppercase;
  }
}

.calendar__day__header {
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.calendar__day__cell {
  font-size: 4rem;
  position: relative;
}

tr:nth-child(odd) > .calendar__day__cell:nth-child(odd) {
  color: $red;
}

tr:nth-child(even) > .calendar__day__cell:nth-child(even) {
  color: $red;
}

.calendar__day__cell[data-moon-phase] {
  background-color: $red;
  color: $black;
  &:after {
    content: attr(data-moon-phase);
    color: $cream;
    display: block;
    font-weight: 400;
    font-size: .75rem;
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 1rem;
    text-transform: uppercase;
  }
}

.calendar__day__cell[data-bank-holiday] {
  background-color: $black;
  border-color: $black;
  
  border-bottom: none;
  color: $cream;
  &:after {
    content: attr(data-bank-holiday);
    color: $cream;
    display: block;
    font-size: .75rem;
    font-weight: 400;
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 1rem;
    text-transform: uppercase;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console