Skip to content

Commit f71e5c2

Browse files
committed
custom sub menu support
1 parent 3f66d2b commit f71e5c2

File tree

8 files changed

+58
-53
lines changed

8 files changed

+58
-53
lines changed

src/assets/js/customizer/color/preview.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,9 +435,9 @@ export class Preview {
435435

436436
css += '@media (min-width: 768px) {';
437437
css += `#${location}-menu.sm-clean ul {background-color: ${subcolorVariable};}`;
438-
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};}`;
438+
css += `#${location}-menu.sm-clean ul:not(.custom-sub-menu) li:not(.custom-sub-menu) > a, #${location}-menu.sm-clean ul:not(.custom-sub-menu) li:not(.custom-sub-menu) > a:hover, #${location}-menu.sm-clean ul:not(.custom-sub-menu) li:not(.custom-sub-menu) > a:focus, #${location}-menu.sm-clean ul:not(.custom-sub-menu) li:not(.custom-sub-menu) > a:active, #${location}-menu.sm-clean ul:not(.custom-sub-menu) li: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};}`;
439439
css += `#${location}-menu.sm-clean ul { border: 1px solid ${subcolorVariable};}`;
440-
css += `#${location}-menu.sm-clean > li > ul:before, #${location}-menu.sm-clean > li > ul:after { border-color: transparent transparent ${subcolorVariable} transparent;}`;
440+
css += `#${location}-menu.sm-clean > li:not( .custom-sub-menu ) > ul:before, #${location}-menu.sm-clean > li:not( .custom-sub-menu ) > ul:after { border-color: transparent transparent ${subcolorVariable} transparent;}`;
441441
css += '}';
442442

443443
return css;

src/assets/scss/boldgrid/_margin-fix.scss

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,15 @@
128128
.container-fluid {
129129
.sm {
130130
&.e, &.ne, &.se {
131-
.li {
131+
.li:not( .custom-sub-menu ) {
132132
.btn {
133133
margin-right: -13px;
134134
padding-right: 13px;
135135
}
136136
}
137137
}
138138
&.w, &.nw, &.sw {
139-
.li {
139+
.li:not( .custom-sub-menu ) {
140140
.btn {
141141
margin-left: -13px;
142142
padding-left: 13px;
@@ -153,7 +153,7 @@
153153
.site-header {
154154
.bgtfw-menu-wrap.w {
155155
.sm-clean.w {
156-
li {
156+
li:not( .custom-sub-menu ) {
157157
&:first-of-type {
158158
a {
159159
margin-left: 0px;
@@ -165,7 +165,7 @@
165165
}
166166
.bgtfw-menu-wrap.nw {
167167
.sm-clean.nw {
168-
li {
168+
li:not( .custom-sub-menu ) {
169169
&:first-of-type {
170170
a {
171171
margin-left: 0px;
@@ -177,7 +177,7 @@
177177
}
178178
.bgtfw-menu-wrap.sw {
179179
.sm-clean.sw {
180-
li {
180+
li:not( .custom-sub-menu ) {
181181
&:first-of-type {
182182
a {
183183
margin-left: 0px;
@@ -189,7 +189,7 @@
189189
}
190190
.bgtfw-menu-wrap.e {
191191
.sm-clean.e {
192-
li {
192+
li:not( .custom-sub-menu ) {
193193
&:last-of-type {
194194
a {
195195
margin-right: 0px;
@@ -201,7 +201,7 @@
201201
}
202202
.bgtfw-menu-wrap.ne {
203203
.sm-clean.ne {
204-
li {
204+
li:not( .custom-sub-menu ) {
205205
&:last-of-type {
206206
a {
207207
margin-right: 0px;
@@ -213,7 +213,7 @@
213213
}
214214
.bgtfw-menu-wrap.se {
215215
.sm-clean.se {
216-
li {
216+
li:not( .custom-sub-menu ) {
217217
&:last-of-type {
218218
a {
219219
margin-right: 0px;

src/assets/scss/boldgrid/navigation/_base.scss

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@
6161
.sm-clean {
6262
background: transparent;
6363
}
64-
.sm-clean a,
65-
.sm-clean a:hover,
66-
.sm-clean a:focus,
67-
.sm-clean a:active,
68-
.sm-clean a.highlighted {
64+
.sm-clean li > a,
65+
.sm-clean li > a:hover,
66+
.sm-clean li > a:focus,
67+
.sm-clean li > a:active,
68+
.sm-clean li > a.highlighted {
6969
display: inline-block;
7070
padding: 13px 20px;
7171
text-decoration: none;
@@ -298,22 +298,22 @@
298298
border-radius: 5px;
299299
box-shadow: 0 5px 9px rgba(0, 0, 0, 0.2);
300300
}
301-
.sm-clean ul a,
302-
.sm-clean ul a:hover,
303-
.sm-clean ul a:focus,
304-
.sm-clean ul a:active,
305-
.sm-clean ul a.highlighted {
301+
.sm-clean ul:not( .custom-sub-menu ) a,
302+
.sm-clean ul:not( .custom-sub-menu ) a:hover,
303+
.sm-clean ul:not( .custom-sub-menu ) a:focus,
304+
.sm-clean ul:not( .custom-sub-menu ) a:active,
305+
.sm-clean ul:not( .custom-sub-menu ) a.highlighted {
306306
border: 0 !important;
307307
padding: 10px 20px;
308308
}
309-
.sm-clean ul a.disabled {
309+
.sm-clean ul:not( .custom-sub-menu ) a.disabled {
310310
background: white;
311311
color: #cccccc;
312312
}
313-
.sm-clean ul a.has-submenu {
313+
.sm-clean ul:not( .custom-sub-menu ) a.has-submenu {
314314
padding-right: 20px;
315315
}
316-
.sm-clean ul a span.sub-arrow {
316+
.sm-clean ul:not( .custom-sub-menu ) a span.sub-arrow {
317317
right: auto;
318318
top: 50%;
319319
margin-top: -5px;
@@ -422,10 +422,10 @@
422422
.sm-clean.sm-vertical ul a:not( .btn ) {
423423
padding: 10px 20px;
424424
}
425-
.sm-clean.sm-vertical ul a:hover,
426-
.sm-clean.sm-vertical ul a:focus,
427-
.sm-clean.sm-vertical ul a:active,
428-
.sm-clean.sm-vertical ul a.highlighted {
425+
.sm-clean.sm-vertical ul:not( .custom-sub-menu ) a:hover,
426+
.sm-clean.sm-vertical ul:not( .custom-sub-menu ) a:focus,
427+
.sm-clean.sm-vertical ul:not( .custom-sub-menu ) a:active,
428+
.sm-clean.sm-vertical ul:not( .custom-sub-menu ) a.highlighted {
429429
background: #eeeeee;
430430
}
431431
.sm-clean.sm-vertical ul a.disabled {

src/assets/scss/custom-color/color-classes.scss

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ $names: background background-color;
114114
}
115115
}
116116
&.color-neutral-sub-link-color.sm {
117-
ul {
117+
ul:not( .custom-sub-menu ) {
118118
li {
119-
a:not(.btn) {
119+
> a:not(.btn) {
120120
color: $palette-primary-neutral-color;
121121
}
122-
a:not(.btn) {
122+
> a:not(.btn) {
123123
&:hover, &:focus, &:active, &.highlighted {
124124
color: hover( nth($colors, $color), $palette-primary-neutral-color );
125125
}
@@ -141,12 +141,15 @@ $names: background background-color;
141141
.color#{$color}-#{nth( $names, $i )} {
142142
@for $each from 1 through length( $colors ) {
143143
&.color-#{$each}-link-color {
144-
a:not( .btn ) {
145-
color: #{nth($colors, $each)};
146-
}
147-
a:not( .btn ):hover, a:not( .btn ):focus, a:not( .btn ):active, a:not( .btn ).highlighted {
148-
color: hover( nth($colors, $color), nth($colors, $each) );
144+
li:not( .custom-sub-menu ) {
145+
> a:not( .btn ) {
146+
color: #{nth($colors, $each)};
147+
}
148+
> a:not( .btn ):hover, a:not( .btn ):focus, a:not( .btn ):active, a:not( .btn ).highlighted {
149+
color: hover( nth($colors, $color), nth($colors, $each) );
150+
}
149151
}
152+
150153
}
151154
&.sidebar {
152155
&.color-#{$each}-link-color {
@@ -158,27 +161,27 @@ $names: background background-color;
158161
&.sm {
159162
&.color-#{$each}-link-color {
160163
li.btn {
161-
a {
164+
> a {
162165
color: inherit;
163166
}
164-
a:hover, a:focus, a:active, a.highlighted {
167+
> a:hover, a:focus, a:active, a.highlighted {
165168
color: inherit;
166169
}
167170
}
168-
li {
169-
a:not(.btn) {
171+
li:not( .custom-sub-menu ) {
172+
> a:not(.btn) {
170173
color: #{nth($colors, $each)};
171174
}
172-
a:not(.btn) {
175+
> a:not(.btn) {
173176
&:hover, &:focus, &:active, &.highlighted {
174177
color: hover( nth($colors, $color), nth($colors, $each) );
175178
}
176179
}
177180
}
178181
@for $subeach from 1 through length( $colors ) {
179182
&.color-#{$subeach}-sub-link-color {
180-
li {
181-
ul a:not(.btn) {
183+
li:not( .custom-sub-menu ) {
184+
ul:not( .custom-sub-menu ) a:not(.btn) {
182185
color: #{nth($colors, $subeach)};
183186
&:hover, &:focus, &:active, &.highlighted {
184187
color: hover( nth($colors, $subeach), nth($colors, $subeach) );
@@ -200,8 +203,8 @@ $names: background background-color;
200203
}
201204
}
202205
&.color-neutral-sub-link-color.sm {
203-
ul {
204-
li {
206+
ul:not( .custom-sub-menu ) {
207+
li:not( .custom-sub-menu ) {
205208
a:not(.btn) {
206209
color: $palette-primary-neutral-color;
207210
&:hover, &:focus, &:active, &.highlighted {
@@ -213,8 +216,8 @@ $names: background background-color;
213216
}
214217
@for $subEach from 1 through length( $colors ) {
215218
&.color-#{$subEach}-sub-link-color {
216-
ul {
217-
li {
219+
ul:not( .custom-sub-menu ) {
220+
li:not( .custom-sub-menu ) {
218221
a:not(.btn) {
219222
color: #{nth($colors, $subEach)};
220223
&:hover, &:focus, &:active, &.highlighted {
@@ -247,8 +250,8 @@ $names: background background-color;
247250
}
248251
}
249252
&.color-#{$each}-sub-link-color.sm {
250-
ul {
251-
li {
253+
ul:not( .custom-sub-menu ) {
254+
li:not( .custom-sub-menu ) {
252255
a:not(.btn) {
253256
color: #{nth($colors, $each)};
254257
&:hover, &:focus, &:active, &.highlighted {
@@ -268,8 +271,8 @@ $names: background background-color;
268271
}
269272
}
270273
&.color-neutral-sub-link-color.sm {
271-
ul {
272-
li {
274+
ul:not( .custom-sub-menu ) {
275+
li:not( .custom-sub-menu ) {
273276
a:not(.btn) {
274277
color: $palette-primary-neutral-color;
275278
&:hover, &:focus, &:active, &.highlighted {

src/includes/class-boldgrid-framework-editor.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public function add_tinymce_plugin( $plugin_array ) {
5757
'post',
5858
'bg_block',
5959
'crio_page_header',
60+
'crio_custom_submenu',
6061
);
6162

6263
if ( ! empty( $pagenow ) && ! in_array( $pagenow, $valid_pages ) ) {

src/includes/class-boldgrid-framework-links.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public function __construct( $configs ) {
4848
*/
4949
public static $default_link_selectors = array(
5050
'.main a:not(.btn)',
51+
'.custom-sub-menu a:not(.btn)',
5152
'.page-header-wrapper a:not(.btn)',
5253
'.mce-content-body *:not( .menu-item ) > a:not(.btn)',
5354
'.template-header a:not(.btn)',

src/includes/class-boldgrid-framework-styles.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,9 +539,9 @@ public function menu_css( $location ) {
539539
$subcolor_obj->alpha = 0.4;
540540

541541
$css .= "#{$location}-menu.sm-clean ul {background-color: var(--{$submenu_background_class});}";
542-
$css .= "#{$location}-menu.sm-clean ul a:not(.btn), #{$location}-menu.sm-clean ul a:not(.btn):hover, #{$location}-menu.sm-clean ul a:not(.btn):focus, #{$location}-menu.sm-clean ul a:not(.btn):active, #{$location}-menu.sm-clean ul a:not(.btn).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: var(--{$submenu_background_class});}";
542+
$css .= "#{$location}-menu.sm-clean ul:not(.custom-sub-menu) li:not(.custom-sub-menu) > a:not(.btn), #{$location}-menu.sm-clean ul:not(.custom-sub-menu) li:not(.custom-sub-menu) > a:not(.btn):hover, #{$location}-menu.sm-clean ul:not(.custom-sub-menu) li:not(.custom-sub-menu) > a:not(.btn):focus, #{$location}-menu.sm-clean ul:not(.custom-sub-menu) li:not(.custom-sub-menu) a:not(.btn):active, #{$location}-menu.sm-clean ul:not(.custom-sub-menu) li:not(.custom-sub-menu) > a:not(.btn).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: var(--{$submenu_background_class});}";
543543
$css .= "#{$location}-menu.sm-clean ul { border: 1px solid var(--{$submenu_background_class});}";
544-
$css .= "#{$location}-menu.sm-clean > li > ul:before, #{$location}-menu.sm-clean > li > ul:after { border-color: transparent transparent var(--{$submenu_background_class}) transparent;}";
544+
$css .= "#{$location}-menu.sm-clean > li:not( .custom-sub-menu ) > ul:before, #{$location}-menu.sm-clean > li:not( .custom-sub-menu ) > ul:after { border-color: transparent transparent var(--{$submenu_background_class}) transparent;}";
545545
$css .= '}';
546546

547547
return $css;

src/includes/configs/customizer/controls/typography.controls.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
'priority' => 1,
7878
'output' => $bgtfw_typography->get_typography_output(
7979
$bgtfw_configs,
80-
'.widget, .site-content, .attribution-theme-mods-wrapper, .gutenberg .edit-post-visual-editor, .mce-content-body, .template-header, .template-footer'
80+
'.widget, .site-content, .sm li.custom-sub-menu, .attribution-theme-mods-wrapper, .gutenberg .edit-post-visual-editor, .mce-content-body, .template-header, .template-footer'
8181
),
8282
'edit_vars' => array(
8383
array(

0 commit comments

Comments
 (0)