cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              .calendar-wrap
  .arrow-up
  .calendar
    .header
      span.entypo-left-open-mini
      p OCT | 2013
      span.entypo-right-open-mini
    .picker
      ul.weekdays
        li SUN
        li MON
        li TUE
        li WED
        li THU
        li FRI
        li SAT
      ol.days.days-previous-month
      ol.days.days-this-month
    .footer
            
          
!
            
              @import url(http://weloveiconfonts.com/api/?family=entypo)
@import url(https://fonts.googleapis.com/css?family=Roboto+Condensed:300)

body
  background-color: #3F3F3F
  color: #FEF9FA
  font-family: 'Roboto Condensed', sans-serif
    
/* entypo */
[class*="entypo-"]:before 
  font-family: 'entypo', sans-serif

.entypo-left-open-mini
  float: left
  margin-left: 25px
.entypo-right-open-mini
  float: right
  margin-right: 25px

.calendar-wrap
  margin: 30px auto
  width: 350px
  height: 410px
  .arrow-up
    margin: 0 auto
    
.calendar
  width: 350px
  height: 400px
  background-color: #3C9BDC
  
.picker
  height: 300px
  
.header
  height: 50px
  position: relative
  z-index: 10
  border-bottom: 1px solid #1993C3
  text-align: center
  line-height: 50px
  font-size: 14px
  &:after
    content: ""
    position: absolute
    z-index: -1
    top: 51px
    left: 0
    border-bottom: 1px solid #67B0E6
    width: 100%
  p
    display: inline
      
.footer
  @extend .header
  border-top: 1px solid #1993C3
  border-bottom: 0
  &:after
    top: 0

.days-previous-month
  counter-reset: item 26
    
.days.days-previous-month li:before
  content: ''
    
.days-this-month
  counter-reset: item
    
.days li
  display: block
    
.days li:before
  content: counter(item)
  counter-increment: item
  display: block
    
ul, ol
  font-size: 14px
  
  li
    width: 50px
    height: 50px
    float: left
    text-align: center
    font-size: 12px
    line-height: 50px
    box-sizing: border-box
    user-select: none
    cursor: pointer
    
    &.future:active
      background-color: #368EC9
      border-top: 1px solid #2774A5
      border-left: 1px solid #2774A5
      border-right: 1px solid #2774A5
      border-bottom: 1px solid #86C3EA
      border-radius: 3px
      
.passed, .weekdays
  color: #7DBDE9
            
          
!
            
              var daysInMonth = {
  0:31,1:28,2:31,3:30,4:31,5:30,6:31,7:31,8:30,9:31,10:30,11:31
};
var today = new Date();
var dayToday = today.getDate() - 1;
var thisMonth = today.getMonth();
var lastMonth = thisMonth == 0 ? 11 : thisMonth - 1;

var firstDayOfThisMonth = new Date(today.getFullYear(), thisMonth, 1).getDay();

var lastMonthList = document.querySelector('.days-previous-month');
for(var i = 0; i < firstDayOfThisMonth; i++) {
  var li = document.createElement('li');
  lastMonthList.appendChild(li);
}

var thisMonthList = document.querySelector('.days-this-month');
for(var i = 0; i < daysInMonth[thisMonth]; i++) {
  var li = document.createElement('li');
  var className = i >= dayToday ? 'future' : 'passed';
  li.classList.add(className);
  thisMonthList.appendChild(li);
}
            
          
!
999px
Loading ..................

Console