GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Some minor additions for mobile and browser support:
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.
conditional html classes
move logic and stylesheet enqueue calls from header.php to functions.php
ask browsers for latest rendering engine + prevent mobile browser sca…
Hi Jeff and thanks for stopping by and adding the pull requests and notes.
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. :)
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.