WordPress.org

Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #35395, comment 72


Ignore:
Timestamp:
10/19/2016 08:07:24 PM (3 years ago)
Author:
pingram3541
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #35395, comment 72

    v1 v2  
    11Another thought that just occurred to me is better built in enqueueing of theme styles and scripts based on file structure, similar to the existing wp model for pages, posts partials/templates where the file structure and naming conventions define how wp loads css and js files.
    22
    3 How cool would it be for me to drop in a css file /mytheme/css/page_home_20.css and WP to automatically load that file only on the page with a slug of "home" with a priority of 20.  Obviously I haven't thought much deeper on this and there may be a good reason for not doing this but in the case of saving files from the customizer as it pertains to css, this could be the good ol logic needed to remove needing to hook into the db for css.  Think of the awesomeness we could have with the live editor in that we can employ a custom view for diffs not only against the recently proposed "changesets", i.e. customizer textarea history but also with actual files residing in the theme folder simply based on naming structure.
     3How cool would it be for me to drop in a css file /mytheme/css/page_home_20.css and WP to automatically load that file only on the page with a slug of "home" with a priority of 20.  Obviously I haven't thought much deeper on this and there may be a good reason for not doing this but in the case of saving files from the customizer as it pertains to css, this could be the good ol logic needed to remove needing to hook into the db for css to load on the front end.  Think of the awesomeness we could have with the live editor in that we can employ a custom view for diffs not only against the recently proposed "changesets", i.e. customizer textarea history but also with actual files residing in the theme folder simply based on naming structure.
    44
    55Heck at base value, I'd love the idea of being able to simply create and properly name a css file in my theme and never worry about touching functions.php for this!