Skip to content

Commit

Permalink
Accomodate Nova Blocks 1.6.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
madalingorbanescu committed Oct 6, 2020
1 parent ff7b5c4 commit 4eb9105
Show file tree
Hide file tree
Showing 13 changed files with 358 additions and 5 deletions.
3 changes: 3 additions & 0 deletions assets/scss/blocks/nova-blocks/_editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@

// Nova - Slideshow
@import "slideshow/editor";

// Nova - Navigation
@import "navigation/editor";
7 changes: 6 additions & 1 deletion assets/scss/blocks/nova-blocks/_frontend.scss
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@
// Nova - Media
@import "media/style";


// Nova - Slideshow
@import "slideshow/style";

// Nova - Navigation
@import "navigation/style";

// Nova - Header
@import "header/style";
66 changes: 66 additions & 0 deletions assets/scss/blocks/nova-blocks/header/_editor.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
[data-type="novablocks/header"][class] {
.editor-block-list__layout,
.block-editor-block-list__layout {
display: grid;
align-items: center;
grid-gap: 1em;

.wp-block {
margin: 0;
max-width: 100%;
}

> :last-child {
justify-content: flex-end;
}

.wp-block {
margin-top: 0 !important;
}
}
}

.site-header-logo-center {
.editor-block-list__layout,
.block-editor-block-list__layout {
grid-template-columns: 1fr auto 1fr;
}
}

.site-header-logo-left {
.editor-block-list__layout,
.block-editor-block-list__layout {
grid-template-columns: auto 1fr;
}
}


.wp-block[data-type="novablocks/navigation"] {
display: flex;
}

.wp-block[data-type="novablocks/logo"] {
a {
color: var(--current-dark-primary);
}

.site-title,
.site-description {
margin-top: 0;
margin-bottom: 0;
}
}

.c-logo__inverted {
display: none;
}

.wp-block-novablocks-navigation ul.menu > li,
.wp-block-novablocks-navigation .menu > ul > li {
margin-left: 0;
}

.site-header > div:first-child {
padding-left: var(--theme-header-sides-spacing);
padding-right: var(--theme-header-sides-spacing);
}
11 changes: 11 additions & 0 deletions assets/scss/blocks/nova-blocks/header/_style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@media only screen and (min-width: 1000px) {

.site-header {

ul.menu,
.menu > ul {
display: flex;
flex-wrap: wrap;
}
}
}
9 changes: 9 additions & 0 deletions assets/scss/blocks/nova-blocks/navigation/_editor.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.wp-block[data-type="novablocks/navigation"] {
ul.menu a {
display: flex;
}
}

.menu {
padding-top: 0;
}
63 changes: 63 additions & 0 deletions assets/scss/blocks/nova-blocks/navigation/_style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
.wp-block-novablocks-navigation {
@include apply-font(navigation);
}

.wp-block-novablocks-navigation[class] {

@include above(lap) {

--header-links-bottom-spacing: .5em;

ul.menu,
.menu > ul {

margin-left: calc( var(--theme-header-links-spacing) * -1 );

a {
display: block;
padding: 0.75em 0;
color: inherit;
text-decoration: none;
}

> li {
margin-left: var(--theme-header-links-spacing);
}

.customize-partial-edit-shortcut + > li:not(:first-child) {
margin-left: 0;
}

> li > a {
padding-bottom: 0.25em;
margin-bottom: var(--header-links-bottom-spacing);

&:after {
position: absolute;
right: 0;
}
}

li:hover {

> a {
border-color: currentColor;

&:after {
opacity: 1;
}
}
}
}

.sub-menu,
.children {

li a {
border: 0;
padding-left: 1.25em;
padding-right: 1.25em;
}
}
}
}
2 changes: 1 addition & 1 deletion assets/scss/components/site-header/_menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ ul.menu,
&:before {
content: '';
position: absolute;
bottom: .5em; // Margin bottom applied on header links
bottom: .2em; // Margin bottom applied on header links
height: 3px;
background: currentColor;
transition: transform .4s $ease;
Expand Down
60 changes: 60 additions & 0 deletions blocks.css
Original file line number Diff line number Diff line change
Expand Up @@ -1806,6 +1806,66 @@ html:root {
-webkit-transform: none;
transform: none; }

.wp-block-novablocks-navigation {
font-family: var(--current-font-family);
font-size: var(--current-font-size);
line-height: var(--current-line-height);
font-weight: var(--current-font-weight);
letter-spacing: var(--current-letter-spacing);
text-transform: var(--current-text-transform);
text-decoration: var(--current-text-decoration);
--current-font-family: var(--theme-navigation-font-family);
--current-font-size: var(--theme-navigation-final-font-size);
--current-line-height: var(--theme-navigation-line-height);
--current-font-weight: var(--theme-navigation-font-weight);
--current-letter-spacing: var(--theme-navigation-letter-spacing);
--current-text-transform: var(--theme-navigation-text-transform);
--current-text-decoration: var(--theme-navigation-text-decoration); }

@media only screen and (min-width: 1000px) {
.wp-block-novablocks-navigation[class] {
--header-links-bottom-spacing: .5em; }
.wp-block-novablocks-navigation[class] ul.menu,
.wp-block-novablocks-navigation[class] .menu > ul {
margin-left: calc( var(--theme-header-links-spacing) * -1); }
.wp-block-novablocks-navigation[class] ul.menu a,
.wp-block-novablocks-navigation[class] .menu > ul a {
display: block;
padding: 0.75em 0;
color: inherit;
text-decoration: none; }
.wp-block-novablocks-navigation[class] ul.menu > li,
.wp-block-novablocks-navigation[class] .menu > ul > li {
margin-left: var(--theme-header-links-spacing); }
.wp-block-novablocks-navigation[class] ul.menu .customize-partial-edit-shortcut + > li:not(:first-child),
.wp-block-novablocks-navigation[class] .menu > ul .customize-partial-edit-shortcut + > li:not(:first-child) {
margin-left: 0; }
.wp-block-novablocks-navigation[class] ul.menu > li > a,
.wp-block-novablocks-navigation[class] .menu > ul > li > a {
padding-bottom: 0.25em;
margin-bottom: var(--header-links-bottom-spacing); }
.wp-block-novablocks-navigation[class] ul.menu > li > a:after,
.wp-block-novablocks-navigation[class] .menu > ul > li > a:after {
position: absolute;
right: 0; }
.wp-block-novablocks-navigation[class] ul.menu li:hover > a,
.wp-block-novablocks-navigation[class] .menu > ul li:hover > a {
border-color: currentColor; }
.wp-block-novablocks-navigation[class] ul.menu li:hover > a:after,
.wp-block-novablocks-navigation[class] .menu > ul li:hover > a:after {
opacity: 1; }
.wp-block-novablocks-navigation[class] .sub-menu li a,
.wp-block-novablocks-navigation[class] .children li a {
border: 0;
padding-left: 1.25em;
padding-right: 1.25em; } }

@media only screen and (min-width: 1000px) {
.site-header ul.menu,
.site-header .menu > ul {
display: flex;
flex-wrap: wrap; } }

.wp-block-quote,
.wp-block-pullquote {
font-family: var(--current-font-family);
Expand Down
4 changes: 4 additions & 0 deletions editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -1577,6 +1577,10 @@
margin-top: 0;
-webkit-transform: none;
transform: none; }
.editor-styles-wrapper .wp-block[data-type="novablocks/navigation"] ul.menu a {
display: flex; }
.editor-styles-wrapper .menu {
padding-top: 0; }
.editor-styles-wrapper .wp-block-quote,
.editor-styles-wrapper .wp-block-pullquote {
font-family: var(--current-font-family);
Expand Down
2 changes: 1 addition & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ function rosa2_lite_scripts() {
/* Default Google Fonts */
wp_enqueue_style( 'rosa2-lite-google-fonts', rosa2_lite_google_fonts_url() );

if ( ! in_array( 'nova-blocks/nova-blocks.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
if ( rosa2_lite_should_enqueue_novablocks_fallbacks() ) {
wp_enqueue_style( 'rosa2-novablocks-fallback-style', get_template_directory_uri() . '/novablocks-fallback.css', array(), $theme->get( 'Version' ) );
}

Expand Down
12 changes: 12 additions & 0 deletions inc/extras.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,15 @@ function rosa2_lite_custom_gutenberg_settings() {
}

add_action( 'after_setup_theme', 'rosa2_lite_custom_gutenberg_settings', 10 );

function rosa2_lite_should_enqueue_novablocks_fallbacks() {
if ( ! in_array( 'nova-blocks/nova-blocks.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
return true;
}

if( is_home() && ! wp_style_is('novablocks/media-style', 'enqueued')) {
return true;
}

return false;
}
62 changes: 61 additions & 1 deletion style-rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -1504,7 +1504,7 @@ ul.menu,
.site-header .site-header__menu > .menu > ul li a:before {
content: '';
position: absolute;
bottom: .5em;
bottom: .2em;
height: 3px;
background: currentColor;
transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
Expand Down Expand Up @@ -4671,6 +4671,66 @@ html:root {
-webkit-transform: none;
transform: none; }

.wp-block-novablocks-navigation {
font-family: var(--current-font-family);
font-size: var(--current-font-size);
line-height: var(--current-line-height);
font-weight: var(--current-font-weight);
letter-spacing: var(--current-letter-spacing);
text-transform: var(--current-text-transform);
text-decoration: var(--current-text-decoration);
--current-font-family: var(--theme-navigation-font-family);
--current-font-size: var(--theme-navigation-final-font-size);
--current-line-height: var(--theme-navigation-line-height);
--current-font-weight: var(--theme-navigation-font-weight);
--current-letter-spacing: var(--theme-navigation-letter-spacing);
--current-text-transform: var(--theme-navigation-text-transform);
--current-text-decoration: var(--theme-navigation-text-decoration); }

@media only screen and (min-width: 1000px) {
.wp-block-novablocks-navigation[class] {
--header-links-bottom-spacing: .5em; }
.wp-block-novablocks-navigation[class] ul.menu,
.wp-block-novablocks-navigation[class] .menu > ul {
margin-right: calc( var(--theme-header-links-spacing) * -1); }
.wp-block-novablocks-navigation[class] ul.menu a,
.wp-block-novablocks-navigation[class] .menu > ul a {
display: block;
padding: 0.75em 0;
color: inherit;
text-decoration: none; }
.wp-block-novablocks-navigation[class] ul.menu > li,
.wp-block-novablocks-navigation[class] .menu > ul > li {
margin-right: var(--theme-header-links-spacing); }
.wp-block-novablocks-navigation[class] ul.menu .customize-partial-edit-shortcut + > li:not(:first-child),
.wp-block-novablocks-navigation[class] .menu > ul .customize-partial-edit-shortcut + > li:not(:first-child) {
margin-right: 0; }
.wp-block-novablocks-navigation[class] ul.menu > li > a,
.wp-block-novablocks-navigation[class] .menu > ul > li > a {
padding-bottom: 0.25em;
margin-bottom: var(--header-links-bottom-spacing); }
.wp-block-novablocks-navigation[class] ul.menu > li > a:after,
.wp-block-novablocks-navigation[class] .menu > ul > li > a:after {
position: absolute;
left: 0; }
.wp-block-novablocks-navigation[class] ul.menu li:hover > a,
.wp-block-novablocks-navigation[class] .menu > ul li:hover > a {
border-color: currentColor; }
.wp-block-novablocks-navigation[class] ul.menu li:hover > a:after,
.wp-block-novablocks-navigation[class] .menu > ul li:hover > a:after {
opacity: 1; }
.wp-block-novablocks-navigation[class] .sub-menu li a,
.wp-block-novablocks-navigation[class] .children li a {
border: 0;
padding-right: 1.25em;
padding-left: 1.25em; } }

@media only screen and (min-width: 1000px) {
.site-header ul.menu,
.site-header .menu > ul {
display: flex;
flex-wrap: wrap; } }

.wp-block-quote,
.wp-block-pullquote {
font-family: var(--current-font-family);
Expand Down
Loading

0 comments on commit 4eb9105

Please sign in to comment.