Featured post
What is the best way to have custom css styles to theme a layout? -
let's have massive css file used style layout of application. now, want let users change colours of layout personalize it. best way customization, in terms of design , architecture? i'm looking solution pretty easy implement , isn't intrusive.
i don't want make whole css file templated on server if don't have to. i'd keep in /css file if it's possible, without server dependencies.
ideally, i'd override styles in default, don't think that's possible erase existing styles. means i'll have duplicate style information overwrite them... bad. duplication = bad.
i guess can assume there's server object related account has several properties various colours, 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 serve entire css file , have mvc framework merge theme css text , serve out. best way? force browser never cache it?
my application using spring/hibernate, i'm pretty sure recommendations if don't use java/spring doable these technologies.
thanks help.
letting visitors/users customise & feel can rather fraught. need store properties in profile persist & feel across browser sessions.
in essence means serving custom css file render on demand. cache on client , use client-side js re-load file when/if change laf preferences.
one way link stylesheet this:
<link type="text/css" rel="stylesheet" href="sitestyles.css" /> <link type="text/css" rel="stylesheet" href="customstylesheet.jsp?userid=123123123" />
you'd need stand-alone application listener loads profile , (probably) populates template file using string replacements (or whatever best). you'll need make sure response mime-type set "text/css". browser rest.
to force browser re-load css file, add guff, such version number, querystring:
<link type="text/css" rel="stylesheet" href="customstylesheet.jsp?userid=123123123&vn=123" />
- Get link
- X
- Other Apps
Comments
Post a Comment