Logo et nom du site
authorFelip Manyer i Ballester <git@res-telae.cat>
Thu, 29 Dec 2016 16:57:14 +0000 (17:57 +0100)
committerFelip Manyer i Ballester <git@res-telae.cat>
Thu, 29 Dec 2016 16:57:14 +0000 (17:57 +0100)
docroot/profiles/fonamental/themes/custom/byrrh/scss/byrrh.scss
docroot/profiles/fonamental/themes/custom/byrrh/scss/components/_site-branding.scss [new file with mode: 0644]
docroot/profiles/fonamental/themes/custom/byrrh/templates/base/block--system-branding-block.html.twig [new file with mode: 0644]

index 6127754..90a4b57 100644 (file)
@@ -40,6 +40,7 @@
 @import "components/field";
 @import "components/block";
 @import "components/account-menu";
+@import "components/site-branding";
 @import "components/primary-menu";
 @import "components/breadcrumb";
 @import "components/search-form";
diff --git a/docroot/profiles/fonamental/themes/custom/byrrh/scss/components/_site-branding.scss b/docroot/profiles/fonamental/themes/custom/byrrh/scss/components/_site-branding.scss
new file mode 100644 (file)
index 0000000..6322adf
--- /dev/null
@@ -0,0 +1,23 @@
+.site-branding {
+  margin: -1em 0 0.8em 2em;
+}
+
+.site-branding__logo {
+  display: inline-block;
+  margin-right: 1em;
+  margin-bottom: 0.286em;
+}
+
+.site-branding__text {
+  display: inline-block;
+  vertical-align: top;
+}
+
+.site-branding__name {
+  font-size: 1.7em;
+}
+
+.site-branding__slogan {
+  margin-top: 7px;
+  font-style: italic;
+}
diff --git a/docroot/profiles/fonamental/themes/custom/byrrh/templates/base/block--system-branding-block.html.twig b/docroot/profiles/fonamental/themes/custom/byrrh/templates/base/block--system-branding-block.html.twig
new file mode 100644 (file)
index 0000000..9bf4f3d
--- /dev/null
@@ -0,0 +1,35 @@
+{% extends "block.html.twig" %}
+{#
+/**
+ * @file
+ * Bartik's theme implementation for a branding block.
+ *
+ * Each branding element variable (logo, name, slogan) is only available if
+ * enabled in the block configuration.
+ *
+ * Available variables:
+ * - site_logo: Logo for site as defined in Appearance or theme settings.
+ * - site_name: Name for site as defined in Site information settings.
+ * - site_slogan: Slogan for site as defined in Site information settings.
+ */
+#}
+{% set attributes = attributes.addClass('site-branding') %}
+{% block content %}
+  {% if site_logo %}
+    <a href="{{ path('<front>') }}" title="{{ 'Home'|t }}" rel="home" class="site-branding__logo">
+      <img src="{{ site_logo }}" alt="{{ 'Home'|t }}" />
+    </a>
+  {% endif %}
+  {% if site_name or site_slogan %}
+    <div class="site-branding__text">
+      {% if site_name %}
+        <div class="site-branding__name">
+          <a href="{{ path('<front>') }}" title="{{ 'Home'|t }}" rel="home">{{ site_name }}</a>
+        </div>
+      {% endif %}
+      {% if site_slogan %}
+        <div class="site-branding__slogan">{{ site_slogan }}</div>
+      {% endif %}
+    </div>
+  {% endif %}
+{% endblock %}