From b5dac6b5059c51a9182ecf3e3307029eeb0decc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Fri, 18 Dec 2020 15:47:56 +0100 Subject: [PATCH] scss: add style to have alternate row backgrounds in fields blocks (#45369) --- help/fr/misc-css-classes.page | 4 ++++ static/includes/wcs/_bulk.scss | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/help/fr/misc-css-classes.page b/help/fr/misc-css-classes.page index 8acc29cc..8023f921 100644 --- a/help/fr/misc-css-classes.page +++ b/help/fr/misc-css-classes.page @@ -107,6 +107,10 @@ de classes CSS réutilisables.

pk-error

Marque le champ commentaire avec le style de bloc d’erreur.

+ +

pk-blocks-zebra

+

Alterne les couleurs de fond des lignes des blocs de champs.

+ diff --git a/static/includes/wcs/_bulk.scss b/static/includes/wcs/_bulk.scss index c46f3f07..097c37e1 100644 --- a/static/includes/wcs/_bulk.scss +++ b/static/includes/wcs/_bulk.scss @@ -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); + } +}