Skip to content
This repository has been archived by the owner on Dec 8, 2020. It is now read-only.

Commit

Permalink
Adjustable logo height using variables
Browse files Browse the repository at this point in the history
  • Loading branch information
marapredescu1 committed Nov 27, 2018
1 parent 0188bdc commit 7903e33
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 15 deletions.
28 changes: 22 additions & 6 deletions web/themes/iucn_frontend/assets/css/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web/themes/iucn_frontend/assets/css/style.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/themes/iucn_frontend/assets/css/style.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/themes/iucn_frontend/assets/css/style.min.css.map

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions web/themes/iucn_frontend/less/jumbotron.less
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

.path-frontpage & {
// background-position: center bottom;
height: calc(100vh - 182px);
height: calc(100vh - 182px - @navbar-increase);
margin-bottom: 0;
min-height: 231px;

Expand Down Expand Up @@ -139,19 +139,20 @@
@media (max-width: 767px) {
.jumbotron {
.path-frontpage & {
height: calc(100vh - 239px);
height: calc(100vh - 239px - @navbar-increase);
min-height: 340px;
}

.path-frontpage #sliding-popup ~ & {
height: calc(100vh - 286px);
height: calc(100vh - 286px - @navbar-increase);
}

.path-frontpage.toolbar-fixed & {
height: calc(100vh - 278px);
height: calc(100vh - 278px - @navbar-increase);
}

.path-frontpage.toolbar-fixed.toolbar-tray-open & {
height: calc(100vh - 318px);
height: calc(100vh - 318px - @navbar-increase);
}
}
}
17 changes: 16 additions & 1 deletion web/themes/iucn_frontend/less/navbar.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
margin-right: 20px;
margin-top: 12px;
padding-right: 0;
height: 64px;
height: @navbar-logo-height--mobile;
@media (min-width: 1200px) {
height: @navbar-logo-height;
}
img {
height: 100%;
width: auto;
Expand All @@ -31,3 +34,15 @@
}
}
}

@media (min-width: 1200px) {
.navbar-nav>li>a {
padding-top: (33px + (@navbar-increase / 2));
padding-bottom: (33px + (@navbar-increase / 2));
}
}

.navbar-toggle {
margin-top: (27px + (@navbar-increase--mobile / 2));
margin-bottom: (27px + (@navbar-increase--mobile / 2));
}
6 changes: 6 additions & 0 deletions web/themes/iucn_frontend/less/variables.less
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
@node-modules: "../node_modules";

@navbar-logo-height: 90px;
@navbar-logo-height--mobile: 80px;
// Variable used to increase the site logo height across page components (e.g. jumbotron height, main menu item paddings)
@navbar-increase: (@navbar-logo-height - 64px);
@navbar-increase--mobile: (@navbar-logo-height--mobile - 64px);
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{% extends "block--bare.html.twig" %}
{#
/**
* @file
* Default 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.
*
* @ingroup templates
*/
#}
{% block content %}
{% if site_logo %}
<a class="logo navbar-btn pull-left" href="{{ path('<front>') }}" title="{{ 'Home'|t }}" rel="home">
<img src="{{ site_logo }}" alt="{{ 'Home'|t }}" />
</a>
{% endif %}
{% if site_name %}
<a class="name navbar-brand sr-only" href="{{ path('<front>') }}" title="{{ 'Home'|t }}" rel="home">{{ site_name }}</a>
{% endif %}
{% if site_slogan %}
<p class="navbar-text">{{ site_slogan }}</p>
{% endif %}
{% endblock %}

0 comments on commit 7903e33

Please sign in to comment.