je ne trouve pas comment faire un selecteur "multiple"
j'ai ce code html par exemple :
<section class="auto">
<section class="auto">
<article>
aa1
</article>
<article>
aa2<br>aa2
</article>
</section>
<article>
a2<br>a2
</article>
<article>
a3
</article>
<article>
a4
</article>
</section>
j'ai fait un bout de scss pour dimensionner "automatiquement" mes colonnes
@for $i from 2 through 12 {
> *:first-child:nth-last-child(#{$i}),
> *:first-child:nth-last-child(#{$i}) ~ *
{
width: (100% / $i) - 1;
}
}
mais je suis obligé de cibler avec *, moi je ne veut filtrer que les articles et sections
j'ai testé ca :
> article:first-child:nth-last-child(#{$i}),
> article:first-child:nth-last-child(#{$i}) ~ article,
> article:first-child:nth-last-child(#{$i}) ~ section,
> section:first-child:nth-last-child(#{$i}),
> section:first-child:nth-last-child(#{$i}) ~ section,
> section:first-child:nth-last-child(#{$i}) ~ article
mais visiblement le nth-last-child cible uniquement le même élément qu'en début de ligne, il n'est pas global à tous les enfants
il n'existe pas une syntaxe magique pour sélectionner simplement les deux ? un genre de :not inverse ?
genre dans cet esprit ?
> (article,section):first-child:nth-last-child(#{$i}),
> (article,section):first-child:nth-last-child(#{$i}) ~ (article,section)