Skip to content

Commit d4b86d2

Browse files
author
Roni Laukkarinen
committed
Improve nav scss structure to more simpler and straightforward, fix broken dropdowns, site-header simplifying, documentation
1 parent 1d022a2 commit d4b86d2

File tree

9 files changed

+46
-25
lines changed

9 files changed

+46
-25
lines changed

css/global.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @package air
66
*/
77

8-
define( 'AIR_VERSION', '2.4.7' );
8+
define( 'AIR_VERSION', '2.4.8' );
99

1010
/**
1111
* Define SendGrid credentials

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "air",
3-
"version": "2.4.7",
3+
"version": "2.4.8",
44
"description": "A minimalist WordPress starter theme.",
55
"author": "Digitoimisto Dude Oy ([email protected])",
66
"devDependencies": {

sass/base/_config.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,5 @@ $container-desktop: 1200px;
5656
$container-ipad: 770px;
5757
$container-ipad-landscape: 1024px;
5858

59-
// Where navigation transforms into responsive
60-
$responsivenav: 872px;
59+
// Where navigation transforms into responsive - scale your window width down to test
60+
$responsivenav: 780px;

sass/layout/_site-header.scss

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@
1111
left: 0;
1212
width: 100%;
1313
z-index: 1;
14-
padding-top: 20px;
14+
15+
@media(min-width: $responsivenav) {
16+
padding-top: 20px;
17+
}
1518

1619
.container {
1720
padding: 0;
21+
overflow: visible;
1822
}
1923

2024
.site-branding {
@@ -25,6 +29,22 @@
2529
overflow: hidden;
2630
margin: 0;
2731

32+
// The point where logo touches the left side
33+
@media(max-width: $grid-base-size+20) {
34+
margin-left: 10px;
35+
margin-top: 0;
36+
margin-bottom: 0;
37+
margin-right: 0;
38+
}
39+
40+
// The point where navigation turns into mobile nav
41+
@media(max-width: $responsivenav) {
42+
margin-left: 10px;
43+
margin-top: 10px;
44+
margin-bottom: 0;
45+
margin-right: 0;
46+
}
47+
2848
a {
2949
svg {
3050
fill: #fff;
@@ -36,7 +56,7 @@
3656
svg {
3757
fill: $color-fog;
3858
}
39-
}
59+
}
4060
}
4161
}
4262
}

sass/navigation/_nav-desktop.scss

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@
66
// -----------------------------------------------------------
77

88
// Desktop styles for navigation
9-
#nav {
9+
nav {
10+
@media (min-width: $responsivenav) {
11+
// Set based on logo height, for example air logo is about 62px, menu links height are 12px, so paddings are (60/2)-12:
12+
padding-top: 17px;
13+
padding-bottom: 17px;
14+
}
15+
1016
ul {
1117
li {
1218
// Desktop navigation start
@@ -23,7 +29,8 @@
2329
&.focus > ul,
2430
.focus > ul,
2531
ul.toggled {
26-
top: 55px;
32+
// Calculate this with the font size
33+
top: 32px;
2734
left: 38%;
2835
margin-left: -75px;
2936
opacity: 1;
@@ -207,8 +214,8 @@
207214
@media (min-width: $responsivenav) {
208215
.dropdown {
209216
ul {
210-
max-height: 0;
211-
overflow: hidden;
217+
max-height: 9999px;
218+
overflow: visible;
212219

213220
li {
214221
width: 100%;

sass/navigation/_nav-layout.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ nav {
1818
overflow: visible;
1919
float: right;
2020

21-
// Set based on logo height, for example air logo is about 62px, menu links height are 12px, so paddings are (60/2)-12:
22-
padding-top: 17px;
23-
padding-bottom: 17px;
24-
2521
ul {
2622
margin-bottom: 0;
2723
margin-top: 0;

sass/navigation/_nav-mobile.scss

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@
116116
-webkit-tap-highlight-color: rgba(#000, 0);
117117
border: 0;
118118
color: #fff;
119-
font-size: 21px;
120-
font-weight: bold;
119+
font-size: 16px;
120+
font-weight: 700;
121121
-webkit-font-smoothing: antialiased;
122122
-moz-osx-font-smoothing: grayscale;
123123
-webkit-touch-callout: none;
@@ -129,6 +129,8 @@
129129
line-height: 39px;
130130
padding: 0 .75em;
131131
background: transparent;
132+
appearance: button;
133+
cursor: pointer;
132134

133135
span {
134136
color: #fff;
@@ -152,8 +154,8 @@
152154
@media (max-width: ($responsivenav)-1px) {
153155
width: auto;
154156
float: right;
155-
top: 30px;
156-
right: 20px;
157+
top: 22px;
158+
right: 10px;
157159
position: relative;
158160
}
159161

@@ -169,7 +171,3 @@
169171
}
170172
}
171173

172-
button {
173-
appearance: button;
174-
cursor: pointer;
175-
}

style.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Theme URI: https://github.com/digitoimistodude/air
44
Author: Digitoimisto Dude Oy
55
Author URI: https://www.dude.fi
66
Description: A minimalist WordPress starter theme.
7-
Version: 2.4.7
7+
Version: 2.4.8
88
License: GNU General Public License v2 or later
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1010
Text Domain: air
@@ -19,6 +19,6 @@ Tags:
1919
* @link https://github.com/Automattic/_s/commits/master
2020
*
2121
* @author Roni Laukkarinen (https://github.com/ronilaukkarinen), Timi Wahalahti (https://github.com/timiwahalahti)
22-
* @version 11.05.2017
22+
* @version 15.05.2017
2323
* @since 28.01.2016
2424
*/

0 commit comments

Comments
 (0)