Skip to content

Instantly share code, notes, and snippets.

@drwpow
Last active May 27, 2016 15:02
Show Gist options
  • Save drwpow/cadf9c3687aa7063e81c49269ab72a2d to your computer and use it in GitHub Desktop.
Save drwpow/cadf9c3687aa7063e81c49269ab72a2d to your computer and use it in GitHub Desktop.
CSS to hide the entire first week of a calendar on mobile, but only if none of the days in that first week are selectable (--disabled)
.cal-day--disabled
display: none
@media screen and (min-width: 450px)
display: block
.cal-day:not(.cal-day--disabled)
~ .cal-day
display: block
.cal
.cal-day--disabled:first-child
+ .cal-day--disabled
+ .cal-day--disabled
+ .cal-day--disabled
+ .cal-day--disabled
+ .cal-day--disabled
+ .cal-day--disabled
~ .cal-day
display: block
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment