In CSS, there is no way to do this except to just sit and write the rules. It’s not such a big deal to write ten rules, bringing you to ten levels of nesting. Your alternative is to spend more time writing JS to add classes or add additional classes or deal with the SASS macro, which will take more time than it costs.
.box { max-width: 100%; margin: 25px 0px; padding: 15px; border: #d1ddbd solid 2px; } .box > .box { border-width: 1px; } .box, .box > .box > .box, .box > .box > .box > .box > .box, .box > .box > .box > .box > .box > .box > .box, .box > .box > .box > .box > .box > .box > .box > .box > .box { background-color:#f3fae8; } .box > .box, .box > .box > .box > .box, .box > .box > .box > .box > .box > .box, .box > .box > .box > .box > .box > .box > .box > .box, .box > .box > .box > .box > .box > .box > .box > .box, .box > .box { background-color:#fff; }
user663031
source share