• Resolved ockhamdesign

    (@ockhamdesign)


    Is there a reason why Ninja Forms is dependent on dashicons.css?

    I deregistered the dashicons.css except in the admin to speed up pageload. The side effect of that is that the CSS of Ninja Forms doesn’t load.

    Here’s the function.php that breaks Ninja Forms:

    add_action( ‘wp_enqueue_scripts’, ‘dequeue_css’ );
    function dequeue_css() {

    if ( ! is_user_logged_in() ) {
    wp_deregister_style( ‘dashicons’ );
    }
    }

    If you look at the page linked. You’ll see the Ninja Forms honeypot below the submit button.

    • This topic was modified 7 years, 1 month ago by ockhamdesign.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author krmoorhouse

    (@krmoorhouse)

    @ockhamdesign

    Hey,

    Some of the styling that can be applied through the form builder introduce elements that are reliant on dashicons to function. So, our structural styles have dashicons as a dependency.

    Ideally, we would prefer to only require that dependency in cases when we can detect that it is necessary, but that’s a future solution. At the moment, we’ve chosen to err on the side of caution.

    If you’d like to manually enqueue our stylesheet in the same function that you’ve used to remove dashicons, you should be able to do so with the following:

    wp_enqueue_style( ‘nf-display’, Ninja_Forms::$url . ‘assets/css/display-structure.css’ );

    -KR

Viewing 1 replies (of 1 total)

The topic ‘CSS doesn’t load without dashicons css’ is closed to new replies.