I have made some small changes to layout.css and typography.css at the request of the content administrator. Each time I update the theme, I have to patch in these changes by hand and run a script to get rid of the standard banner images, since we have our own set of banner images. Is there some trick that would make it easy to reapply the .css changes each time ... preferably automatically? I have a little script to move the standard images to a subdirectory ... but, of course, I have to remember to run it.

Comments

makro’s picture

It's not entirely automatic, but it's better. I'm in a similar situation to yours (except I am the content administrator as well), and I've made a subtheme where I override the theme where it suits me.

http://drupal.org/node/225125 - How to create subthemes

Create a subtheme where you declare the base theme as the theme you base your site on - alagna, giordani, marinelli, gnifetti. Then just create a CSS-file, and include it in your subtheme.info file. http://drupal.org/node/171209 - How to add style sheets

In the CSS-file you can override the base theme CSS. Let's say you want to change how headings are displayed.

By default, giordani (and maybe the other ones) have this CSS:

#primary .singlepage h1,
#primary .singlepage h2,
#primary .singlepage h3,
#primary .singlepage h4,
#primary .singlepage h5,
#primary .singlepage h6{ 
	font-family:Georgia, "Times New Roman", Times, sans-serif;
	font-weight:lighter;
}

In my override.css I have this to override it:

#primary .singlepage h1,
#primary .singlepage h2,
#primary .singlepage h3,
#primary .singlepage h4,
#primary .singlepage h5,
#primary .singlepage h6{ 
	font-family:/*Georgia, "Times New Roman", Times,*/ sans-serif;
	/*font-weight:lighter;*/
}

(I could just delete what I don't want to be there, but I comment it out, so I can see more easily what I've changed from the base theme)

Whenever you update, your subtheme will still override the base theme, but with the added features of the new versions, unless your overrides disable the new stuff.

The reason it isn't entirely automatic is because the base theme CSS might change, so you might have to adapt your subtheme now and then. But usually you can tell from the release notes what has changed and not, so it isn't time consuming.

Hope it helps - it helps me.

tamhas’s picture

I'm not sure that is substantially better than what I have. When I do my edits, I comment out what was there before and, when appropriate include what is new. I put my initials in the comment so that I can find them easily. With two sessions open I can edit my saved copy from the last version, copy the changed line, find that line in the new version, and paste it in to replace the new one ... having stopped to notice whether anything is different than I changed before. If I have to do the study of what has changed and whether it is in the areas I modified and whether there is something new that needs adding to the subtheme, I'm not sure I would really end up saving any work. Perhaps I just need to brush up on diff and patch and do a bit of experimenting.

makro’s picture

Let's say you tweak how lists are displayed. If there is nothing about lists in the release notes of a new release, there is nothing you need to do to adapt the subtheme. When lists are mentioned, the description of the problem fixed in the release notes usually gives a good hint as to where things have changed - go have a look, and adapt if neccesary.

We might tweak very differently, so my method might not work as well for you. Before I figured out how to use subthemes for this, I used KDiff (on Windows). I loaded the folder of stock new Marinelli as one folder, and my modified previous release as the other, compared, and imported the changes that I wanted.

tamhas’s picture

I'm down to modifying two files -- layout.css and typography.css as I recall. One has two or three changes and the other 4 or 5, all of them either just commenting out something, like the uppercasing of the user name in the main block or making a change in values, e.g., size of border on a title or the font of the title. I.e., dead simple and almost always exactly the same change version after version, but sometimes there are other changes, typically very small, in those same files so I don't want to just override with my copy. If it were more complicated, I would be doing a three way comparison of old base to modified on one side and old base to new base on the other (Araxis Merge is wonderful for doing this sort of thing), but at this level it would be more work to do that than to do what I'm doing. It is just a minor annoyance ... I could probably do something with diff and patch if it continues to be an issue. Depends a lot on how frequent the upgrades are, of course.

oadaeh’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

This issue is being closed because it is against a branch for a version of Drupal that is no longer supported.
If you feel that this issue is still valid, feel free to re-open and update it (and any possible patch) to work with the 7.x-4.x branch.
Thank you.