Home > Blockchain >  Do i need to enqueue empty style.css in a custom Wordpress theme?
Do i need to enqueue empty style.css in a custom Wordpress theme?

Time:01-10

I know this question sounds simple but i'm unable to figure out, if it's a hard requirement to wp_enqueue_style() the theme's style.css or if it can be left out.

According to documentation it is required that this file exists for Wordpress to recognize the theme, but it's not made clear if it also has to be enqueued.

In my case, I'm using sass to compile my styles into a main.css file, which in turn leaves the style.css empty and technically useless other than being a additional network request made.

Is there any penalty or disadvantage for not enqueueing the style.css in my custom theme?

CodePudding user response:

style.css is necessary for theming - telling WordPress which theme to activate, that being said you do not have to load it on the front end.

It is good practice to enqueue your custom css files so you dont have any conflicts with scripts and styles loaded from plugins.

  • Related