diff --git a/dist/angular-json-calendar.css b/dist/angular-json-calendar.css index 9bb5ea4..a3bd2a4 100644 --- a/dist/angular-json-calendar.css +++ b/dist/angular-json-calendar.css @@ -1,14 +1,3 @@ -.bc-calendar--months .bc-calendar__day.bc-calendar__day--pad + .bc-calendar__day:not(.bc-calendar__day--pad)::after { - background-color: #999; - content: ''; - display: block; - position: absolute; - bottom: -1px; - left: -1px; - top: -1px; - width: 1px; -} - .bc-calendar--months .bc-calendar__month { display: block; margin-bottom: 2rem; @@ -22,7 +11,6 @@ } .bc-calendar--months .bc-calendar__weekdays { - border-bottom: 1px solid rgba(0, 0, 0, 0.05); color: #999; display: -webkit-box; display: -webkit-flex; @@ -33,7 +21,14 @@ flex-flow: row nowrap; } +.bc-calendar--months .bc-calendar__weekdays .bc-calendar__day, +.bc-calendar--months .bc-calendar__weekdays .bc-calendar__day:first-of-type, +.bc-calendar--months .bc-calendar__weekdays .bc-calendar__day:first-of-type:not(.bc-calendar__day--pad) { + border: 0; +} + .bc-calendar--months .bc-calendar__week { + border-top: 1px solid #999; display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -47,34 +42,57 @@ justify-content: space-between; } +.bc-calendar--months .bc-calendar__week:first-of-type { + border-top: 0; +} + +.bc-calendar--months .bc-calendar__week:first-of-type .bc-calendar__day { + border-top: 1px solid #999; +} + +.bc-calendar--months .bc-calendar__week:first-of-type .bc-calendar__day--pad { + border-top: 0; +} + +.bc-calendar--months .bc-calendar__week:first-of-type .bc-calendar__day--pad:last-child { + border-right: 1px solid #999; +} + +.bc-calendar--months .bc-calendar__week:last-of-type .bc-calendar__day { + border-bottom: 1px solid #999; +} + .bc-calendar--months .bc-calendar__week:nth-of-type(odd) .bc-calendar__day:nth-of-type(odd) { - background-color: rgba(0, 0, 0, 0.05); + background-color: rgba(0, 0, 0, 0.03); } -.bc-calendar--months .bc-calendar__week:nth-of-type(odd) .bc-calendar__day--pad:nth-of-type(odd) { - background-color: transparent; +.bc-calendar--months .bc-calendar__week:nth-of-type(odd) .bc-calendar__day.bc-calendar__day--pad { + background: transparent; + border-color: transparent; } .bc-calendar--months .bc-calendar__week:nth-of-type(even) .bc-calendar__day:nth-of-type(even) { - background-color: rgba(0, 0, 0, 0.05); + background-color: rgba(0, 0, 0, 0.03); } .bc-calendar--months .bc-calendar__week:nth-of-type(even) .bc-calendar__day--pad:nth-of-type(even) { background-color: transparent; } -.bc-calendar--months .bc-calendar__week:nth-of-type(even) .bc-calendar__day:nth-of-type(odd) { - border: 1px solid rgba(0, 0, 0, 0.05); +.bc-calendar--months .bc-calendar__week:nth-of-type(even) .bc-calendar__day.bc-calendar__day--pad { + background: transparent; + border: 0; } .bc-calendar--months .bc-calendar__day { + border-right: 1px solid #999; -webkit-box-flex: 1; -webkit-flex: 1 1 auto; -ms-flex: 1 1 auto; flex: 1 1 auto; position: relative; text-align: center; - width: calc((100% / 7) - 6.25rem); + width: calc(((100% / 7) - 2px) - 6.25rem); } .bc-calendar--months .bc-calendar__day::before { @@ -84,6 +102,10 @@ padding-top: 100%; } +.bc-calendar--months .bc-calendar__day:first-of-type:not(.bc-calendar__day--pad) { + border-left: 1px solid #999; +} + .bc-calendar--months .bc-calendar__day--weekdays { line-height: 2em; } @@ -92,6 +114,17 @@ display: none; } +.bc-calendar--months .bc-calendar__day.bc-calendar__day--pad + .bc-calendar__day:not(.bc-calendar__day--pad)::after { + background-color: #999; + content: ''; + display: block; + position: absolute; + bottom: -1px; + left: -1px; + top: -1px; + width: 1px; +} + .bc-calendar--months .bc-calendar__day-time { -webkit-box-align: center; -webkit-align-items: center; diff --git a/dist/angular-json-calendar.min.css b/dist/angular-json-calendar.min.css index 82e2bea..07ecc5e 100644 --- a/dist/angular-json-calendar.min.css +++ b/dist/angular-json-calendar.min.css @@ -1 +1 @@ -.bc-calendar--months .bc-calendar__day.bc-calendar__day--pad+.bc-calendar__day:not(.bc-calendar__day--pad)::after{background-color:#999;content:'';display:block;position:absolute;bottom:-1px;left:-1px;top:-1px;width:1px}.bc-calendar--months .bc-calendar__month{display:block;margin-bottom:2rem}.bc-calendar--months .bc-calendar__month .bc-calendar__month-title{display:block;font-size:2rem;padding:1rem;text-align:center}.bc-calendar--months .bc-calendar__weekdays{border-bottom:1px solid rgba(0,0,0,0.05);color:#999;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:row nowrap;-ms-flex-flow:row nowrap;flex-flow:row nowrap}.bc-calendar--months .bc-calendar__week{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:row nowrap;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between}.bc-calendar--months .bc-calendar__week:nth-of-type(odd) .bc-calendar__day:nth-of-type(odd){background-color:rgba(0,0,0,0.05)}.bc-calendar--months .bc-calendar__week:nth-of-type(odd) .bc-calendar__day--pad:nth-of-type(odd){background-color:transparent}.bc-calendar--months .bc-calendar__week:nth-of-type(even) .bc-calendar__day:nth-of-type(even){background-color:rgba(0,0,0,0.05)}.bc-calendar--months .bc-calendar__week:nth-of-type(even) .bc-calendar__day--pad:nth-of-type(even){background-color:transparent}.bc-calendar--months .bc-calendar__week:nth-of-type(even) .bc-calendar__day:nth-of-type(odd){border:1px solid rgba(0,0,0,0.05)}.bc-calendar--months .bc-calendar__day{-webkit-box-flex:1;-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;position:relative;text-align:center;width:calc((100% / 7) - 6.25rem)}.bc-calendar--months .bc-calendar__day::before{content:'';display:block;height:0;padding-top:100%}.bc-calendar--months .bc-calendar__day--weekdays{line-height:2em}.bc-calendar--months .bc-calendar__day--weekdays::before{display:none}.bc-calendar--months .bc-calendar__day-time{-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:row nowrap;-ms-flex-flow:row nowrap;flex-flow:row nowrap;font-size:12px;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;position:absolute;bottom:0;left:0;right:0;top:0}.bc-calendar--months .bc-calendar__day-time small{display:block}.bc-calendar--months .bc-calendar__day .week--date{color:#999;font-size:.8rem;font-weight:600;text-transform:uppercase;position:absolute;top:.4em;left:.4em}.bc-calendar--months .bc-calendar__day .month{font-size:.6rem;font-weight:600;letter-spacing:.1em;opacity:.2;text-transform:uppercase;position:absolute;bottom:.2em;left:0;right:0}.bc-calendar--days .bc-calendar__weekdays{border-bottom:2px solid #246b86;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:row nowrap;-ms-flex-flow:row nowrap;flex-flow:row nowrap}.bc-calendar--days .bc-calendar__week{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:row nowrap;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between}.bc-calendar--days .bc-calendar__week:nth-of-type(odd) .bc-calendar__day:nth-of-type(odd){background-color:rgba(0,0,0,0.05)}.bc-calendar--days .bc-calendar__week:nth-of-type(odd) .bc-calendar__day--pad:nth-of-type(odd){background-color:transparent}.bc-calendar--days .bc-calendar__week:nth-of-type(even) .bc-calendar__day:nth-of-type(even){background-color:rgba(0,0,0,0.05)}.bc-calendar--days .bc-calendar__week:nth-of-type(even) .bc-calendar__day--pad:nth-of-type(even){background-color:transparent}.bc-calendar--days .bc-calendar__week:nth-of-type(even) .bc-calendar__day:nth-of-type(odd){border:1px solid rgba(0,0,0,0.05)}.bc-calendar--days .bc-calendar__day{-webkit-box-flex:1;-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;position:relative;text-align:center;width:calc((100% / 7) - 6.25rem)}.bc-calendar--days .bc-calendar__day::before{content:'';display:block;height:0;padding-top:100%}.bc-calendar--days .bc-calendar__day--weekdays{line-height:2em}.bc-calendar--days .bc-calendar__day--weekdays::before{display:none}.bc-calendar--days .bc-calendar__day-time{-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:row nowrap;-ms-flex-flow:row nowrap;flex-flow:row nowrap;font-size:12px;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;position:absolute;bottom:0;left:0;right:0;top:0}.bc-calendar--days .bc-calendar__day-time small{display:block}.bc-calendar--days .bc-calendar__day .week--date{color:#246b86;font-size:.8rem;font-weight:600;text-transform:uppercase;position:absolute;top:.4em;left:.4em}.bc-calendar--days .bc-calendar__day .month{font-size:.6rem;font-weight:600;letter-spacing:.1em;opacity:.2;text-transform:uppercase;position:absolute;bottom:.2em;left:0;right:0}.bc-calendar--sidescroll{overflow-x:scroll;white-space:nowrap}.bc-calendar--sidescroll .bc-calendar__day{border:1px solid #add8e6;display:inline-block;position:relative;text-align:center;width:8rem}.bc-calendar--sidescroll .bc-calendar__day::before{content:'';display:block;height:0;padding-top:80%}.bc-calendar--sidescroll .bc-calendar__day-time{-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:row nowrap;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;position:absolute;bottom:0;left:0;right:0;top:0}.bc-calendar--sidescroll .week--day{font-size:11px;font-weight:600;opacity:.5;text-transform:uppercase;position:absolute;bottom:0;left:0;right:0} +.bc-calendar--months .bc-calendar__month{display:block;margin-bottom:2rem}.bc-calendar--months .bc-calendar__month .bc-calendar__month-title{display:block;font-size:2rem;padding:1rem;text-align:center}.bc-calendar--months .bc-calendar__weekdays{color:#999;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:row nowrap;-ms-flex-flow:row nowrap;flex-flow:row nowrap}.bc-calendar--months .bc-calendar__weekdays .bc-calendar__day,.bc-calendar--months .bc-calendar__weekdays .bc-calendar__day:first-of-type,.bc-calendar--months .bc-calendar__weekdays .bc-calendar__day:first-of-type:not(.bc-calendar__day--pad){border:0}.bc-calendar--months .bc-calendar__week{border-top:1px solid #999;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:row nowrap;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between}.bc-calendar--months .bc-calendar__week:first-of-type{border-top:0}.bc-calendar--months .bc-calendar__week:first-of-type .bc-calendar__day{border-top:1px solid #999}.bc-calendar--months .bc-calendar__week:first-of-type .bc-calendar__day--pad{border-top:0}.bc-calendar--months .bc-calendar__week:first-of-type .bc-calendar__day--pad:last-child{border-right:1px solid #999}.bc-calendar--months .bc-calendar__week:last-of-type .bc-calendar__day{border-bottom:1px solid #999}.bc-calendar--months .bc-calendar__week:nth-of-type(odd) .bc-calendar__day:nth-of-type(odd){background-color:rgba(0,0,0,0.03)}.bc-calendar--months .bc-calendar__week:nth-of-type(odd) .bc-calendar__day.bc-calendar__day--pad{background:transparent;border-color:transparent}.bc-calendar--months .bc-calendar__week:nth-of-type(even) .bc-calendar__day:nth-of-type(even){background-color:rgba(0,0,0,0.03)}.bc-calendar--months .bc-calendar__week:nth-of-type(even) .bc-calendar__day--pad:nth-of-type(even){background-color:transparent}.bc-calendar--months .bc-calendar__week:nth-of-type(even) .bc-calendar__day.bc-calendar__day--pad{background:transparent;border:0}.bc-calendar--months .bc-calendar__day{border-right:1px solid #999;-webkit-box-flex:1;-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;position:relative;text-align:center;width:calc(((100% / 7) - 2px) - 6.25rem)}.bc-calendar--months .bc-calendar__day::before{content:'';display:block;height:0;padding-top:100%}.bc-calendar--months .bc-calendar__day:first-of-type:not(.bc-calendar__day--pad){border-left:1px solid #999}.bc-calendar--months .bc-calendar__day--weekdays{line-height:2em}.bc-calendar--months .bc-calendar__day--weekdays::before{display:none}.bc-calendar--months .bc-calendar__day.bc-calendar__day--pad+.bc-calendar__day:not(.bc-calendar__day--pad)::after{background-color:#999;content:'';display:block;position:absolute;bottom:-1px;left:-1px;top:-1px;width:1px}.bc-calendar--months .bc-calendar__day-time{-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:row nowrap;-ms-flex-flow:row nowrap;flex-flow:row nowrap;font-size:12px;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;position:absolute;bottom:0;left:0;right:0;top:0}.bc-calendar--months .bc-calendar__day-time small{display:block}.bc-calendar--months .bc-calendar__day .week--date{color:#999;font-size:.8rem;font-weight:600;text-transform:uppercase;position:absolute;top:.4em;left:.4em}.bc-calendar--months .bc-calendar__day .month{font-size:.6rem;font-weight:600;letter-spacing:.1em;opacity:.2;text-transform:uppercase;position:absolute;bottom:.2em;left:0;right:0}.bc-calendar--days .bc-calendar__weekdays{border-bottom:2px solid #246b86;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:row nowrap;-ms-flex-flow:row nowrap;flex-flow:row nowrap}.bc-calendar--days .bc-calendar__week{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:row nowrap;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between}.bc-calendar--days .bc-calendar__week:nth-of-type(odd) .bc-calendar__day:nth-of-type(odd){background-color:rgba(0,0,0,0.05)}.bc-calendar--days .bc-calendar__week:nth-of-type(odd) .bc-calendar__day--pad:nth-of-type(odd){background-color:transparent}.bc-calendar--days .bc-calendar__week:nth-of-type(even) .bc-calendar__day:nth-of-type(even){background-color:rgba(0,0,0,0.05)}.bc-calendar--days .bc-calendar__week:nth-of-type(even) .bc-calendar__day--pad:nth-of-type(even){background-color:transparent}.bc-calendar--days .bc-calendar__week:nth-of-type(even) .bc-calendar__day:nth-of-type(odd){border:1px solid rgba(0,0,0,0.05)}.bc-calendar--days .bc-calendar__day{-webkit-box-flex:1;-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;position:relative;text-align:center;width:calc((100% / 7) - 6.25rem)}.bc-calendar--days .bc-calendar__day::before{content:'';display:block;height:0;padding-top:100%}.bc-calendar--days .bc-calendar__day--weekdays{line-height:2em}.bc-calendar--days .bc-calendar__day--weekdays::before{display:none}.bc-calendar--days .bc-calendar__day-time{-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:row nowrap;-ms-flex-flow:row nowrap;flex-flow:row nowrap;font-size:12px;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;position:absolute;bottom:0;left:0;right:0;top:0}.bc-calendar--days .bc-calendar__day-time small{display:block}.bc-calendar--days .bc-calendar__day .week--date{color:#246b86;font-size:.8rem;font-weight:600;text-transform:uppercase;position:absolute;top:.4em;left:.4em}.bc-calendar--days .bc-calendar__day .month{font-size:.6rem;font-weight:600;letter-spacing:.1em;opacity:.2;text-transform:uppercase;position:absolute;bottom:.2em;left:0;right:0}.bc-calendar--sidescroll{overflow-x:scroll;white-space:nowrap}.bc-calendar--sidescroll .bc-calendar__day{border:1px solid #add8e6;display:inline-block;position:relative;text-align:center;width:8rem}.bc-calendar--sidescroll .bc-calendar__day::before{content:'';display:block;height:0;padding-top:80%}.bc-calendar--sidescroll .bc-calendar__day-time{-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:row nowrap;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;position:absolute;bottom:0;left:0;right:0;top:0}.bc-calendar--sidescroll .week--day{font-size:11px;font-weight:600;opacity:.5;text-transform:uppercase;position:absolute;bottom:0;left:0;right:0} diff --git a/src/calendar.scss b/src/calendar.scss index 6bd38ba..9bebdcc 100644 --- a/src/calendar.scss +++ b/src/calendar.scss @@ -12,24 +12,12 @@ $deep_blue: #246b86; // &--months { - // add a left border to the first real day of the month - .bc-calendar__day.bc-calendar__day--pad + .bc-calendar__day:not(.bc-calendar__day--pad) { - &::after { - background-color: $gray; - content: ''; - display: block; - position: absolute; - bottom: -1px; - left: -1px; - top: -1px; - width: 1px; - } - } - + // container for a month .bc-calendar__month { display: block; margin-bottom: 2rem; + // the month name .bc-calendar__month-title { display: block; font-size: 2rem; @@ -38,50 +26,85 @@ $deep_blue: #246b86; } } - // container for heading row + // container for heading row (M, T, W, T...) .bc-calendar__weekdays { - border-bottom: 1px solid rgba($black, .05); color: $gray; display: flex; flex-flow: row nowrap; + + .bc-calendar__day, + .bc-calendar__day:first-of-type, + .bc-calendar__day:first-of-type:not(.bc-calendar__day--pad) { + border: 0; + } } //
container for week .bc-calendar__week { + border-top: 1px solid $gray; display: flex; flex-flow: row nowrap; justify-content: space-between; + // target first week + &:first-of-type { + border-top: 0; + + .bc-calendar__day { + border-top: 1px solid $gray; + } + + .bc-calendar__day--pad { + border-top: 0; + + &:last-child { + border-right: 1px solid $gray; + } + } + } + + // target last week + &:last-of-type { + .bc-calendar__day { + border-bottom: 1px solid $gray; + } + } + + // target all odd weeks/rows &:nth-of-type(odd) { .bc-calendar__day:nth-of-type(odd) { - background-color: rgba($black, .05); + background-color: rgba($black, .03); } - .bc-calendar__day--pad:nth-of-type(odd) { - background-color: transparent; + .bc-calendar__day.bc-calendar__day--pad { + background: transparent; + border-color: transparent; } } + // target all even weeks/rows &:nth-of-type(even) { .bc-calendar__day:nth-of-type(even) { - background-color: rgba($black, .05); + background-color: rgba($black, .03); } .bc-calendar__day--pad:nth-of-type(even) { background-color: transparent; } - .bc-calendar__day:nth-of-type(odd) { - border: 1px solid rgba($black, .05); + .bc-calendar__day.bc-calendar__day--pad { + background: transparent; + border: 0; } } } .bc-calendar__day { + border-right: 1px solid $gray; flex: 1 1 auto; position: relative; text-align: center; - width: calc((100% / 7) - 6.25rem); + width: calc(((100% / 7) - 2px) - 6.25rem); &::before { content: ''; @@ -90,6 +113,10 @@ $deep_blue: #246b86; padding-top: 100%; } + &:first-of-type:not(.bc-calendar__day--pad) { + border-left: 1px solid $gray; + } + &--weekdays { line-height: 2em; @@ -98,6 +125,20 @@ $deep_blue: #246b86; } } + // add a left border to the first real day of the month + &.bc-calendar__day--pad + .bc-calendar__day:not(.bc-calendar__day--pad) { + &::after { + background-color: $gray; + content: ''; + display: block; + position: absolute; + bottom: -1px; + left: -1px; + top: -1px; + width: 1px; + } + } + //