This commit is contained in:
armansansd 2021-10-18 13:00:56 +02:00
parent 3b008b5a74
commit dd4d9df8e5
3 changed files with 32 additions and 38 deletions

File diff suppressed because one or more lines are too long

View File

@ -42,6 +42,15 @@ function popsu_preprocess_field(&$variables){
if ($element['#field_name'] == 'field_texte') {
$variables['attributes']['class'][] = 'crop';
}
if($element["#field_name"] == "field_programme"){
foreach ($variables["items"] as $id => $item) {
$item['attributes']['class'] = new Attribute();
$c = $item['content']['#options']['entity']->nid->getString();
$item['attributes']->addClass("programme-".$c);
// kint($variables["items"]);die();
}
}
}
}

View File

@ -2,42 +2,28 @@
.field_logo{
display: block;
}
&.programme-1{
// .field_programme{
// background: $col-1;
// }
}
&.programme-2{
// .field_programme{
// background: $col-2;
// }
}
&.programme-3{
// .field_programme{
// background: $col-eur;
// }
}
&.programme-4{
// .field_programme{
// background: $col-1;
// }
}
&.programme-5{
// .field_programme{
// background: $col-mond;
// }
}
&.programme-6{
// .field_programme{
// background: $col-ter;
// }
}
&.programme-7{
// .field_programme{
// background: $col-met;
// }
.field_programme>div{
&.programme-1{
background: $col-1;
}
&.programme-2{
background: $col-2;
}
&.programme-3{
background: $col-eur;
}
&.programme-4{
background: $col-1;
}
&.programme-5{
background: $col-mond;
}
&.programme-6{
background: $col-ter;
}
&.programme-7{
background: $col-met;
}
}
.block-region-first{
padding: 1rem;
@ -83,7 +69,6 @@
color: white;
font-weight: 600;
padding: .3rem .5rem;
background-color: red;
margin-right: .5rem;
margin-bottom: .5rem;
}