Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial commit for mobile menu support. Should work with every combin… #242

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion header.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@

<div id="page" class="site">
<header id="masthead" class="site-header" role="banner" itemscope itemtype="http://schema.org/WPHeader">

<input id="mobile-menu-icon" type="checkbox" />
<label for="mobile-menu-icon"></label>
<div id="site-header-info-mobile">
<?php independent_publisher_site_info(); ?>
</div>
<div class="site-header-info">
<?php if ( is_single() ) : ?>
<?php // Show only post author info on Single Pages ?>
Expand Down
117 changes: 85 additions & 32 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1639,6 +1639,29 @@ body {
text-decoration: none;
}

#site-header-info-mobile {
display: none;
}

#mobile-menu-icon {
position:absolute;
left:-999em;
}

#mobile-menu-icon + label:before {
font-family: 'Genericons';
display: none;
font-size: 16px;
-webkit-font-smoothing: antialiased;
float: right;
content: '\f419';
margin-top: 3px;
}

#mobile-menu-icon:checked + label:before {
content: '\f406';
}

.main-navigation ul,
.widget-area ul,
.widget-area ol {
Expand Down Expand Up @@ -2690,7 +2713,7 @@ table th {
.page article {
padding: 0 0 40px 0;
}

.main-navigation {
clear: none;
}
Expand Down Expand Up @@ -2761,6 +2784,11 @@ table th {
text-align: left;
}

.single-column-layout #masthead .site-title,
#masthead .site-title {
font-size: 24px;
}

.site-main article.sticky {
padding-right: 20px;
padding-left: 20px;
Expand All @@ -2773,49 +2801,47 @@ table th {
margin-top: 20px;
}

#masthead .site-title,
.single-column-layout #masthead .site-title {
padding-top: 0;
font-size: 24px;
}

.site-header-info,
.site-master-logo,
#masthead .site-logo {
float: right;
margin-right: 0;
}

#masthead .site-logo img,
.single-column-layout #masthead .site-logo img {
max-width: 70px;
margin-right: 0;
}

#masthead .site-title,
#masthead .site-description,
.single-column-layout #masthead .site-title,
.single-column-layout #masthead .site-description {
margin-left: 0;
}

#masthead .site-description,
.single-column-layout #masthead .site-description {
margin-bottom: 10px;
display: none;
}

#menu-social {
clear: both;
display: none;
}

#menu-social ul,
.single-column-layout #menu-social ul {
margin-left: 0;
}

#masthead .site-navigation {
margin-left: -10px;
padding-bottom: 20px;
#mobile-menu-icon + label:before {
display: block;
}

#site-header-info-mobile {
display: block;
}

#masthead .menu-header-container,
#masthead .menu-nav-container {
display: none;
margin-bottom: 1em;
}

#mobile-menu-icon:checked ~ nav .menu-header-container,
#mobile-menu-icon:checked ~ nav .menu-nav-container,
#mobile-menu-icon:checked ~ #site-header-info-mobile #menu-social {
display:block;
}

#masthead .site-navigation {
padding-bottom: 0;
margin-bottom: 0;
}

#menu-social ul,
.single-column-layout #menu-social ul {
text-align: left;
Expand All @@ -2831,8 +2857,10 @@ table th {
}

#masthead .main-navigation li {
padding-top: 0;
padding-bottom: 0;
padding: 4px 0 4px 0;
display: block;
width: 100%;
text-align: center;
}

.site-navigation button,
Expand All @@ -2841,6 +2869,10 @@ table th {
padding-right: 10px;
}

.single .wp-post-image {
margin-top: 1em;
}

.single .wp-post-image,
.page .wp-post-image,
.blog .wp-post-image,
Expand Down Expand Up @@ -2922,6 +2954,10 @@ table th {
.post-author-card .site-description {
padding-left: 0;
}

#masthead .site-description {
margin-bottom: 10px;
}

.format-aside .entry-content,
.format-quote .entry-content {
Expand Down Expand Up @@ -2968,6 +3004,10 @@ table th {
width: 100%;
}

.single .entry-header {
margin-top: 1em;
}

.entry-header {
word-wrap: normal;
hyphens: none;
Expand Down Expand Up @@ -3040,4 +3080,17 @@ table th {
.post-excerpts h1.entry-title, .enhanced-excerpts h1.entry-title {
font-size: 1.5em;
}

.archive .page-header, .search .page-header {
margin-top: 1em;
}

.full-width-featured-image.single-column-layout.single .wp-post-image, .full-width-featured-image.single-column-layout.page .wp-post-image,
.full-width-featured-image.single-column-layout.blog .wp-post-image, .full-width-featured-image.single-column-layout.archive .wp-post-image {
margin-top: 0;
}

.full-width-featured-image.single .wp-post-image, .full-width-featured-image.page .wp-post-image, .full-width-featured-image.blog .wp-post-image, .full-width-featured-image.archive .wp-post-image {
margin-top: 0;
}
}