ryanve / action

Extensible HTML5 WordPress parent theme
http://actiontheme.com
5 stars 1 forks source link

Ideal CSS file structure in parent theme #2

Closed ryanve closed 10 years ago

ryanve commented 11 years ago

action should use the CSS file setup that best enables child-theme flexibility while still remaining maintainable and performant. The parent CSS is organized and modular. For performance it is usually ideal for all CSS to be combined in 1 file. 2 files is reasonable and easier to maintain. It helps separate base from theme styles.

0.x file structure

Both queue setups (0.x, 1.0) allow any file to be overrided by a child theme. A WP problem is that child themes must contain style.css. The setups above allows modular overriding without needing @import. They rightfully nudge child-theme devs towards cascading rather than editing base styles.

What setup provides the easiest usage to child themes?

One alternative is manually combine everything into style.css and not use a css folder. If a child wants to use the parent stylesheet, it can enqueue it via its functions.php. It'd simplify the parent file structure and improve front-end performance. But it'd make customization less modular and the parent CSS messier. The 0.x setup hybridizes the 2 extremes.

ryanve commented 11 years ago

1.1 uses a file structure like 0.x but differs in that it foregos overriding. Parent stylesheets register as "parent-base" and "parent-style", but enqueue only when in parent-theme contexts. Child themes are expected to enqueue any and all CSS that they need (utilizing the parent-* sheets and/or custom child sheets). See examples in action-child/functions.php

1.1 file structure