Alternate style sheets

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • User

    Alternate style sheets

    If I want to provide alternate stylesheets (eg red.css, green.css), is
    it better to put all the stuff that is common to both sheets in a
    separate css file (eg basic.css) and use @import at the top of each
    alternative?
    Does basic.css get downloaded each time the style is changed, or just
    once (with the first view)?
    Does it matter? - Is there another way? -
    --
    tenxng@ban.arg. nh
    Email addy ROT13'd
  • Tim

    #2
    Re: Alternate style sheets

    On Sun, 24 Apr 2005 01:15:27 +0000, User wrote:
    [color=blue]
    > If I want to provide alternate stylesheets (eg red.css, green.css), is it
    > better to put all the stuff that is common to both sheets in a separate
    > css file (eg basic.css) and use @import at the top of each alternative?[/color]

    That's one of the things that I do.
    [color=blue]
    > Does basic.css get downloaded each time the style is changed, or just
    > once (with the first view)?[/color]

    If the server and client are set up right, they fetch what they need once,
    and use their cache. If they're set up badly, they may fetch over and
    over, though I've not seen that. I have seen those that check whether
    they should fetch it each time. Though, again, that seems due to poor
    settings.

    Even MSIE gets it half right. It only downloads the files it needs once
    (i.e. your included one in several alternate stylesheets). But it does
    download all of your stylesheets, even though it doesn't support using
    alternate stylesheets.
    [color=blue]
    > Does it matter? - Is there another way?[/color]

    Probably not, and yes. Though I don't think that anything is going to be
    any better.

    --
    If you insist on e-mailing me, use the reply-to address (it's real but
    temporary). But please reply to the group, like you're supposed to.

    This message was sent without a virus, please delete some files yourself.

    Comment

    • junk

      #3
      Re: Alternate style sheets

      Tim wrote:[color=blue]
      > On Sun, 24 Apr 2005 01:15:27 +0000, User wrote:
      >
      >[color=green]
      >>If I want to provide alternate stylesheets (eg red.css, green.css),[/color][/color]

      The default Xaraya cms install, includes different theme style sheets,
      they are all included, and are selected by an "on click" javascript
      action when the colour button is clicked. If your user has js disabled
      they will still get the default css.

      Comment

      • Steve Fulton

        #4
        Re: Alternate style sheets

        User wrote:
        [color=blue]
        > If I want to provide alternate stylesheets (eg red.css, green.css), is
        > it better to put all the stuff that is common to both sheets in a
        > separate css file (eg basic.css) and use @import at the top of each
        > alternative?
        > Does basic.css get downloaded each time the style is changed, or just
        > once (with the first view)?
        > Does it matter? - Is there another way? -[/color]

        You could use basic.css as a *persistent* style sheet, red.css as a
        *preferred* style sheet and green.css as an *alternate* style sheet.

        <link rel="stylesheet " type="text/css" href="basic.css ">
        <link rel="stylesheet " type="text/css" href="red.css" title="Red">
        <link rel="alternate stylesheet" type="text/css" href="green.css "
        title="Green">

        14.3 External style sheets; "HTML 4.01 Specification";
        W3C Recommendation; 24 December 1999;
        <http://www.w3.org/TR/REC-html40/present/styles.html#h-14.3>

        --
        Steve

        Everywhere is walking distance if you have the time. -Steven Wright

        Comment

        • Gus Richter

          #5
          Re: Alternate style sheets

          User wrote:[color=blue]
          > If I want to provide alternate stylesheets (eg red.css, green.css), is
          > it better to put all the stuff that is common to both sheets in a
          > separate css file (eg basic.css) and use @import at the top of each
          > alternative?
          > Does basic.css get downloaded each time the style is changed, or just
          > once (with the first view)?
          > Does it matter? - Is there another way? -[/color]

          There is no sense in repeating the same declarations several times and
          the download is only once, so it makes good sense. Since not all
          browsers support alternate stylesheets, you may wish to consider another
          method. With just a little script and only one stylesheet you can change
          classes and effectively provide alternate styles rather than alternate
          stylesheets. Here is an example:

          Disregard the floating box which describes an Opera redraw bug.

          --
          Gus

          Comment

          • User

            #6
            Re: Alternate style sheets

            In article <TYCdnc8iKPxJSv bfRVn-tA@golden.net>, gusrichter@nets cape.net
            says...[color=blue]
            > User wrote:[/color]
            <snip>[color=blue][color=green]
            > > Does basic.css get downloaded each time the style is changed, or just
            > > once (with the first view)?
            > > Does it matter? - Is there another way? -[/color][/color]
            <snip>[color=blue]
            > ... With just a little script and only one stylesheet you can change
            > classes and effectively provide alternate styles rather than alternate
            > stylesheets. Here is an example:
            > http://www.home.golden.net/~richterf...4_Opera_1.html
            > Disregard the floating box which describes an Opera redraw bug.
            >
            >[/color]
            Thanks Gus, I'll study that. That Opera redraw bug is still there in
            v8.0.
            --
            tenxng@ban.arg. nh
            Email addy ROT13'd

            Comment

            Working...