Skip to content

Commit

Permalink
feat: add banner brand (logo) (#157)
Browse files Browse the repository at this point in the history
* feat: add mobile brand
* feat: fully implement brand
* fix: tablet and desktop logo sizes
  • Loading branch information
greatislander committed Jan 16, 2020
1 parent fd5b17f commit ab756af
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/assets/styles/components/_menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ nav {
.menu {
background: $dark-mint-400;
display: block;
left: 0;
list-style: none;
margin: 0;
padding-left: 0;
padding-top: rem(70);
position: relative;
position: absolute;
width: 100vw;
z-index: 1;

li {
Expand Down Expand Up @@ -220,7 +222,7 @@ nav {

@include breakpoint-up(md) {
nav {
height: rem(109.5);
height: rem(80);
}

.menu-toggle {
Expand All @@ -233,9 +235,10 @@ nav {
display: flex;
flex-direction: row;
float: right;
height: rem(109.5);
height: rem(80);
padding-top: 0;
position: relative;
width: auto;

li {
border-top: 0;
Expand All @@ -252,7 +255,7 @@ nav {
font-size: 1rem;
font-weight: $font-weight-normal;
min-height: 0;
padding: rem(17) rem(16);
padding: rem(26) rem(16);

&::after {
background: transparent;
Expand Down Expand Up @@ -283,7 +286,7 @@ nav {
box-shadow: none;
color: $off-white;
outline: 0;
padding: rem(17) rem(16);
padding: rem(26) rem(16);
}

svg {
Expand Down Expand Up @@ -355,7 +358,7 @@ nav {

.menu__item {
background-color: $white;
padding-left: rem(16);
padding: rem(17) rem(16);

&::after {
display: none;
Expand Down
65 changes: 65 additions & 0 deletions src/assets/styles/layouts/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,50 @@
background-color: $blue-500;
}

[role="banner"] .container {
align-items: center;
display: flex;
flex-direction: row;
flex-wrap: wrap;
}

[role="banner"] .brand {
color: $blue-500;
height: rem(70);
padding: rem(22) rem(12);
width: rem(50);

svg {
height: rem(26);
width: rem(26);
}

&:hover {
color: $black;
}

&:focus,
&:active {
background-color: $blue-500;
color: $off-white;
}
}

.home [role="banner"] .brand {
color: $off-white;

&:hover {
color: $white;
}

&:focus,
&:active {
background-color: $off-white;
color: $blue-500;
outline: 0;
}
}

.page-header {
padding-bottom: rem(100);
padding-top: rem(100);
Expand All @@ -17,6 +61,16 @@
}

@include breakpoint-up(sm) {
[role="banner"] .brand {
padding: rem(20) rem(23);
width: rem(74);

svg {
height: rem(28);
width: rem(28);
}
}

.page-header {
@include grid-column-span(6, 8, 2);

Expand All @@ -29,6 +83,17 @@
[role="banner"] {
padding-left: rem(30);
padding-right: rem(120);

.container {
justify-content: space-between;
}

.brand {
height: rem(80);
margin-left: rem(0);
padding: rem(26);
width: rem(80);
}
}
}

Expand Down
1 change: 1 addition & 0 deletions src/components/02-molecules/00-menu/menu.njk
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% render '@brand' %}
<nav aria-labelledby="menu-primary-label">
<button class="menu-toggle" aria-expanded="false">
{% render '@svg', {svg:'menu', class:'open'}, true %}
Expand Down
8 changes: 8 additions & 0 deletions src/components/02-molecules/_brand/brand.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
title: 'Brand',
status: 'wip',
context: {
title: 'Platform Cooperativism Consortium',
visuallyHiddenTitle: true,
}
};
4 changes: 4 additions & 0 deletions src/components/02-molecules/_brand/brand.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<a href="/" class="brand">
{% render '@svg', {svg: 'pcc', viewBox: '0 0 32 32'}, true %}
<span class="brand__title{% if visuallyHiddenTitle %} screen-reader-text{% endif %}">{{ title }}</span>
</a>

0 comments on commit ab756af

Please sign in to comment.