|

Including parent theme CSS

Have you ever opened the style.css file of a child theme and found something like this?

@import url("../make/style.css");

You don’t want that.  @import has a negative impact on page load, and it pulls in the stylesheet outside the enqueuing process.

Instead, put something like this inside your child theme’s functions.php file:

View the code on Gist.

Then your child theme’s style.css file can hold only styles for your child theme, and the parent theme CSS is enqueued properly.

The post Including parent theme CSS appeared first on As it were….

In which I explain how to properly enqueue a WordPress parent theme’s css file.
The post Including parent theme CSS appeared first on As it were….

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.