Skip to content

Commit

Permalink
Custom sub menus (#768)
Browse files Browse the repository at this point in the history
* custom sub menu support

* update versions for beta1

* fix UL / LI in custom sub menus

* fix menu styles

* update version for beta2

* add % based sub-menu sizing

* fix offsets on sub-menus

* adjust footer submenus to open upwards

* add mobile rules

* update versions for RC

* fix UL styling within mega menus

* Fix Button Padding

* prevent sticky headers from going off screen

* fix weforms not loading

* fix sub menu background color

* fix line height in mega menu items

* update styles

* update versions for RC

* adjust z-indexing

* remove resizing of menus

* remove extra padding on links

* fix megamenu links turning into buttons

* fix padding on megamenu links

* update rc3 version number

* update color-classes.scss

* update color-classes.scss

* fix venetian overlays

* final changes before merge
  • Loading branch information
jamesros161 authored Dec 7, 2022
1 parent 03185a4 commit 4c13001
Show file tree
Hide file tree
Showing 21 changed files with 326 additions and 198 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ user guide for more information.

## Changelog ##

### 2.18.0 ###
* New Feature: Support for Crio Premium's MegaMenus feature.

### 2.17.3 ###
* Update: Updated WooCommerce templates used by Crio [#148](https://github.com/BoldGrid/prime/issues/148)
* Update: Add additional filters to support and upsell URLs.
Expand Down
7 changes: 2 additions & 5 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,6 @@ gulp.task('scssDeps', function () {
.pipe(replace("background: linear-gradient(top,", "background: linear-gradient("))
.pipe(gulp.dest(config.dist + '/assets/scss/buttons'));

gulp.src(config.node_modules + '/smartmenus/dist/css/sm-core-css.css')
.pipe(gulp.dest(config.dist + '/assets/css/smartmenus'));

// boldgrid-components.
gulp.src('./node_modules/@boldgrid/components/dist/css/components.*')
.pipe(gulp.dest(config.dist + '/assets/css'));
Expand Down Expand Up @@ -482,7 +479,7 @@ gulp.task('hovers', function() {
digestType: 'base32',
maxLength: 0,
outputName: 'hover1',
classnameFormat: '[classname] a:not( .button-primary):not( .button-secondary )',
classnameFormat: '[classname] > a:not( .button-primary):not( .button-secondary )',
type: '.json'
})
];
Expand All @@ -503,7 +500,7 @@ gulp.task('hoverColors', function() {
digestType: 'base32',
maxLength: 0,
outputName: 'hover2',
classnameFormat: '[classname]:not( .button-primary):not( .button-secondary ) a',
classnameFormat: '[classname]:not( .button-primary):not( .button-secondary ) > a',
type: '.json'
}),
require('postcss-prefix-selector')({ prefix: '%1$s' })
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "boldgrid-theme-framework",
"version": "2.17.3",
"version": "2.18.0",
"description": "BoldGrid Theme Framework",
"main": "index.js",
"engines": {
Expand Down
36 changes: 27 additions & 9 deletions src/assets/js/customizer/color/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,9 @@ export class Preview {
getSubActiveLinkColor( to, menuId ) {
const color = new PaletteSelector().getColor( to );
let css = `
#${menuId} ul > .current-menu-item > a:not( .btn ),
#${menuId} ul > .current-menu-ancestor > a:not( .btn ),
#${menuId} ul > .current-menu-parent > a:not( .btn ) {
#${menuId} ul.sub-menu > .current-menu-item > a:not( .btn ),
#${menuId} ul.sub-menu > .current-menu-ancestor > a:not( .btn ),
#${menuId} ul.sub-menu > .current-menu-parent > a:not( .btn ) {
color: ${color};
}`;

Expand Down Expand Up @@ -434,10 +434,28 @@ export class Preview {
}

css += '@media (min-width: 768px) {';
css += `#${location}-menu.sm-clean ul {background-color: ${subcolorVariable};}`;
css += `#${location}-menu.sm-clean ul a, #${location}-menu.sm-clean ul a:hover, #${location}-menu.sm-clean ul a:focus, #${location}-menu.sm-clean ul a:active, #${location}-menu.sm-clean ul a.highlighted, #${location}-menu.sm-clean span.scroll-up, #${location}-menu.sm-clean span.scroll-down, #${location}-menu.sm-clean span.scroll-up:hover, #${location}-menu.sm-clean span.scroll-down:hover {background-color: ${subcolorVariable};}`;
css += `#${location}-menu.sm-clean ul { border: 1px solid ${subcolorVariable};}`;
css += `#${location}-menu.sm-clean > li > ul:before, #${location}-menu.sm-clean > li > ul:after { border-color: transparent transparent ${subcolorVariable} transparent;}`;
css += `#${location}-menu.sm-clean ul.sub-menu:not(.custom-sub-menu) {background-color: ${subcolorVariable};}`;
css += `#${location}-menu.sm-clean ul.sub-menu:not(.custom-sub-menu) li.menu-item:not(.custom-sub-menu) > a,
#${location}-menu.sm-clean ul.sub-menu:not(.custom-sub-menu) li.menu-item:not(.custom-sub-menu) > a:hover,
#${location}-menu.sm-clean ul.sub-menu:not(.custom-sub-menu) li.menu-item:not(.custom-sub-menu) > a:focus,
#${location}-menu.sm-clean ul.sub-menu:not(.custom-sub-menu) li.menu-item:not(.custom-sub-menu) > a:active,
#${location}-menu.sm-clean ul.sub-menu:not(.custom-sub-menu) li.menu-item:not(.custom-sub-menu) > a.highlighted,
#${location}-menu.sm-clean span.scroll-up,
#${location}-menu.sm-clean span.scroll-down,
#${location}-menu.sm-clean span.scroll-up:hover,
#${location}-menu.sm-clean span.scroll-down:hover {
background-color: ${subcolorVariable};
}`;
css += `#${location}-menu.sm-clean ul.sub-menu:not(.custom-sub-menu) {
border: 1px solid ${subcolorVariable};
}`;
css += `#${location}-menu.sm-clean > li.menu-item:not( .custom-sub-menu ) > ul.sub-menu:not(.custom-sub-menu):before,
#${location}-menu.sm-clean > li.menu-item:not( .custom-sub-menu ) > ul.sub-menu:not(.custom-sub-menu):after {
border-color: transparent transparent ${subcolorVariable} transparent;
}
#${location}-menu.sm-clean > li.menu-item:not( .custom-sub-menu ) > ul.sub-menu.pointer-bottom:not(.custom-sub-menu):after {
border-color: ${subcolorVariable} transparent transparent transparent;
}`;
css += '}';

return css;
Expand Down Expand Up @@ -562,7 +580,7 @@ export class Preview {
},
{
name: `bgtfw_menu_items_border_color_${location}`,
selector: `#${menuId} > li`,
selector: `#${menuId} > li.menu-item`,
properties: [ 'border-color' ]
},
{
Expand All @@ -572,7 +590,7 @@ export class Preview {
},
{
name: `bgtfw_menu_submenu_background_${location}`,
selector: `#${menuId} ul`,
selector: `#${menuId} ul.sub-menu:not(.custom-sub-menu)`,
properties: [ 'background-color' ]
},
{
Expand Down
6 changes: 6 additions & 0 deletions src/assets/js/customizer/widget-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ BOLDGRID.CUSTOMIZER = BOLDGRID.CUSTOMIZER || {};
};

var create_sections_selector = function() {
var widgets = wp.customize.panel( 'widgets' );

if ( 'undefined' === typeof widgets ) {
return;
}

var sections = wp.customize.panel( 'widgets' ).sections();

var section_selector = '';
Expand Down
13 changes: 10 additions & 3 deletions src/assets/js/front-end.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ var BoldGrid = BoldGrid || {};

if ( $this.hasClass( 'button-primary' ) ) {
$this.removeClass( 'button-primary' );
$this.find( 'a' ).addClass( 'button-primary' );
$this.children( 'a' ).addClass( 'button-primary' );
}

if ( $this.hasClass( 'button-secondary' ) ) {
$this.removeClass( 'button-secondary' );
$this.find( 'a' ).addClass( 'button-secondary' );
$this.children( 'a' ).addClass( 'button-secondary' );
}

$this.removeClass( 'btn' );
Expand All @@ -117,7 +117,7 @@ var BoldGrid = BoldGrid || {};
$this.removeClass( function( index, className ) {
return ( className.match( /(^|\s)btn\S+/g ) || [] ).join( ' ' );
} );
$this.find( 'a' ).addClass( 'btn' );
$this.children( 'a' ).addClass( 'btn' );
} );
},

Expand Down Expand Up @@ -619,6 +619,13 @@ var BoldGrid = BoldGrid || {};

// Setup main navigation.
setupMenu: function( sm ) {

// This has to be done here to ensure that the mega menus are configured before they are initialized.
$( sm ).find( 'ul.custom-sub-menu' ).each( function() {
$( this ).find( 'ul' ).addClass( 'in-mega' );
$( this ).find( 'ul' ).dataSM( 'in-mega', true );
} );

sm.smartmenus( {
mainMenuSubOffsetX: -1,
mainMenuSubOffsetY: 4,
Expand Down
7 changes: 2 additions & 5 deletions src/assets/scss/boldgrid/_bootstrap-additions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,6 @@
margin-bottom: -2px;
}

.container .container {
width: auto;
}

/** Nav Tabs Default Styles **/
.nav-tabs {
border-bottom: 1px solid currentColor;
Expand All @@ -126,7 +122,8 @@
}

// Nav menu.
.nav > li {
.nav > li,
.widget > .nav > li {
padding: 5px 0;
&.cat-item > a {
display: inline-block;
Expand Down
1 change: 1 addition & 0 deletions src/assets/scss/boldgrid/_elements.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ body.custom-background {
display: flex;
flex-direction: column;
flex: 1 0 auto;
z-index: 1;
}
@media only screen and (min-width: 768px) {
.site-content {
Expand Down
18 changes: 9 additions & 9 deletions src/assets/scss/boldgrid/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,35 @@
margin-left: -15px;
margin-right: -15px;
}
.container, .container-fluid {
padding-left: 0px;
padding-right: 0px;
}
.boldgrid-section {
> .boldgrid-section {
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
.container-fluid {
> .container-fluid {
width: 100%;
}
> .container, > .container-fluid {
padding-left: 0px;
padding-right: 0px;
}
.row {
display: flex;
flex-wrap: wrap;
}
.full-width {
> .full-width {
padding-left: 0px;
padding-right: 0px;
width: 100%;
.row {
> .row {
display: flex;
flex-wrap: wrap;
aside.sidebar {
padding-left: 0px;
padding-right: 0px;
height: 100%;
}
div {
> div {
padding-left: 0px;
padding-right: 0px;
}
Expand Down
4 changes: 2 additions & 2 deletions src/assets/scss/boldgrid/_inspiration-styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ body {
left: 0;
position: absolute;
top: 0;
z-index: 1;
z-index: 2;
opacity:0.35;
pointer-events: none;
}
Expand All @@ -42,7 +42,7 @@ body {
position: absolute;
right: 0;
top: 0;
z-index: 0;
z-index: 1;
opacity:0.35;
pointer-events: none;
}
Expand Down
Loading

0 comments on commit 4c13001

Please sign in to comment.