started home styling

This commit is contained in:
2019-07-15 18:44:03 +02:00
parent d84750ef8f
commit cb3eb2c2fa
19 changed files with 1067 additions and 34 deletions

View File

@@ -1245,6 +1245,62 @@ header[role="banner"] {
aside.messages {
padding: 0; }
article.node--type-frontpage .node__content > section {
padding: 1em; }
article.node--type-frontpage .node__content > section.home-intro {
padding: 0;
background-color: #fff; }
article.node--type-frontpage .node__content > section.home-database {
background-color: #69cdcf;
display: grid;
grid-template-columns: 300px 1fr;
grid-column-gap: 1em;
color: #fff; }
article.node--type-frontpage .node__content > section.home-database .field--name-field-a-database {
grid-column: 1; }
article.node--type-frontpage .node__content > section.home-database .cards-list-home {
grid-column: 2;
position: relative;
max-height: 580px;
overflow-y: hidden; }
article.node--type-frontpage .node__content > section.home-database .cards-list-home ul {
width: 100%;
margin: 0;
padding: 0;
display: grid;
justify-content: center;
grid-template-columns: repeat(auto-fill, minmax(50px, 130px));
grid-template-rows: 1fr;
grid-gap: 1em; }
article.node--type-frontpage .node__content > section.home-database .cards-list-home ul li {
position: relative;
list-style: none;
margin: 0;
padding: 0;
padding-top: 140%; }
article.node--type-frontpage .node__content > section.home-database .cards-list-home ul li .card {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
width: auto;
height: auto; }
article.node--type-frontpage .node__content > section.home-database .cards-list-home ul li .card .field--name-field-short-description {
font-size: 0.756em;
line-height: 0.9; }
article.node--type-frontpage .node__content > section.home-showrooms {
background-color: #50aa3c;
display: grid;
grid-template-columns: 300px 1fr;
grid-column-gap: 1em; }
article.node--type-frontpage .node__content > section.home-showrooms .field--name-field-showrooms {
grid-column: 1; }
article.node--type-frontpage .node__content > section.home-showrooms .field--name-computed-showrooms-reference {
grid-column: 2; }
article.node--type-frontpage .node__content > section.home-blabla {
background-color: #9458aa; }
article.node--type-frontpage .node__content .field--name-field-what-is-materio:not(:nth-child(1)),
article.node--type-frontpage .node__content .field--name-field-a-database:not(:nth-child(1)),
article.node--type-frontpage .node__content .field--name-field-showrooms:not(:nth-child(1)),
@@ -1300,9 +1356,9 @@ article.node--type-frontpage .node__content .field--name-computed-articles-refer
article.card {
position: relative;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
width: 210px;
height: 295px;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.2); }
height: 295px; }
article.card header {
position: absolute;
bottom: 0;

View File

@@ -252,6 +252,83 @@ aside.messages{
// front
article.node--type-frontpage{
.node__content{
&>section{
padding:1em;
&.home-intro{
padding:0;
background-color: #fff;
}
&.home-database{
background-color: #69cdcf;
display:grid;
// $c: 300px;
// grid-template-columns: $c calc(100% - #{$c});
grid-template-columns: 300px 1fr;
grid-column-gap: 1em;
// grid-template-rows: min-content;
color: #fff;
.field--name-field-a-database{
grid-column: 1;
// outline: 1px solid green;
}
.cards-list-home{
grid-column: 2;
position: relative;
// max-height: (130px*1.4)*3;
max-height: 580px;
overflow-y: hidden;
ul{
width:100%;
margin:0; padding:0;
display: grid;
justify-content: center;
grid-template-columns: repeat(auto-fill, minmax(50px, 130px));
grid-template-rows: 1fr;
grid-gap: 1em;
// justify-content:start;
li{
position: relative;
list-style: none;
margin:0; padding:0;
padding-top: 140%;
.card{
position:absolute;
top:0; bottom:0;
left:0; right:0;
width: auto;
height: auto;
.field--name-field-short-description{
font-size: 0.756em;
line-height: 0.9;
}
}
}
}
}
}
&.home-showrooms{
background-color: #50aa3c;
display:grid;
// $c: 300px;
// grid-template-columns: $c calc(100% - #{$c});
grid-template-columns: 300px 1fr;
grid-column-gap: 1em;
.field--name-field-showrooms{
grid-column: 1;
}
.field--name-computed-showrooms-reference{
grid-column: 2;
}
}
&.home-blabla{
background-color: #9458aa;
}
&.home-pricing{
}
}
.field--name-field-what-is-materio,
.field--name-field-a-database,
.field--name-field-showrooms,
@@ -283,6 +360,7 @@ article.node--type-frontpage{
}
}
}
}
}
@@ -325,8 +403,11 @@ article.node--type-frontpage{
article.card{
position: relative;
width:$column_width; height:295px;
box-shadow: 0 0 5px rgba(0,0,0,0.2);
width:$column_width; height:295px;
// &.card-small{
// width:100px; height:140px;
// }
// focused
// box-shadow: 0 0 7px rgba(0,0,0,0.9);
header{

View File

@@ -43,7 +43,7 @@
label_display == 'visually_hidden' ? 'visually-hidden',
]
%}
<div class="cards-list">
<div class="cards-list-home">
{% if label_hidden %}
<ul{{ attributes }}>
{% for item in items %}
@@ -64,4 +64,4 @@
{% endif %}
</div>
{% endif %}
</div>
</div>

View File

@@ -72,11 +72,22 @@
* @ingroup themeable
*/
#}
<article{{ attributes.addClass('card') }}>
{%
set classes = [
'node',
'node--type-' ~ node.bundle|clean_class,
node.isPromoted() ? 'node--promoted',
node.isSticky() ? 'node--sticky',
not node.isPublished() ? 'node--unpublished',
view_mode ? view_mode|clean_class,
view_mode ? 'node--view-mode-' ~ view_mode|clean_class,
'card'
]
%}
<article{{ attributes.addClass(classes) }}>
<header>
<h1>{{ label }}</h1>
<!-- <h4>{{ content.field_description }}</h4>
<span class="ref">{{ content.field_reference }}</span> -->
{{ content.field_short_description }}
</header>
<section class="images">
{{ content.field_materiau_images }}

View File

@@ -0,0 +1,98 @@
{#
/**
* @file
* Default theme implementation to display a node.
*
* Available variables:
* - node: The node entity with limited access to object properties and methods.
* Only method names starting with "get", "has", or "is" and a few common
* methods such as "id", "label", and "bundle" are available. For example:
* - node.getCreatedTime() will return the node creation timestamp.
* - node.hasField('field_example') returns TRUE if the node bundle includes
* field_example. (This does not indicate the presence of a value in this
* field.)
* - node.isPublished() will return whether the node is published or not.
* Calling other methods, such as node.delete(), will result in an exception.
* See \Drupal\node\Entity\Node for a full list of public properties and
* methods for the node object.
* - label: (optional) The title of the node.
* - content: All node items. Use {{ content }} to print them all,
* or print a subset such as {{ content.field_example }}. Use
* {{ content|without('field_example') }} to temporarily suppress the printing
* of a given child element.
* - author_picture: The node author user entity, rendered using the "compact"
* view mode.
* - metadata: Metadata for this node.
* - date: (optional) Themed creation date field.
* - author_name: (optional) Themed author name field.
* - url: Direct URL of the current node.
* - display_submitted: Whether submission information should be displayed.
* - attributes: HTML attributes for the containing element.
* The attributes.class element may contain one or more of the following
* classes:
* - node: The current template type (also known as a "theming hook").
* - node--type-[type]: The current node type. For example, if the node is an
* "Article" it would result in "node--type-article". Note that the machine
* name will often be in a short form of the human readable label.
* - node--view-mode-[view_mode]: The View Mode of the node; for example, a
* teaser would result in: "node--view-mode-teaser", and
* full: "node--view-mode-full".
* The following are controlled through the node publishing options.
* - node--promoted: Appears on nodes promoted to the front page.
* - node--sticky: Appears on nodes ordered above other non-sticky nodes in
* teaser listings.
* - node--unpublished: Appears on unpublished nodes visible only to site
* admins.
* - title_attributes: Same as attributes, except applied to the main title
* tag that appears in the template.
* - content_attributes: Same as attributes, except applied to the main
* content tag that appears in the template.
* - author_attributes: Same as attributes, except applied to the author of
* the node tag that appears in the template.
* - title_prefix: Additional output populated by modules, intended to be
* displayed in front of the main title tag that appears in the template.
* - title_suffix: Additional output populated by modules, intended to be
* displayed after the main title tag that appears in the template.
* - view_mode: View mode; for example, "teaser" or "full".
* - teaser: Flag for the teaser state. Will be true if view_mode is 'teaser'.
* - page: Flag for the full page state. Will be true if view_mode is 'full'.
* - readmore: Flag for more state. Will be true if the teaser content of the
* node cannot hold the main body content.
* - logged_in: Flag for authenticated user status. Will be true when the
* current user is a logged-in member.
* - is_admin: Flag for admin user status. Will be true when the current user
* is an administrator.
*
* @see template_preprocess_node()
*
* @todo Remove the id attribute (or make it a class), because if that gets
* rendered twice on a page this is invalid CSS for example: two lists
* in different view modes.
*
* @ingroup themeable
*/
#}
{%
set classes = [
'node',
'node--type-' ~ node.bundle|clean_class,
node.isPromoted() ? 'node--promoted',
node.isSticky() ? 'node--sticky',
not node.isPublished() ? 'node--unpublished',
view_mode ? view_mode|clean_class,
view_mode ? 'node--view-mode-' ~ view_mode|clean_class,
'card'
]
%}
<article{{ attributes.addClass(classes) }}>
<header>
{# <h1>{{ label }}</h1> #}
<h2>{{ content.field_familly }}</h2>
<h4>{{ content.field_short_description }}</h4>
{# <span class="ref">{{ content.field_reference }}</span> #}
</header>
<section class="images">
{{ content.field_materiau_images }}
</section>
</article>