Drop Dashicons for Performance
-
Hello!
First of all – this is an excellent plugin.One thing that i find not so good is: it loads the dashicons – and if you dont use icons at all it’s just the Dropdown-Arrows.
Which means 28kB loading dashicons.min.css for 1 Symbol that could be replaced by the standard like “^”.
Is there a simple way to get rid of the dashicons request?
A solution would be possible by combining
// Remove dashicons in frontend for unauthenticated users add_action( 'wp_enqueue_scripts', 'bs_dequeue_dashicons' ); function bs_dequeue_dashicons() { if ( ! is_user_logged_in() ) { wp_deregister_style( 'dashicons' ); } }
and the method, he uses to replace Dashicon set with Font Awesome in Documentation
function megamenu_use_fontawesome_arrows( $vars, $location, $theme, $menu_id, $theme_id ) { $vars['arrow_font'] = "'Font Awesome 5 Free'"; $vars['arrow_font_weight'] = "900"; $vars['arrow_up'] = "'\\f106'"; $vars['arrow_down'] = "'\\f107'"; $vars['arrow_left'] = "'\\f104'"; $vars['arrow_right'] = "'\\f105'"; return $vars; }
add_filter( “megamenu_scss_variables”, “megamenu_use_fontawesome_arrows”, 10, 5 );
But that is already to difficult for me.
What do you suggest?
Kind regards
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Drop Dashicons for Performance’ is closed to new replies.