Skip to content
Snippets Groups Projects
Commit fbba7b0f authored by Martin Leblanc's avatar Martin Leblanc
Browse files

ISTWCMS-5195: additonal twig logic in card

parent 21a4ff61
No related branches found
No related tags found
1 merge request!118Feature/istwcms 5195 ebremner node theming
...@@ -503,4 +503,4 @@ $gesso: ( ...@@ -503,4 +503,4 @@ $gesso: (
xxl: 96px, xxl: 96px,
), ),
gutter-width: 40px, gutter-width: 40px,
); );
\ No newline at end of file
.card.node { //.card.node {
> .card__header, // > .card__header,
> .card__footer { // > .card__footer {
@include uw-contained-width; // @include uw-contained-width;
} // }
> .card__body{ // > .card__body{
padding:0; // padding:0;
} // }
} //}
.uw-main > div > .action-links{ .uw-main > div > .action-links{
margin:0 !important; margin:0 !important;
} }
.node { .card__node{
&--type-uw-ct-blog, .card__header {
&--type-uw-ct-event, @include uw-contained-width;
&--type-uw-ct-news-item, background:gesso-brand(org-default,uw-white,primary);
&--type-uw-ct-profile, margin-top:4rem;
&--type-uw-ct-contact{ .card__title {
font-size: gesso-font-size(8);
.card.node {
.card__body {
}
.card__header {
@include uw-contained-width;
background:gesso-brand(org-default,uw-white,primary);
.card__title {
font-size: gesso-font-size(8);
}
.card__sub-title { }
font-size: gesso-font-size(4);
}
.card__date { .card__sub-title {
font-size: gesso-font-size(4);
}
} .card__date {
.card__author { }
} .card__author {
}
.card__footer {
}
} }
.uw-node__without-image { }
.card.node {
margin-top:1rem;
.card__body {
}
.card__header {
//@include uw-contained-width(55rem);
display:grid;
.card__title {
font-size: gesso-font-size(8); .uw-node__with-image &{
order:-1;
}
.card__sub-title { .card__header {
font-size: gesso-font-size(4); @include uw-contained-width();
} bottom:0;
.card__author { .card__title {
padding: gesso-spacing(xs) gesso-spacing(md); padding: gesso-spacing(xs) gesso-spacing(md);
} }
} .card__sub-title {
.card__footer{ padding: gesso-spacing(xs) gesso-spacing(md);
//@include uw-contained-width(55rem); }
padding: gesso-spacing(xs) gesso-spacing(md); .card__author {
} padding: gesso-spacing(xs) gesso-spacing(md);
} }
} }
.uw-node__with-image { .card__date {
.card { //margin-top: -2.25rem;
.card__header { .uw-date {
//@include uw-contained-width(55rem);
}
.card__body {
margin-top: -7rem;
}
.card__header {
margin-bottom: 1rem;
padding-bottom: 2rem;
.card__title {
padding: gesso-spacing(xs) gesso-spacing(md);
}
.card__sub-title {
padding: gesso-spacing(xs) gesso-spacing(md);
}
.card__author {
padding: gesso-spacing(xs) gesso-spacing(md);
}
}
.card__date {
margin-top: -2.25rem;
.uw-date {
}
}
.card__footer{
//@include uw-contained-width(55rem);
padding: gesso-spacing(xs) gesso-spacing(md);
}
} }
} }
} }
} }
.node--type-uw-ct-profile, .card__body {
.node--type-uw-ct-contact { //margin-top: -7rem;
.uw-node__without-image,
.uw-node__with-image{
.card.node {
margin-top: 1rem;
.card__body {
@include uw-contained-width;
}
}
}
} }
//.card__footer{
// //@include uw-contained-width(55rem);
// padding: gesso-spacing(xs) gesso-spacing(md);
//}
//.node--type-uw-ct-profile,
//.node--type-uw-ct-contact {
// .uw-node__without-image,
// .uw-node__with-image{
// .card.node {
// margin-top: 1rem;
// .card__body {
// @include uw-contained-width;
// }
// }
// }
//}
.card__teaser{
}
<div class="card__featured-image" style="background-image: url({{ hero.img_element }});" role="img" aria-label="{{ hero.alt }}"> <div class="card__featured-image" style="background-image: url({{ hero.img_element }});" role="img" aria-label="{{ hero.alt }}">
{% if show_header %}
{% include '@components/card/card-elements/_header.twig' with {
'header': header,
'show_title': show_title
} %}
{% endif %}
</div> </div>
...@@ -13,15 +13,16 @@ ...@@ -13,15 +13,16 @@
<article class="card{% if type %} card__{{ type }}{% endif %}{% if show_hover %} card--show-hover {% endif %}" > <article class="card{% if type %} card__{{ type }}{% endif %}{% if show_hover %} card--show-hover {% endif %}" >
{% if hero_image %} {% if hero_image and show_header == 'yes' %}
{% include '@components/card/card-elements/_hero-image.twig' with { {% include '@components/card/card-elements/_hero-image.twig' with {
'hero': hero_image, 'hero': hero_image,
'show_header': show_header,
} %} } %}
{% endif %} {% endif %}
<div class="card__body"> <div class="card__body">
{% if show_header == 'yes' %} {% if not hero_image and show_header == 'yes' %}
{% include '@components/card/card-elements/_header.twig' with { {% include '@components/card/card-elements/_header.twig' with {
'header': header, 'header': header,
'show_title': show_title, 'show_title': show_title,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment