scss: add style to have alternate row backgrounds in fields blocks (#45369)

This commit is contained in:
Frédéric Péters 2020-12-18 15:47:56 +01:00
parent 087f262f69
commit b5dac6b505
2 changed files with 14 additions and 0 deletions

View File

@ -107,6 +107,10 @@ de classes CSS réutilisables.
<td><p><code>pk-error</code></p></td>
<td><p>Marque le champ commentaire avec le style de bloc derreur.</p></td>
</tr>
<tr>
<td><p><code>pk-blocks-zebra</code></p></td>
<td><p>Alterne les couleurs de fond des lignes des blocs de champs.</p></td>
</tr>
</table>
</section>

View File

@ -768,3 +768,13 @@ div.section.foldable {
}
}
}
.pk-blocks-zebra {
// add a gray background for even numbered blocks, but that means odd
// childs when the first child is an error.
.error ~ .BlockSubWidget:nth-child(odd),
.BlockSubWidget:first-child ~ .BlockSubWidget:nth-child(even) {
background: hsla(0, 0%, 0%, 0.05);
box-shadow: -0.5em -0.5em 0 .5em hsla(0, 0%, 0%, 0.05);
}
}