Support Center

How to create a local.css file for your theme

Last Updated: Jul 04, 2013 03:12PM EEST

This brief guide will demonstrate how to setup our themes to support a local.css file where custom CSS rules and modifications can be placed. Following this practice, there is no worry if the next theme update will override your custom css changes.

This can be done in two simple steps:

  1. Create an empty .css file under the /sites/all/themes/{themename} path and name it as you wish. local.css is always a good (apart from obvious :-) ) choice.
  2. Edit the theme's .info file and add a line like stylesheets[all][] = local.css after all stylesheet definitions
After this you should clear all cached data through Drupal’s User interface Home » Administration » Configuration » Performance. This step is important in order to force your template to be informed for the changes you have made in the template files.
 

Example

Let's say that we have to add local.css support in our Premium and responsive Drupal TopHit theme.

We should create a new .css file (local.css for example) and put it under the /sites/all/themes/tophit/ path.

Then we should edit the file tophit.info, under the /sites/all/themes/tophit/ and add the line stylesheets[all][] = local.css.

The tophit.info file should contain the following defintions:

name = TopHit
description = The next generation responsive corporate Drupal theme by More than (just) Themes.
version = @VERSION@
core = 7.x

stylesheets[all][] = skeleton.css
stylesheets[all][] = js/flexslider/flexslider.css
stylesheets[all][] = style.css
stylesheets[all][] = local.css

.
.
.


In case this article leaves any of your questions or concerns unanswered, please feel welcome to email us or post a public question.

​More than (just) Themes
http://www.morethanthemes.com/

Contact Us

[email protected]
http://assets0.desk.com/
false
morethanthemes
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete