Support » Theme: Twenty Twenty-One » How to remove Parent CSS variables

  • Resolved klewis

    (@blackawxs)


    How do we completely disable the CSS variables of the parent theme (found in style.css) from loading if we have our own child theme with its own CSS? I don’t want any of the Parent CSS to load on the front end while my child theme is activated.

    For example…

    --global--font-primary

    Is setting my font family at the html() level, on my child theme. I don’t need it because I am enqueueing Google fonts for the front end and have it already a part of my custom CSS, on my html{} level within my custom CSS file.

    Thanks

    • This topic was modified 4 weeks ago by klewis.
    • This topic was modified 4 weeks ago by klewis.
    • This topic was modified 4 weeks ago by klewis.
    • This topic was modified 4 weeks ago by klewis.
Viewing 1 replies (of 1 total)
  • Thread Starter klewis

    (@blackawxs)

    I figured it out like so. This gives my child theme full control with custom CSS.

    function tto_dequeue_styles(){
      wp_dequeue_style('twenty-twenty-one-style');
      wp_deregister_style('twenty-twenty-one-style');
    }
    add_action( 'wp_print_styles', 'tto_dequeue_styles', 9999 );
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.