Jump to content

Archived

This topic is now archived and is closed to further replies.

ndiggity

Is there a guideline for CSS usage for 2.3.4? Help with updating style tags.

Recommended Posts

I'd like to preface my question by saying that I'm certainly not an expert programmer and have more or less learned the basics of php by installing addons and modifying my store.  I've learned a lot and of course have a lot more to learn.  I'm working on updating a few 2.2 addons to look correct in my 2.3.4 store.  I'd like to update the style of the former 2.2 addon pages to conform with the 2.3.4 css but I'm confused about how much to use stylesheet.css vs inline styles.  

 

I assumed that all the stock 2.3.4 store pages wouldn't have any (or at least virtually any) inline style tags but there seems to be a decent amount.  And many of the inline styles that are present are repeated regularly.  For example, <table border="0" width="100%" cellspacing="0" cellpadding="2"> is shows up 146 times in the stock installation.  Why not assign a class to these properties or if it really is a one off style assign an id for the css?  As I mentioned, I'm an amateur at best and I'm probably missing something obvious to the more experienced programmers.

 

Can anyone please give me guidance on which styles to leave inline and which to use the stylesheet.css when updating the former 2.2 addons?  Thank you very much :-)

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

click on basics for osc 2.3+ design in my signature

 

Thank you for your help.  I just want to make sure I understand.  In the thread you mentioned, you indicate "2.3+ design is DIV/CSS based"... So, is it correct that styles that can be applied to div tags are the ones found in stylesheet.css while styles that are applied to other elements (not div tags) are found inline?

Share this post


Link to post
Share on other sites

Its a bit of a mix, but most elements are controlled via stylesheets, the inline styles used are mostly for table's.

 

Css files for 2.3.4:

 

- stylesheet.css
- ext/jquery/ui/redmond/jquery-ui-1.11.0.min.css
- ext/960gs/960_24_col.css

Share this post


Link to post
Share on other sites

I'm confused about how much to use stylesheet.css vs inline styles.

If you might need to style something else the same way, use a stylesheet. If it's definitely going to be a one-off thing, you can use inline styling. In general, you want to put as much styling as possible in a separate file, so that your HTML code isn't so cluttered up, and there's only one place to make a change.

 

I assumed that all the stock 2.3.4 store pages wouldn't have any (or at least virtually any) inline style tags but there seems to be a decent amount.

Yeah, there's still a lot of old HTML code (without modern CSS usage) around in osC, that no one has gotten around to cleaning up. Most of it probably won't be touched until someone is fixing or extending something else, and happens to be in there anyway, or inline HTML attributes such as for <table> start producing browser warnings or errors.

 

Don't regard the current styling as some sacred edict. It's just a mixture of old and new.

Share this post


Link to post
Share on other sites

If you might need to style something else the same way, use a stylesheet. If it's definitely going to be a one-off thing, you can use inline styling. In general, you want to put as much styling as possible in a separate file, so that your HTML code isn't so cluttered up, and there's only one place to make a change.

 

Yeah, there's still a lot of old HTML code (without modern CSS usage) around in osC, that no one has gotten around to cleaning up. Most of it probably won't be touched until someone is fixing or extending something else, and happens to be in there anyway, or inline HTML attributes such as for <table> start producing browser warnings or errors.

 

Don't regard the current styling as some sacred edict. It's just a mixture of old and new.

 

Thank you for your explanation.  That makes perfect sense.  I think I have a clear understanding on how I will proceed with re-styling the pages I need to update.  Thank you!

Share this post


Link to post
Share on other sites

×