1

I've gone through Creating a sub-theme, but there is something that is not clear to me.

Why do I need to copy style.css and declare it in the info file as, in the above link, it clearly says that if we declare any CSS file all the CSS files are automatically inherited?

Can anybody confirm me the minimum steps to create a Garland sub-theme?

  • Create the ".info" file with "stylesheets[all][] = style.css"
  • Copy the style.css file
  • Create the regions in the ".info" file, since none are inherited
  • Create an empty template.php
  • copy the "color" and "images" directory
1

The bare minimum is a just a single YOURTHEME.info file:

name = YOUR THEME
base theme = garland
core = 6.x
stylesheets[all][] = YOURTHEME.css

That's it. :-)

--

No need to copy style.css. An empty YOURTHEME.css works, as long as you've defined it in the .info file. Actually, the file doesn't even have to exist. ;-)

No need to define regions, none are defined in gardland.info either.

No need to copy images directory. Images are inherited from the base theme.

The color directory is optional. You only need it if you are after the color scheme functionality.

No need for an empty template.php. You can create one when you need it.

  • As far as I know and it is mentioned in the link I've mentioned above, we must define regions. – AgA Jul 29 '11 at 4:26
  • What is mentioned there is custom regions. Garland doesn't define any, and makes use of the default ones: http://drupal.org/node/171206 – Jan Tomka Jul 29 '11 at 4:58
1

The stylesheets will inherit, unless you have an identically named one, which will override it. You should only add new (and differently named) stylesheets as you need them. You don't have to copy the original style.css, and unless you want to override it, you shouldn't add it to your .info file

0

I think that's it, yes. You need a single stylesheet, but it can be empty if you wish.

  • No. Empty stylesheet isn't working, that's why I've copied style.css – AgA Jul 27 '11 at 16:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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