WordPress.org

Forums

[resolved] wp_enqueue_style ignores @imports? (2 posts)

  1. Scroot
    Member
    Posted 2 years ago #

    Hello. I am creating a custom site built upon the _s theme.

    The functions.php file seems to have a pretty straightforward call for registering the default stylesheet:

    wp_enqueue_style( 'style', get_stylesheet_uri() );

    My problem with this is that it seems all @import declarations within my stylesheet (which has been enqueued above) are ignored. That includes important things like web font imports and other stylesheet imports such as reset. Does anyone else have this problem, and/or a fix?

  2. Scroot
    Member
    Posted 2 years ago #

    Fixed.

    The problem was that all @import statements must come before any other CSS in the stylesheet. In my case, I had the reset not as an import, but as a built-in section (after which I was trying my imports).

Topic Closed

This topic has been closed to new replies.

About this Topic