Codex: @import vs wp_enqueue_style in child themes
-
I’ve noticed a spike in people whose child themes are not inheriting the parent theme’s styles because they have commented out the
@import url( '../parent-theme/style.css' );
line in their child theme’s stylesheet. I was surprised to discover that the Codex page on child themes has that line commented out as well, and while it is possible to usewp_enqueue_style()
in your child theme’sfunctions.php
to load your parent theme’s stylesheet, the Codex does not mention that at all.So two questions here:
1) Why does the Codex page currently have the
@import
line commented out in the sample child theme stylesheet?
2) I’d like to fix this, but if the decision to comment out that line was due to a discussion made elsewhere, I don’t want to step on anyone’s toes. Should the Codex recommend the use of@import
by default, and if so, should the Codex mention the use ofwp_enqueue_style
as well?
- The topic ‘Codex: @import vs wp_enqueue_style in child themes’ is closed to new replies.