google-friend Posted July 7, 2009 Share Posted July 7, 2009 I have make a css, I make a lot of changes on the global.css. Now I have two css. Some of the codes are the same on the two css, but just the color is different. How can I make the site read my css first? And only take the codes I have changes instead the global.css?Is there a way to do it or I have to combine two css together? Link to comment Share on other sites More sharing options...
rocky Posted July 7, 2009 Share Posted July 7, 2009 I think you will need to import your CSS last, so that it overrides any other imported CSS files. You could also try adding !important after your styles to prevent them being overridden. Link to comment Share on other sites More sharing options...
google-friend Posted July 7, 2009 Author Share Posted July 7, 2009 I think you will need to import your CSS last, so that it overrides any other imported CSS files. You could also try adding !important after your styles to prevent them being overridden. Thank you for your help. How can I import mine list? Do I need to go to each tpl and put import mine.css? Link to comment Share on other sites More sharing options...
glosticks Posted July 7, 2009 Share Posted July 7, 2009 you joust need to alter header.tpl, your file should go after the global.cssregardsChris Link to comment Share on other sites More sharing options...
lotusutol Posted July 7, 2009 Share Posted July 7, 2009 I have make a css, I make a lot of changes on the global.css. Now I have two css. Some of the codes are the same on the two css, but just the color is different. How can I make the site read my css first? And only take the codes I have changes instead the global.css?Is there a way to do it or I have to combine two css together? Not sure if you're comfortable to hack into header.php but this is how I do it.For your case I would add another line after line 9.Line 9 (before addition)$css_files[_THEME_CSS_DIR_.'global.css'] = 'all'; After change (see the extra line?) $css_files[_THEME_CSS_DIR_.'global.css'] = 'all'; $css_files[_THEME_CSS_DIR_.'my_modified_file.css'] = 'all'; Use your filename in place of 'my_modified_file.css'Placing your modified css file in the second line will override the first css file.I would then upload a copy of my css file separate to the original file under themes/theme_name/css.No need to combine the two css files together!Hope this helps.If someone else has a better idea please let me know. Link to comment Share on other sites More sharing options...
Star Posted July 7, 2009 Share Posted July 7, 2009 This is another way of doing it.Put your "my.css and the global.css in the same folder, In the global.css, at the beginning (first line), add the following codesimport 'my.css';/* MY CSS */........ Therefore, the my.css has priority over the global.css! You don't need to combine two css together. Link to comment Share on other sites More sharing options...
google-friend Posted July 7, 2009 Author Share Posted July 7, 2009 Thank you all for helping. :-) Link to comment Share on other sites More sharing options...
lotusutol Posted July 7, 2009 Share Posted July 7, 2009 Aha that is a better idea!Thanks I learnt something new today. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now