css import
Posted: 27 June 2008 04:14 AM   [ Ignore ]  
Summer Student
Total Posts:  1
Joined  06-27-2008

hi

when i have one master css file which is importing other css files, how do i do it in EE ?

in master css i have:

@import ‘lib/reset.css’;
@import ‘lib/typography.css’;
@import ‘lib/grid.css’;
@import ‘lib/forms.css’;

do i have to create temaplte for every css and use @import ‘{path}’;  ?

thanks

Profile
 
 
Posted: 27 June 2008 08:41 AM   [ Ignore ]   [ # 1 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1055
Joined  06-05-2007

Likely.  Did you try it?  Otherwise you’ll have to provide an absolute URL to your imported CSS files, but that defeats the purpose of using EE for CSS.

 Signature 

grantmx | designs - design | development | photography | consulting | ee pro profile

Profile
 
 
Posted: 24 September 2008 05:53 PM   [ Ignore ]   [ # 2 ]  
Summer Student
Total Posts:  3
Joined  03-04-2008

Sorry to bring up an old topic.  I’ve done this style of importing, but I have a question concerning it.  Basically I have one css file that is called, which imports three more.  The issue I’ve come across is that the first css has to be parsed meaning you can’t use {stylesheet=site/css} you have to use {path=site/css}.  Then in that file you can do things the other way.  See below.

<link rel="stylesheet" type="text/css" media="screen" href="{path=main/style_main}" />


@import '{stylesheet=main/style_reset}';
@
import '{stylesheet=main/style_layout}';
@
import '{stylesheet=main/style_typography}';

Works great on my browser.

However, according to the doc http://expressionengine.com/docs/templates/globals/stylesheet.html

When the stylesheet tag is used, “text/css” MIME headers will be sent to the browser. Some browsers will not treat the CSS file as such without these headers.

Is this true?  I thought that since EE feeds the browser the text

<link rel="stylesheet" type="text/css" media="screen" href="http://www.hello.com/index.php/main/style_main/" />


Wouldn’t this still serve it as a css mime type.  Does feeding the browser

http://www.hello.com/index.php?css=main/style_main.v.1222313434

really make a difference?

Profile
 
 
Posted: 24 September 2008 06:11 PM   [ Ignore ]   [ # 3 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1055
Joined  06-05-2007

No, not really.  I think that statement was more of a general FYI.

 Signature 

grantmx | designs - design | development | photography | consulting | ee pro profile

Profile
 
 
Posted: 24 September 2008 11:58 PM   [ Ignore ]   [ # 4 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15489
Joined  05-15-2004

{stylesheet} vs. {path} is mainly a caching issue. I have used both, where appropriate, and never had any issues.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 25 September 2008 10:40 AM   [ Ignore ]   [ # 5 ]  
Summer Student
Total Posts:  3
Joined  03-04-2008

Great, thanks for your replies.

Profile
 
 
Posted: 26 September 2008 06:52 AM   [ Ignore ]   [ # 6 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1660
Joined  06-01-2007

How you can hide your CSS from others? I never done this but i would be interested on how to do that. Otherwise, what you have to put into mainpage and what into second template that might import that real css-file for use?

Thanks:
- Tuittu

 Signature 

Using EE Commercial 1.6.6 Build 20081114  | EE forum 2.1.1 Build 20081028 | EE MSM 1.1 Build: 20081024

Profile
 
 
Posted: 26 September 2008 07:26 AM   [ Ignore ]   [ # 7 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15489
Joined  05-15-2004
tuittu - 26 September 2008 06:52 AM

How you can hide your CSS from others?

You can’t, the same way you can’t hide your HTML code.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 26 September 2008 08:03 AM   [ Ignore ]   [ # 8 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1660
Joined  06-01-2007
Ingmar Greil - 26 September 2008 07:26 AM
tuittu - 26 September 2008 06:52 AM

How you can hide your CSS from others?

You can’t, the same way you can’t hide your HTML code.

Yeah. But this i found for quick googleting =) Did not see what that is but i didnt get html out of that page, heh.

Cheers:
- Tuittu

 Signature 

Using EE Commercial 1.6.6 Build 20081114  | EE forum 2.1.1 Build 20081028 | EE MSM 1.1 Build: 20081024

Profile
 
 
Posted: 26 September 2008 08:20 AM   [ Ignore ]   [ # 9 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15489
Joined  05-15-2004

Blah, javascript obfuscation? That’s so 1999. Really, that’s a thread for another day, though.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 26 September 2008 09:38 AM   [ Ignore ]   [ # 10 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1660
Joined  06-01-2007
Ingmar Greil - 26 September 2008 08:20 AM

Blah, javascript obfuscation? That’s so 1999. Really, that’s a thread for another day, though.

tongue rolleye Still possible to make things harder for common surfers!

EDIT: Why ppl use importing CSS?

 Signature 

Using EE Commercial 1.6.6 Build 20081114  | EE forum 2.1.1 Build 20081028 | EE MSM 1.1 Build: 20081024

Profile
 
 
Posted: 26 September 2008 09:41 AM   [ Ignore ]   [ # 11 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15489
Joined  05-15-2004

Sure, and effectively hide your whole site from Google & Co? Not so smart in my book. Also, a site that’s trying to mess with my browser history or context menu won’t make it into my bookmarks, put friendly.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 26 September 2008 09:44 AM   [ Ignore ]   [ # 12 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1660
Joined  06-01-2007
Ingmar Greil - 26 September 2008 09:41 AM

Sure, and effectively hide your whole site from Google & Co? Not so smart in my book. Also, a site that’s trying to mess with my browser history or context menu won’t make it into my bookmarks, put friendly.

Thats very true. Did not come to mind at all, but as said, it was just a fast googleting!

 Signature 

Using EE Commercial 1.6.6 Build 20081114  | EE forum 2.1.1 Build 20081028 | EE MSM 1.1 Build: 20081024

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 65086 Total Logged-in Users: 37
Total Topics: 82224 Total Anonymous Users: 17
Total Replies: 441922 Total Guests: 192
Total Posts: 524146    
Members ( View Memberlist )