Conditional IE Classes, Browser defaults + conditional logic moved to functions.php #20

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
2 participants

Some minor additions for mobile and browser support:

  1. Conditional IE classes will help child theme authors support older browsers with more accuracy from the stylesheet. See - http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/
  2. Ask Internet Explorer and Chrome to use the latest rendering engine.
  3. Modified meta viewport to prevent mobile browser scaling.

Moved conditional header image logic from the template file to a new function, twentytwelve_get_header_image(), in functions.php

Moved front end css and script callbacks from header.php to twentytwelve_scripts() in functions.php.

Collaborator

lancewillett commented Apr 18, 2012

Hi Jeff and thanks for stopping by and adding the pull requests and notes.

Moved front end css and script callbacks from header.php to twentytwelve_scripts() in functions.php.

We discussed the enqueue on the core Trac ticket quite a bit, and came to the agreement to keep it in header.php for simplicity. I don't think moving the header code to a function is an improvement — I think it'd make sense if it were used in more than one place in the template files, to make it easier to maintain.

Ask Internet Explorer and Chrome to use the latest rendering engine.

Why is that needed? (I don't think it is.)

Modified meta viewport to prevent mobile browser scaling.

Yes, we were missing the initial scale bit—thanks for the nudge on that. I'll add that part in shortly.

Conditional IE classes will help child theme authors support older browsers with more accuracy from the stylesheet.

In my opinion this is out of scope for a default theme like Twenty Twelve — it's main purpose is not to be a super-awesome parent theme, so if child themes want to add in the classes on the html element they should override header.php.

Also, you should stop worrying so much about the older IEs. :)

Collaborator

lancewillett commented Apr 18, 2012

Thanks Lance. I should really be using Trac if I'm going to attempt to contribute.

My 2 cents is that the default theme is a way many people like myself first learn to build a theme. I don't think views should ever contain logic, and it would be best to teach people good practices.

Some of the other elements I added are from HTML5 Boilerplate, also much of which is just best practices. Here the bit about rendering engines - http://html5boilerplate.com/html5boilerplate-site/built/en_US/docs/html/#make-sure-the-latest-version-of-ie-is-used

I agree about old Explorer, but it's good to have the tools to whip it into shape when needed.

Thank you for the consideration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment