...

View Full Version : Cant hide/outcomment @import from safari



Jesper Møller
06-10-2010, 08:39 PM
If i have a stylesheet to import stylesheett and try to hide/outcommen one of those safari insist on reading it annyway :confused:

@import url("colours.css");
/* @import url("lightcolours.css"); */

Why cant i hide/outcomment the lightcolours.css ??

Apostropartheid
06-10-2010, 10:52 PM
Why not just delete it?

Jesper Møller
06-10-2010, 11:01 PM
1. becaus im wondering why it reads it :confused:

2.
Im working on at style where site admin shud have the choise between normal and light version, so was thinking of:

@import url("colours.css");
/*
@import url("lightcolours.css");
Enable lightcolours.css stylesheet import for alternativ light version
*/

insted of sending 2 versions ;)

Scriptet
06-10-2010, 11:45 PM
Is this within <style> tags?

Also it would just make sense to use <link> rather than @import which was just the old way to avoid very old browsers but it's usage is pretty redundant now..then you can comment them out using normal HTML comment tags

Jesper Møller
06-10-2010, 11:49 PM
No ... its inside a stylesheet

i link to one stylesheet and frome that import multiple stylesheets

Scriptet
06-10-2010, 11:58 PM
I just tested and I can confirm commenting out @import within an external stylesheet works fine in Safari 4 on Win XP for me?

What version of Safari are you using and can you post up the whole code?

Also might be worth running your CSS (http://jigsaw.w3.org/css-validator/) and HTML (http://validator.w3.org/) through the validator

Jesper Møller
06-11-2010, 12:06 AM
Safari 4.0.5 on mac OSX 10.5.8

Im working on a phpBB forum style

this is the main stylesheet code.. and it do validate


/*
phpBB 3.0 Style Sheet
------------------------------------------------------------------------
Style name: Psychedelia
Based on style: proSilver Special Edition
Original author: subBlue ( http://www.subBlue.com/ )
Modified by: JGOM © 2010 ( http://www.phpBB2.dk/ )

Copyright 2006 phpBB Group ( http://www.phpbb.com/ )
------------------------------------------------------------------------
*/

@import url("common.css");
@import url("links.css");
@import url("content.css");
@import url("buttons.css");
@import url("cp.css");
@import url("forms.css");
@import url("tweaks.css");
@import url("changes.css");
@import url("colours.css");


/*
@import url("lightcolours.css");
Enable lightcolours.css stylesheet import for
alternativ light version of Psychedelia
*/

Jesper Møller
06-11-2010, 12:12 AM
I have tested difrent versions of the outcomment like

/* @import url("lightcolours.css"); */

Cant get Safari to overlook it

Scriptet
06-11-2010, 12:18 AM
Is there any chance of a link? At least I can then test/debug it from my end..if you don't want SE to pick it up you can use tinyurl or just PM it me if worried otherwise.

Jesper Møller
06-11-2010, 12:22 AM
It aint online yet ... but i can see if i can do somthing

Jesper Møller
06-11-2010, 12:31 AM
I have don the same to a live board now .. same result .. safari on mac shows the outcomment testcolours.css

http://www.dansk-kanin.dk/index.php
Color in copyright info at the bottom shud be purple but in the test stylesheet i made it blue

main stylesheet

/* phpBB 3.0 Style Sheet
------------------------------------------------------------------------
Style name: Purple Rabbit
Based on style: proSilver Special Edition
Original author: subBlue ( http://www.subBlue.com/ )
Modified by: © JGOM, 2010 ( http://www.phpBB2.dk/ )

Copyright 2006 phpBB Group ( http://www.phpbb.com/ )

The Purple Rabbit style is based on the proSilver SE style and use the
original proSilver SE stylesheets with the exception of the colours.css.
All code changes to the original proSilver SE stylesheets are made in
the changes.css The whole Purple Rabbit style is in the colours.css.
------------------------------------------------------------------------
*/

@import url("common.css");
@import url("links.css");
@import url("content.css");
@import url("buttons.css");
@import url("cp.css");
@import url("forms.css");
@import url("tweaks.css");
@import url("changes.css");
@import url("colours.css");

/* @import url("testcolours.css");
Test style*/

testcolours.css:

/* Test styles
---------------------------------------- */
.copyright, .copyright a {
color: #0000ff !important;
}

.copyright a:hover {
color: #ff0000 !important;
}

Jesper Møller
06-11-2010, 12:34 AM
When looking in safari's developer tools i can see the generated/imported stylesheet

it ends like this:

/* /* Test styles
---------------------------------------- */
.copyright, .copyright a {
color: #0000ff !important;
}

.copyright a:hover {
color: #ff0000 !important;
}
Test style*/

Apostropartheid
06-11-2010, 03:27 PM
Remove all comments from the imported stylesheet. This may be a flaw in WebKit's CSS comment rendering.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum