EllisLab text mark
Advanced Search
     
@import screen.css doens’t work
Posted: 23 April 2008 05:37 PM
Avatar
Joined: 2008-04-23
79 posts

I have the same problem as in this topic but I never found an answer:
http://ellislab.com/forums/viewthread/67615/

What I want is one screen.css in the HTML and that screen.css imports all other css files. This way you don’t have to use conditional comments in you HTML and you only have to edit one file when adding or removing css files.

My screen cc files is over here:
http://ischagast.nl/jhs/index.php?css=stylesheets/screen

You can see that the path to the css file isn’t correct and the css file is made:
http://ischagast.nl/jhs/index.php?css=stylesheets/styleguide

What do I have to do too make my screen.css work?

 
Posted: 23 April 2008 05:43 PM   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2004-05-15
29075 posts

If you want to use EE tags in a style sheet, you must run that stylesheet through the EE parser. In particular, you may not use the {stylesheet} variable. Try this:

http://ischagast.nl/jhs/index.php/stylesheets/screen 

That should parse your tags.

 
Posted: 23 April 2008 05:53 PM   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2008-04-23
79 posts
Ingmar Greil - 23 April 2008 09:43 PM

If you want to use EE tags in a style sheet, you must run that stylesheet through the EE parser. In particular, you may not use the {stylesheet} variable. Try this:

http://ischagast.nl/jhs/index.php/stylesheets/screen 

That should parse your tags.

Ok in the HTML file I use this:

http://ischagast.nl/jhs/index.php/stylesheets/screen 

And you’re right now everything workst fine.
But what if this is my test url and the definitive url is something else.

http://ischagast.nl/jhs/ 

Than I have to change this url in every template file or is that not right?

http://ischagast.nl/jhs/index.php/stylesheets/screen 
 
Posted: 23 April 2008 06:03 PM   [ # 3 ]   [ Rating: 0 ]
Avatar
Joined: 2004-05-15
29075 posts
IschaGast - 23 April 2008 09:53 PM

Than I have to change this url in every template file or is that not right?

http://ischagast.nl/jhs/index.php/stylesheets/screen 

You could use a global variable, or simply the {path} variable, instead of {stylehseet}.

 
Posted: 23 April 2008 06:15 PM   [ # 4 ]   [ Rating: 0 ]
Avatar
Joined: 2008-04-23
79 posts
Ingmar Greil - 23 April 2008 10:03 PM
IschaGast - 23 April 2008 09:53 PM

Than I have to change this url in every template file or is that not right?

http://ischagast.nl/jhs/index.php/stylesheets/screen 

You could use a global variable, or simply the {path} variable, instead of {stylehseet}.

Now I use this in my HTML

<link href="{path=stylesheets/screen}" rel="stylesheet" media="screen" type="text/css" title="Standaard" /> 

That’s a great solution, verything now workst just fine.

Thanks a lot!

 
Posted: 23 April 2008 06:17 PM   [ # 5 ]   [ Rating: 0 ]
Avatar
Joined: 2004-05-15
29075 posts

Great it’s working for you. It is slightly “heavier” than using {stylesheet}, because it is parsed by the regular EE parser, but this should be negligible in everyday use.