Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1064375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:55:53+00:00 2026-05-16T18:55:53+00:00

Quite often when I design a website for a customer, I design his website

  • 0

Quite often when I design a website for a customer, I design his website with one (or multiple) CSS files that makes up the entire presentation layer. The thing is, usually, the customer’s needs change drastically in terms of “website theming”. He may end up asking to change from a blue/green color-based theme to a red/orange based one according to his tastes. The thing is, my file contains all the information including:

  • the positioning of elements
  • the background images of containers
  • the font size, color

What are the best practices for “decoupling” a CSS file to make it “theme” aware, while maintaining all its information on positioning?

My list of possible practices are as follow:

  1. Use a default CSS file containing generic information and positioning, use child CSS files that implement only the background images, font-sizes and colors
  2. Name your first CSS file (say here the blue/green one will be named “sky”). Implement another theme based on sky, overriding any CSS attributes needed to change the theme and name it (red/orange would be “crimson” for example).

EDIT: according to the great answers provided below, I updated the list of other possible solutions adding up to my list:

  1. Use SASS, (best authored with Compass @see Andrew Vit) specifically their “Mixins” feature. It takes CSS and introduces a very DRY programmatic approach. You can override existing classes with it. –treefrog
  2. Use an OOCSS approach. –Andrew Vit
  3. A technique called independent blocks (article in Russian) that mimics a sort of namespacing using class prefix to seperate specific blocks. –angryobject
  4. Three based stylesheets. Separating typography, position, and the reset stylesheet provided by Eric Meyer. –David Thomas
  5. Use already standardized approaches used by known organisations such as the Dojo library, jQuery UI, etc.
    –S .Jones

Which would be better in which possible case? Are there any other easily maintainable and flexible ways?

Best answer to date: Using SASS to make very flexible stylesheets. Of course this implies the slight learning curve, but according to a few reviews, SASS seems to be the next approach for dynamic stylesheets (along with HAML).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T18:55:54+00:00Added an answer on May 16, 2026 at 6:55 pm

    You should look into SASS, specifically their “Mixins” feature. It takes CSS and introduces a very DRY programmatic approach. You can override existing classes with it, making it perfect for what I think you’re trying to do.

    Link

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.