Skip to content

Commit

Permalink
2.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
webmandesign committed Sep 15, 2024
1 parent 38d2bea commit e2c7ea1
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 53 deletions.
4 changes: 2 additions & 2 deletions assets/css/main-rtl.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions assets/css/main.css

Large diffs are not rendered by default.

75 changes: 47 additions & 28 deletions assets/scss/_css-vars.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,60 @@
// @copyright WebMan Design, Oliver Juhas
//
// @since 2.3.0
// @version 2.4.3
// @version 2.6.3
//

:root {

@each $option, $value in $customize_options {
// Converting values to string to prevent issues.
--#{$option}: #{$value+''};
}

// RGBA colors:
// @see Modern_Customize::rgba_alphas()

$customize_options_rgba: (
'color_header_text',
'color_content_text',
'color_footer_text',
);
@each $option_rgba in $customize_options_rgba {
// As all of the RGBA options use the same alpha value,
// we just set it here directly (the `20`).
$value: rgba( map_get( $customize_options, $option_rgba ), 20 / 100 );
// Theme options.

@each $option, $value in $customize_options {
// Converting values to string to prevent issues.
--#{$option_rgba}--a20: #{$value+''};
--#{$option}: #{$value+''};
}

$customize_options_rgba: (
'color_accent',
);
@each $option_rgba in $customize_options_rgba {
// As all of the RGBA options use the same alpha value,
// we just set it here directly (the `20`).
$value: rgba( map_get( $customize_options, $option_rgba ), 0 );
// Converting values to string to prevent issues.
--#{$option_rgba}--a0: #{$value+''};
// RGBA colors:
// @see Modern_Customize::rgba_alphas()

$customize_options_rgba: (
'color_header_text',
'color_content_text',
'color_footer_text',
);
@each $option_rgba in $customize_options_rgba {
// As all of the RGBA options use the same alpha value,
// we just set it here directly (the `20`).
$value: rgba( map_get( $customize_options, $option_rgba ), 20 / 100 );
// Converting values to string to prevent issues.
--#{$option_rgba}--a20: #{$value+''};
}

$customize_options_rgba: (
'color_accent',
);
@each $option_rgba in $customize_options_rgba {
// As all of the RGBA options use the same alpha value,
// we just set it here directly (the `20`).
$value: rgba( map_get( $customize_options, $option_rgba ), 0 );
// Converting values to string to prevent issues.
--#{$option_rgba}--a0: #{$value+''};
}

// White spaces.

--gap_elements: 0;
// Touch enabled devices.
@media (hover: none) {
--gap_elements: 10px;
}

--navigation_button_toggle_spacing: var(--gap_elements);

// Widths & heights.

--button_toggle_sub_menu_size: 10px;
// Touch enabled devices.
@media (hover: none) {
--button_toggle_sub_menu_size: 24px;
}
}
2 changes: 1 addition & 1 deletion assets/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// @copyright WebMan Design, Oliver Juhas
//
// @since 2.0.0
// @version 2.6.0
// @version 2.6.3
//

$rtl_multiplier: 1; // For `translateX` transform, for example.
Expand Down
9 changes: 1 addition & 8 deletions assets/scss/main/menu/__menu-primary-expander.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
/* FILE: main/menu/_menu-primary-expander.scss */

:root {
--button_toggle_sub_menu_size: 10px;
// Touch enabled devices.
@media (hover: none) {
--button_toggle_sub_menu_size: 24px;
}
}

.has-navigation-mobile {
@include media( ( map_get( $breakpoint, $mobile_menu_breakpoint ), 'max-width' ) ) {
--button_toggle_sub_menu_size: 32px;
Expand All @@ -21,6 +13,7 @@
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--navigation_button_toggle_spacing);

> a {
padding-#{$right}: $golden_minor + em;
Expand Down
15 changes: 15 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Modern Changelog

## 2.6.3, 20240915

### Updated
- Improving accessibility
- Improving and fixing social icons (introducing option to force the icon with `has-icon-#` class)

### File updates
changelog.md
style.css
assets/scss/_css-vars.scss
assets/scss/main.scss
includes/frontend/class-menu.php
includes/starter-content/class-starter-content.php


## 2.6.2, 20240902

### Updated
Expand Down
37 changes: 30 additions & 7 deletions includes/frontend/class-menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @copyright WebMan Design, Oliver Juhas
*
* @since 2.0.0
* @version 2.6.1
* @version 2.6.3
*
* Contents:
*
Expand Down Expand Up @@ -421,7 +421,7 @@ public static function get_menu_args_social( $items_wrap = '<ul data-id="%1$s" c
* Social links supported icons
*
* @since 2.0.0
* @version 2.6.1
* @version 2.6.3
*/
public static function social_links_icons() {

Expand Down Expand Up @@ -474,6 +474,7 @@ public static function social_links_icons() {
'wa.me' => 'whatsapp',
'wordpress.org' => 'wordpress',
'wordpress.com' => 'wordpress',
'x.com' => 'x',
'xing.com' => 'xing',
'yelp.com' => 'yelp',
'youtube.com' => 'youtube',
Expand All @@ -489,7 +490,7 @@ public static function social_links_icons() {
* Note that the menu has to be set to output `<!--{{icon}}-->` placeholders!
*
* @since 2.0.0
* @version 2.2.3
* @version 2.6.3
*
* @param string $item_output The menu item output.
* @param WP_Post $item Menu item object.
Expand All @@ -513,10 +514,32 @@ public static function nav_menu_social_icons( $item_output, $item, $depth, $args

// Processing

foreach ( $social_icons as $url => $icon ) {
if ( false !== strpos( $item_output, $url ) ) {
$social_icon = $icon;
break;
if (
! empty( $item->classes )
&& false !== stripos( implode( ' ', (array) $item->classes ), 'has-icon-' )
) {

$forced_icon = array_intersect(
$social_icons,
array_map(
function( $item ) {
return str_replace( 'has-icon-', '', trim( $item ) );
},
(array) $item->classes
)
);

if ( ! empty( $forced_icon ) ) {
$social_icon = reset( $forced_icon );
}

} else {

foreach ( $social_icons as $url => $icon ) {
if ( false !== strpos( $item_output, $url ) ) {
$social_icon = $icon;
break;
}
}
}

Expand Down
8 changes: 4 additions & 4 deletions includes/starter-content/class-starter-content.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @copyright WebMan Design, Oliver Juhas
*
* @since 2.0.0
* @version 2.6.1
* @version 2.6.3
*
* Contents:
*
Expand Down Expand Up @@ -202,7 +202,7 @@ public static function options() {
* Navigational menus
*
* @since 2.0.0
* @version 2.6.1
* @version 2.6.3
*/
public static function nav_menus() {

Expand Down Expand Up @@ -250,9 +250,9 @@ public static function nav_menus() {
'url' => 'https://www.facebook.com/',
),

'link_twitter' => array(
'link_x' => array(
'title' => esc_html_x( 'X', 'Theme starter content', 'modern' ),
'url' => 'https://twitter.com/',
'url' => 'https://x.com/',
),

'link_email',
Expand Down
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Theme Name: Modern
Theme URI: https://www.webmandesign.eu/portfolio/modern-wordpress-theme/
Author: WebMan Design
Author URI: https://www.webmandesign.eu/
Version: 2.6.2
Version: 2.6.3
Text Domain: modern
Domain Path: /languages
License: GNU General Public License v3
Expand Down

0 comments on commit e2c7ea1

Please sign in to comment.