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 3612584
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:01:09+00:00 2026-05-18T22:01:09+00:00

Let’s say we have a massive CSS file that is used to style the

  • 0

Let’s say we have a massive CSS file that is used to style the layout of an application. Now, we want to let users change the colours of the layout to personalize it. What is the best way to do this customization, like in terms of design and architecture? I’m looking for a solution that is pretty easy to implement and isn’t very intrusive.

I also don’t want to make the whole css file templated on the server if I don’t have to. I’d like to keep it in my /css file if it’s possible, without any server dependencies.

Ideally, I’d like to just override the styles in the default, but I don’t think that’s possible as it will probably erase the existing styles. Which means I’ll have duplicate style information as I overwrite them… which is also bad. Duplication = bad.

I guess we can assume that there’s some server object related their account that has several properties for various colours, like backgrounds, menu tabs, link colours, hovered versions, etc.

public class Theme {

    private String headerBackground = "#172636";
    private String displayName = "#ffffff";

    private String tabBackground = "#284767";
    private String tabText = displayName;
    private String hoverTabBackground = tabBackground;
    private String hoverTabText = tabText;
    private String selectedTabBackground = "#f5f5f5";
    private String selectedTabText = "#172636";

    private String tableHeaderBackground = headerBackground;
    private String tableHeaderText = displayName;
    private String tableSubHeaderBackground = tabBackground;
    private String tableSubHeaderText = displayName;
    private String hoverTableRowBackground = "#c0d2e4";

    private String link = "#4e6c92";

My best guess is to just serve the entire css file and have my MVC framework merge the Theme with the css text and than serve it out. Is this the best way? Will that force the browser to never cache it?

My application is using Spring/Hibernate, but I’m pretty sure any recommendations even if you don’t use Java/Spring will be doable with these technologies.

Thanks for the help.

  • 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-18T22:01:09+00:00Added an answer on May 18, 2026 at 10:01 pm

    Letting visitors/users customise their look & feel can be rather fraught. You will need to store the properties in their profile to persist that look & feel across browser sessions.

    In essence this means serving up their custom CSS file which you render on demand. You could cache this on their client and use client-side JS to re-load this file when/if they change their LAF preferences.

    One way is to link to their stylesheet like this:

    <link type="text/css" rel="stylesheet" href="siteStyles.css" />
    <link type="text/css" rel="stylesheet" 
          href="customStylesheet.jsp?userId=123123123" />
    

    You’d need a fairly stand-alone application listener that simply loads their profile and (probably) populates a template file using string replacements (or whatever is best). You’ll need to make sure the response mime-type is set to “text/css”. The browser will do the rest.

    To force the browser to re-load the CSS file, simply add some guff, such as a version number, to the querystring:

    <link type="text/css" rel="stylesheet" 
       href="customStylesheet.jsp?userId=123123123&vn=123" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I'm building a data access layer for an application. Typically I have
Let's say I have a drive such as C:\ , and I want to
Let's say that we have an ARGB color: Color argb = Color.FromARGB(127, 69, 12,
Let's say that I have an arbitrary string like `A man + a plan
Let's say that I'm currently designing an application where I will need to use
Let's say I have two files.. I want to compare them side-by-side and see
Let's say I have a table that looks something like this: ------------------------------- id|column2|column3 |column4
Let's say you have a class called Customer, which contains the following fields: UserName
Let me try to explain what I need. I have a server that is
Let's say we have a simple function defined in a pseudo language. List<Numbers> SortNumbers(List<Numbers>

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.