sto refactoring questi selettori CSS verso Sass:Sass nth-child nidificazione
#romtest .detailed th:nth-child(2),
#romtest .detailed th:nth-child(4),
#romtest .detailed th:nth-child(6),
#romtest .detailed td:nth-child(2),
#romtest .detailed td:nth-child(3),
#romtest .detailed td:nth-child(6),
#romtest .detailed td:nth-child(7),
#romtest .detailed td.last:nth-child(2),
#romtest .detailed td.last:nth-child(4) {
background:#e5e5e5;
}
... e si avvicinò con questo:
#romtest .detailed {
th:nth-child {
&(2), &(4), &(6) {
background:#e5e5e5;
}
}
td:nth-child {
&(2), &(3), &(6), &(7) {
background:#e5e5e5;
}
}
td.last:nth-child {
&(2), &(4) {
background:#e5e5e5;
}
}
}
Purtroppo questo sta gettando un errore:
Invalid CSSS after "&": expected "{", was "(2), &(4), &(6) {"
so anche questo potrebbe essere meglio perché sono:
- ripetendo il colore di sfondo
- ripetendo i numeri - vale a dire (2) e (6)
Come devo refactoring questi selettori?