So I am developing a wordpress theme using a series of LESS files for the CSS. These compile using codekit to a combined and minifed stylesheet that I use for the theme's styling.

I understand a wordpress theme must have a style.css which includes the info about the theme in its comments, but is it required to link this style.css in the header.php? Surely I can just have the theme info in it and nothing else and leave it untouched in the theme folder. The stylesheet I actually use can just be called styles.css or main.css or something.

can anyone confirm this or give reasons why this might be a bad idea?

  • 1
    You should leave the style.css with theme infos at the root of your theme folder. That's it.
    – JMau
    Commented Aug 22, 2013 at 16:37

4 Answers 4


I would say: you should not use the style.css for the actual production CSS.

The reason is simple: minification. You cannot minify the content of the file completely, because WordPress has to read it. In my themes, I use style.css just for the headers, and I add a comment, explaining where to find the real CSS, so other developers don’t have to search too long.


Theme Name:    My theme name
Version:       2013.08.24
License:       MIT
Text Domain:   t5_theme
Domain Path:  /lang

You will find the real stylesheet in css/default.css.
  • 2
    This is nice idea. Commented Aug 24, 2013 at 22:58
  • This is what I do as well, works like a charm. Commented Aug 27, 2013 at 20:49
  • Do you still need to enqueue style.css on the front end in order for WP to read the config? Commented Sep 5, 2016 at 16:47
  • 3
    @henrywright No, that was never necessary.
    – fuxia
    Commented Sep 5, 2016 at 18:56

You are correct, Harry, that you do not need to actually call to or load the default style.css in your header file. Since I've been using SCSS in my themes, I've encountered this same issue, but had decided to maintain the link to style.css for the following reasons which may or may not be applicable to your situation:

  • Default WP assumptions are that style.css exists and is in use, and I don't want to thwart that assumption with respect to plugins. I don't know if/when this would be an issue and would be interested to hear others' experiences and advice on this point.
  • If my actual in-use stylesheet is in a folder, it prevents users from being able to edit the site's CSS. Keeping style.css active and available gives my users a way to still be able to make CSS changes from the WP admin.
  • Related, while working on the staging site with other partners, if they don't also use SCSS, they can make changes to style.css without affecting my ability to continue to use my SCSS files.

Again, these points may not be applicable to your situation but have informed my decision to keep the default style.css linked, even if it's mostly blank except for the required theme info.


Yes, WordPress uses the theme's style.css as a "config" document.

You are also correct, as far as I can tell, that you don't have to actually load style.css on the front end in order to have it serve its "config" purposes.

What you are doing should be fine. I am pretty sure I have seen other themes do something similar but I can't swear to it. The only issue I can see would be if some plugin erroneously assumes that style.css is the (only) stylesheet in the theme.


You could also add this to your config.rb (if you're using Compass) and CodeKit will automatically copy your minified stylesheet to style.css in the theme root.

require 'fileutils'
on_stylesheet_saved do |file|
  if File.exists?(file) && File.basename(file) == "style.css"
    puts "Moving: #{file}"
    FileUtils.mv(file, File.dirname(file) + "/../" + File.basename(file))

I use this with every WordPress theme I develop and it works like a charm.

Make sure that the comment in your style.scss file starts with the ! after the opening comment or else it will be removed in the minification:

  Theme Name: Your Theme

Source: CSS-Tricks

  • 1
    That trick with adding exclamation point after beginning /* did the trick for me. Means I can keep processing the less file -> css and still keep the format that WordPress expects to read the theme details. Easiest trick I have seen in a long time (one character the right place!) :-) Commented Apr 17, 2016 at 20:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.