Overriding a theme's css

Permalink 1 user found helpful
I'm looking for some advice/ opinions on the best route to customize themes downloaded from the marketplace.

I made the noob mistake of customizing the main.css file. Client hit update (good practice) and overwrote all my customizations (lame).

So, I came up with one idea that isn't ideal: Copy contents of theme within the install package and install in theme. Sucks though because I have to manually merge updates. This also requires one to copy over all custom blocks/ package-specific overrides to the top-level override directories (ran into some issues of what I think were relative-path issues when doing this for the document library block).

What I'd LIKE to do is copy the main.css (or whatever it's called) from the theme to the root override directory (/public_html/css) and have is override the theme's css while being safe from upgrades. Is that… possible? :)

Appreciate your time!



View Replies:
stretchrt replied on at Permalink Reply
The "non-ideal" method you came up with is actually the best idea in all my reading. I actually read a post on it recently, but I can't remember whether it was in the Forums or in Documentation.

But yes, basically if you want to customize a theme other than customizations that are done through the dashboard, you are essentially making it your own theme - so as you mention you need to copy the theme folder from the package and put it in the root/themes folder, rename it to your own name to avoid conflicts, and then make that your theme.

As far as I am aware you shouldn't have to copy over any of the other parts of the theme, eg blocks, as they will still be available to you to use as long as the original theme package remains installed.

As you mention, any upgrades to the original theme would have to be manually merged, but as I see it, if you have a copy of the theme running successfully as your own custom theme, why would you want to merge any new css from the original anyway?

Those are my thoughts!

joelhansen replied on at Permalink Reply
Hey Richard,

Thanks for the reply.

I think you're probably right. :)

I get these clients with 2 or 3 year old, heavily customized themes where there are legit compatibility updates and I thought it'd be 'cleaner' to override just like one does for other things. But you're right, it's not THAT big of a deal. :)

Thanks for your time!

JohntheFish replied on at Permalink Reply
If I have mods to a theme that are css tweaks, then I leave the theme as it stands and load extra css afterwards that patches over it. This could be a file, or I use my Style Quickie block in a global header.

If I have mods to a theme that are more complex, maybe changing page type php or javascript, then I clone the entire theme into another theme name and work on that. After a theme upgrade I run a diff between the two and then manually patch my cloned version.

This also means that I can easily swap from the cloned theme back to the original whenever I want during development (maybe to test something).

With theme layouts becoming more intelligent and more themes using LESS, I suspect I will be doing less cloning in the future and more simple patches.
joelhansen replied on at Permalink Reply
Hey John,

Thanks. I was kinda hoping the global /css folder would be able to be put to use, but it's nice to know others have come to the same conclusion I have.

Side note: I looked at your CSS Quickie Add On - you are a stud.

tallacman replied on at Permalink Reply
I tested this:http://www.concrete5.org/marketplace/addons/theme-editor/...
when it was in peer review and it works really well.
joelhansen replied on at Permalink Reply
Hey there,

Thanks for the link - it's an interesting Add On.

I do most of my coding in Coda/ Vim, and it's great. My question is more rooted in the proper use of overrides to ovoid update-conflicts. Thanks for the reply!