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

Hotfix/hotfix 030119 general cleanup #470

Merged
merged 17 commits into from
Mar 1, 2019
Merged
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
5 changes: 5 additions & 0 deletions assets/sass/modules/content-blocks/_carousel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
$slide-height: rem(500);

.carousel-block {

// Removes padding.
&.content-block {
@include padding(0 null);
} // &.content-block

// Arbitrary <div> inserted by Slick.
.slick-slide div {
Expand Down
17 changes: 15 additions & 2 deletions assets/sass/modules/content-blocks/_global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Global Content Block Styles
//--------------------------------------------------------------
.content-block {
@include margin(null null $gutter * 2 null);
@include padding($gutter * 2 null);

// Content Block titles.
&-title {
Expand All @@ -14,9 +14,10 @@
} // .content-block-title

&.has-background {
@include padding($gutter * 2 null);
@include margin(0 auto);

&.container-width {
@include margin($gutter * 2 auto);
@include padding($gutter * 2 0);

@include media($container-offset) {
Expand All @@ -25,6 +26,18 @@
} // &.container-width.
} // &.has-background

// Remove the extra padding on nested no-background blocks.
&.no-background,
jomurgel marked this conversation as resolved.
Show resolved Hide resolved
&.no-background.container-width,
&.has-background.container-width {

// Remove padding from nth no-background block.
& + .no-background,
& + .no-background.container-width {
padding-top: 0;
} // & + .no-background
} // &.no-background

// Make sure videos stay in their containers.
&.video-as-background {
overflow: hidden;
Expand Down
12 changes: 12 additions & 0 deletions assets/sass/modules/content-blocks/_posts.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//--------------------------------------------------------------
// Related and Recent Posts Blocks
//--------------------------------------------------------------


//-----------------------------------------
// Shared
//-----------------------------------------
.recent-posts-block,
.related-posts-block {
padding-bottom: 0;
} // .recent-posts-block, .related-posts-block
5 changes: 3 additions & 2 deletions assets/sass/modules/content-blocks/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
// ACF Content Blocks
//--------------------------------------------------------------

@import 'accordion';
@import 'call-to-action';
@import 'carousel';
@import 'global';
@import 'hero';
@import 'carousel';
@import 'accordion';
@import 'posts';
4 changes: 4 additions & 0 deletions assets/sass/structure/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
@include margin($gutter * 2 auto);

max-width: $container;

&.container-width {
@include margin(0 auto);
} // &.container-width
} // > *:not(.full-width)

// Post elements.
Expand Down
21 changes: 21 additions & 0 deletions inc/acf.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,3 +405,24 @@ function _s_get_theme_colors() {
esc_html__( 'Whitesmoke', '_s' ) => '#f1f1f1',
);
}

/**
* Adds h1 or h2 heading for hero based on location.
*
* @param string $title acf value.
* @author jomurgel <jo@webdevstudios.com>
* @return void
*/
function _s_display_hero_heading( $title ) {

// Bail if our title is empty.
if ( empty( $title ) ) {
return;
}

// Set hero title to h1 if it's the first block not on the homepage.
$index = get_row_index();
$heading = 1 === $index && ! ( is_front_page() && is_home() ) ? 'h1' : 'h2';

echo sprintf( '<%1$s class="hero-title">%2$s</%1$s>', esc_attr( $heading ), esc_html( $title ) );
}
Loading