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
View Compiled
@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;
}
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.