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

  • Home
  • SEARCH
  • 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 5988093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:54:38+00:00 2026-05-22T22:54:38+00:00

We are looking into providing users of our application the ability override the default

  • 0

We are looking into providing users of our application the ability override the default site CSS.

Currently they can choose a site theme but it would be nice to allow them to change properties such as background color, font color, font face etc.

I’m torn between giving each site a “user defined” stylesheet that can be edited from the administration area or providing some kind of CSS builder.

The first option provides the most flexibility but could also be the most problematic and requires the user to have some basic understanding of CSS.

So aside from the obvious, (which is the best solution?) I have a few additional questions:

User Defined Css:
Is there a web based CSS editor available?
Is there a server side (.net) CSS validator available (for verifying the css the user enters)

Css Builder:
Is there a web based CSS builder already available?
What is the best way of generating the CSS based on the rules provided by the user (I thought about using some kind of templating engine to do this (NVelocity, Razor etc.)?

Thanks

Solution

I’ve added an answer below with the solution we went for.

  • 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-22T22:54:39+00:00Added an answer on May 22, 2026 at 10:54 pm

    I think the key factor here is whether you want your users to ‘play with the codez’

    If you do then something like this (posted by @Caspar) can be helpful in generating the css. If you do allow direct access to the css then the W3 CSS Validator (posted by @Trikks) is definitely necessary.

    In my case I didn’t want to provide direct access to the Css. Looking around at various sites that allow you to change simple style properties (background-color, font-face, color etc.) it seems that they have just created their own interfaces for this. There are plenty of javascript plugins around for making this process quite slick (color pickers etc.).

    Once you have the styles stored somewhere you need some way of rendering them out.

    I couldn’t find any .net Css writers. I think it may be possible in Less but the solution was quite simple just using what’s built into asp.net mvc.

    I created a Css action result (courtesy of @Darin Dimitrov):

    public class CssResult : PartialViewResult {
    
        public override void ExecuteResult(ControllerContext context) {
            context.HttpContext.Response.ContentType = "text/css";
            base.ExecuteResult(context);
        }
    }
    

    Then in my controller (a simple example):

        [HttpGet]
        public ActionResult Index()
        {
            var styles = new Dictionary<string, string>()
            {
                { "color", "red" },
                { "font-family", "Consolas, Courier, Serif" },
                { "font-size" , "12px" }
            };
            return this.Css(styles);
        }
    

    Then my view (views/css/index.cshtml):

    body {@foreach (var item in Model) {
            @string.Format("{0}: {1};", item.Key, item.Value)
        }
    }
    

    This will essentially render out the styles in the passed in dictionary. Of course you may want to create a specific class for holding these styles so that you could also specify the dom element name/class/id.

    Finally to render out the stylesheet on our page we can call Url.Action("index", "css").

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

Sidebar

Related Questions

I'm looking for a way to providing users (administrators) of a web application to
I'm looking into providing several methods of visualizing a large volume of data. This
By looking into the Open JPA website i've found that i can log the
Currently looking into learn new technology and silverlight is on the potential list. However,
I've been looking around for different methods of providing plug-in support for my application.
Looking into selector performance between $('#ID1, #ID2, #ID3') vs $('1X CLASS'). Which is faster?
Am looking into developing an iPhone native app using Titanium Developer Since this is
I looking into making a kind of robot testing browser. Like Selenium, but one
I am looking into adding unit tests at work. I used MbUnit in the
I'm looking into adding some unit tests for some classes in my data access

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.