• I’ve been reading a lot about site performance and load times. Every major search engine says DO NOT USE the “@Import” rule.

    But every tutorial I read on child themes says to call on the parent theme using @import. Is there some other way to call on the parent theme?

    Thanks in advance for your help!

Viewing 12 replies - 16 through 27 (of 27 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    It’s a fair point and I don’t see any argument against it.
    @syrinx32123 Can you create a thread on the Requests and Feedback forum regarding this please?

    Should the Codex recommendation change from @import to enqueue?

    No. There is absolutely nothing wrong with using @import, and it is, by far, the more user-friendly approach.

    It’s a fair point and I don’t see any argument against it.
    @syrinx32123 Can you create a thread on the Requests and Feedback forum regarding this please?

    There is no need to make such a change. There is nothing wrong with using @import.

    If you have a site that legitimately needs to performance improvement between the two methods, then you’re big enough that you probably already have a paid developer on staff, who doesn’t need to be told how to enqueue stylesheets. Otherwise: you’re not going to notice the difference.

    Using @import is the easiest and most user-friendly approach, and should remain as the default/recommended implementation.

    Thread Starter syrinx32123

    (@syrinx32123)

    There is no need to make such a change. There is nothing wrong with using @import.

    Why not start with the most efficient method from the get-go? All major search engines recommend against the use of @import, so WP’s codex should reflect this.

    All major search engines recommend against the use of @import

    On what grounds?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Google says the browser is unable to load stylesheets in parallel when @import is used.

    The extra load is minimal. If it bothers people that much, they can always create a custom header.php file and load their parent & child theme’s stylesheet that way.

    The extra load is minimal.

    Bingo. The law of diminishing returns applies here. There are usually far greater opportunities for page-speed improvement.

    If it bothers people that much, they can always create a custom header.php file and load their parent & child theme’s stylesheet that way.

    And if it’s *that* much of a problem, just copy/paste the parent style.css declarations directly into the child style.css file.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    I think you addressed it well Chip, that using other methods of loading the parent theme’s CSS would not be user-friendly.

    If you have a site that legitimately needs to performance improvement between the two methods, then you’re big enough that you probably already have a paid developer on staff, who doesn’t need to be told how to enqueue stylesheets. Otherwise: you’re not going to notice the difference.

    Why not have it the other way round? Have the most efficient method by default. And if somebody wants to use the “most easiest and user-friendly approach” of @import they can tell their paid developer to do it.

    This resistance for better standards by a few people seems a way to distinguish themselves from the average user.

    Have the most efficient method by default.

    that is why the theme developer guidelines (for theme to be added to the WordPress themes direcory) require the enqueuing sof stylesheets;

    Styles
    1.The main stylesheet (style.css) must be enqueued during the wp_enqueue_scripts action.

    https://developer.wordpress.com/themes/

    so for a new theme such as twenty fourteen, do we enqueue the child theme in the child theme header.php? I am slightly lost and clearly late to this.

    Fearlessly modifying two themes, like I know what I am doing. Thanks in advance for the help.

Viewing 12 replies - 16 through 27 (of 27 total)
  • The topic ‘Child Theme: how to call on parent theme w/ out using "@import"’ is closed to new replies.