Olá!
É uma questão q eu tb vou gostar de ver a solução.
Se fosse só colorir a partir da primeira li, é fácil, mas seguindo a sequência de acordo com o dia e cor inicial, eu não sei fazer.
css alterado para apenas colorir, começando a primeria li com verde
/* Import Google font - Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
}
body {
display: flex;
align-items: center;
padding: 0 10px;
justify-content: center;
min-height: 100vh;
background: #586f6b;
}
.wrapper {
width: 450px;
background: #fff;
border-radius: 10px;
box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}
.wrapper header {
display: flex;
align-items: center;
padding: 25px 30px 10px;
justify-content: space-between;
}
header .icons {
display: flex;
}
header .icons span {
height: 38px;
width: 38px;
margin: 0 1px;
cursor: pointer;
color: #878787;
text-align: center;
line-height: 38px;
font-size: 1.9rem;
user-select: none;
border-radius: 50%;
}
.icons span:last-child {
margin-right: -10px;
}
header .icons span:hover {
background: #f2f2f2;
}
header .current-date {
font-size: 1.45rem;
font-weight: 500;
}
.calendar {
padding: 20px;
}
.calendar ul {
display: flex;
flex-wrap: wrap;
list-style: none;
text-align: center;
}
.calendar .days {
margin-bottom: 20px;
}
.calendar li {
color: #333;
width: calc(100% / 7);
font-size: 1.07rem;
}
.calendar .weeks li {
font-weight: 500;
cursor: default;
}
.calendar .days li {
width: calc((100% / 7) - 2px);
z-index: 1;
cursor: pointer;
position: relative;
margin: 1px;
height: 48px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 4px;
}
.days li.inactive {
opacity: 0.5;
}
.days li.active {
color: #fff;
}
.days li::before {
position: absolute;
content: '';
left: 50%;
top: 50%;
height: 40px;
width: 40px;
z-index: -1;
border-radius: 50%;
transform: translate(-50%, -50%);
}
.days li.active::before {
background: #586f6b;
}
.days li:not(.active):hover::before {
background: #f2f2f2;
}
/* COLORS */
ul.days li:nth-child(8n + 1),
ul.days li:nth-child(8n + 2) {
background-color: lightgreen;
}
ul.days li:nth-child(8n + 3),
ul.days li:nth-child(8n + 4) {
background-color: lightblue;
}
ul.days li:nth-child(8n + 5),
ul.days li:nth-child(8n + 6) {
background-color: palegoldenrod;
}
ul.days li:nth-child(8n + 7),
ul.days li:nth-child(8n + 8) {
background-color: lightcoral;
}