using more than one css in a theme folder

Last post 11-19-2007 10:20 AM by Adam.Kahtava. 1 replies.

Sort Posts:

  • using more than one css in a theme folder

    11-17-2007, 11:33 PM
    • Participant
      850 point Participant
    • zaladane
    • Member since 06-19-2007, 6:44 AM
    • California
    • Posts 194

    Hello,

    I would like to have several pages using two different themes [red] and [blue] for example , but i would like to have a base.css file that can be shared by both without having to defined identical section in both of them.

    To give you a better picture i would have the [red] theme folder with two css files : red.css and base.css . And the blue one with 2 css asd well : blue.css and base.css. is there any way i can define a global stylesheet to be used by both pages

    for common sections without having to duplicate base.css?  I also noticed that in visual studio 2008 beta2, having two css files in the theme folder generated an error (The class or cssValue is not defined), although it doesn;t keep it to render itself correctly.

    Is it a bad practice to have multiple css files for a theme?

    Thanks 

    Still in search of the far side.
    --------------------------------
    A code snippet may help you, but a reference to the doc will teach you something for later...Don't just try to solve somebody's problem with a snippet, teach him how to solve it.
  • Re: using more than one css in a theme folder

    11-19-2007, 10:20 AM
    Answer
    • Contributor
      4,775 point Contributor
    • Adam.Kahtava
    • Member since 10-18-2006, 10:14 AM
    • Canada
    • Posts 927

    Using multiple CSS files is a great idea, it facilitates reuse and maintainability. However; if you have a high traffic site (like an e-commerce site), you'll probably want to combine your CSS into a single file for better performance, but you would typically only do this on your production site.

    If you want to have a CSS file that's inherited by other Style Sheets, then you'll probably have to move your Style Sheet outside the App_Theme directory and into a more general CSS directory. As you've pointed out (Themes promote CSS duplication), ASP.NET Themes provide an over simplistic approach to CSS, which hampers the use of Style Sheets.

Page 1 of 1 (2 items)