Move my theme style.css into a folder

I was wondering if its possible to have my theme style.css in a css folder rather than in the root? I assume that the Theme Metadata has to be in the theme root, but could the actual styles be moved? Is this a piece of meta data I would add to the theme meta?

Related posts

2 comments

  1. You can just register another stylesheet instead of style.css:

    add_action( 'wp_enqueue_scripts', 'enqueue_theme_css' );
    
    function enqueue_theme_css()
    {
        wp_enqueue_style(
            'default',
            get_template_directory_uri() . '/css/default.css'
        );
    }
    

    This is, in my opinion, better than using style.css.

  2. Originally I said

    You could make your child theme stylesheet import another stylesheet

    @import url(“subdirectory/file.css”);*

    But this was incorrect as this is no longer the preferred way to reference a style sheet.

    Now, I have discovered a plugin that makes child’s play of creating a child theme (please excuse the pun) https://wordpress.org/plugins/child-theme-configurator/

    You could probably use this plugin to enqueue your other stylesheet. Might be worth having a look at the instructions to see if this is practical.

    Hope this helps.

Comments are closed.