Support » Plugin: Karma Music Player by Kadar » Material Icons embedded

  • Dear plugin developer! Thank you very much for a very beautiful player! But I noticed that the plugin slows down my site. Is it possible to make Material Icons embedded? I made a temporary decision, but this is not very convenient:

    add_action( 'wp_enqueue_scripts', function () {
    	if ( !is_page ('462') ) {
    		wp_dequeue_style( 'karma-by-kadar-google-fonts' );
    	}
    });

    Of course, it would be very good if the plug-in connected scripts and styles only where the player is located.
    Thanks again for the plugin! He decorates my site!

    !!!The slowdown of the site is not very noticeable, but still noticeable.

    • This topic was modified 2 years, 9 months ago by zabavljaev.
Viewing 1 replies (of 1 total)
  • Thread Starter zabavljaev

    (@zabavljaev)

    Maybe just add to master.css? After all, you need only 3 icons.

    @font-face {
      font-family: 'Material Icons';
      font-style: normal;
      font-weight: 400;
      src: url(flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) format('woff2');
    }
    
    .material-icons {
      font-family: 'Material Icons';
      font-weight: normal;
      font-style: normal;
      font-size: 24px;
      line-height: 1;
      letter-spacing: normal;
      text-transform: none;
      display: inline-block;
      white-space: nowrap;
      word-wrap: normal;
      direction: ltr;
      -webkit-font-feature-settings: 'liga';
      -webkit-font-smoothing: antialiased;
    }

    Here the code is not much less

    function karma_by_kadar_fonts_url() {
    		$font_url = '';
    		if ( 'off' !== _x( 'on', 'Google font: on', 'karma-by-kadar' ) ) {
    			$font_url = add_query_arg(
    				'family',
    				urlencode( 'Material Icons' ),
    				"//fonts.googleapis.com/css"
    			);
    		}
    		return $font_url;
    	}
    
    	wp_enqueue_style( 'karma-by-kadar-google-fonts', karma_by_kadar_fonts_url(), array(), '1.0.0' );

    And then your player will work even on a local server)) Very beautiful player! And it is very nice that you like Beethoven’s Ninth Symphony.

    • This reply was modified 2 years, 9 months ago by zabavljaev.
    • This reply was modified 2 years, 9 months ago by zabavljaev.
    • This reply was modified 2 years, 9 months ago by zabavljaev.
Viewing 1 replies (of 1 total)
  • The topic ‘Material Icons embedded’ is closed to new replies.