[thelist] hiding CSS

Erik Mattheis gozz at gozz.com
Sun Apr 14 22:26:01 CDT 2002


At 10:36 PM -0400 4/14/02, aardvark wrote:
>i do disagree with you, primarily because @import *isn't* necessarily a
>hack... it's actually akin to include and extremely useful for compiling CSS
>files so you can have one handle layout, another do colors, another control
>type, etc...
>
>however, currently, many of us use @import to prevent older browsers from
>seeing code that would otherwise break them..

Agreed, I'm not saying it's _always bad_ to use @import, but the
simple fact is that it's an insufficient method in some cases: there
are _major_ differences in CSS interpretation among browsers that
understand @import. If you don't run into those differences, fine,
use it ... but apparently Duncan has run into one of the situations
where you can't.

>if we switched to JS instead of @import, we'd now punish not just users of
>older browsers, but users without JS enabled on their primary browsers -- like
>me...

Well, you may be in the position to confirm why I consider requiring
JavaScript in order to see the styled HTML: People who don't use
JavaScript enabled browsers don't care about the style of the
presentation.

So what's wrong with not showing them styles? Certainly you're not
advocating a site that requires CSS ...  that would be unlike you!

>try modifying the syntax of the @import call to see what causes to be
>seen/hidden from all desired browsers...  things like removing the quotes or
>the parentheses, or using @import to @import another sheet, etc...

If it works, great ... but there are times when it will not.

At 2:42 PM +1200 4/15/02, Duncan O'Neill wrote:
>I'm one of those who will disagree with you.:-)
[...]
>Another problem is the number of forks required.  A comprehensive
>javascript browser-sniffer has to fork for platform, browser, & version,
>which is going to take multiple lines.

Indeed ... I didn't say it was an eloquent solution, but that it may
be the _only_ solution. I'm OK with always doing it with JS for the
reason stated above, when I've done it I've done in it a manner which
only requires me to edit one file if it has to change; and used
capability testing in the "sniffer" except when capability testing
wasn't sufficient ... but you gots to do what you gots ta do.

Maybe someone else can suggest modifying the syntax of @import - but
if that doesn't work, the only solutions left (that I can think of)
are

a. use a combination of JavaScript and @import
b. require JavaScript
c. Forget about what you were trying to do



--

__________________________________________
- Erik Mattheis

(612) 377 2272
http://goZz.com/

__________________________________________



More information about the thelist mailing list