Closed mhulse closed 10 years ago
So, if I'm understanding things here...
If I use the IE conditional comment, then IE 9, Safari 4.x (and iPhone 3.x), and Firefox 3.x won't get these basic styles:
// corrects block display not defined in IE6/7/8/9
'article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}' +
// adds styling not present in IE6/7/8/9
'mark{background:#FF0;color:#000}'
Maybe the IE conditional comment should be changed to:
<!--[if lte IE 9]> ... <![endif]-->
... That's "less than or equal to IE 9".
Then the only puzzle piece missing is how does one get the "basic styling" applied to Safari 4.x (and iPhone 3.x), and Firefox 3.x?
I suppose at that point, one would make the choice to 1) not use the conditional comments, 2) not care about older, non-old-IE, browsers or 3) keep conditional comments but use their own techniques to apply said basic styles to older, non-old-IE, browsers?
Feedback anyone?
I'd be more than happy to do a pull request.
Hehe, am I the only one that fixates on small details like this?
I'd love to know what the pros think in terms of how to optimally install this code.
Do we just target IE < 9 (to clarify, that's IE 6 - 8), or do we ditch the IE conditional comment and allow the code to work on the other old, non-IE, browsers mentioned in the README?
Again, I know this is small potatoes, just seems like it would be good to clarify the usage here.
@mhulse
From my point of view, it is best to do the styling via CSS. For example with normalize.css and leave the conditional comments. I will try to update the readme/go through all open issues tomorrow.
Correct me if I'm wrong, but I think just about every dev is using html5shiv only when they need to support IE <= 8, IE 9 inclusion is more a side-effect, or? So I'd suggest changing the first sentence to 'The HTML5 Shiv enables use of HTML5 sectioning elements in legacy Internet Explorer and provides basic HTML5 elements styling for Internet Explorer 6-9'.
How about a 'best practice' addition under Installation linking to normalize.css v1? Probably having two examples down there - one with HTML5 lte IE 8
support and normalize.css v1, the other with @mhulse suggestion for change of conditional comment to lte IE 9
explaining that it provides basic styling?
@aFarkas Connected to this issue, I'd also update the link for 'It also applies basic styling for HTML5 elements' as there has been additions since the linked commit.
@aFarkas Thanks so much for your help! I really appreciate it.
From my point of view, it is best to do the styling via CSS. For example with normalize.css and leave the conditional comments.
Ah, that's good news. I do use normalize.css when starting new projects. I would imagine most people do these days.
I will try to update the readme/go through all open issues tomorrow.
Let me know if I can help with anything.
@Volker-E I like those ideas.
My idea for changing the first sentence was:
The HTML5 Shiv adds basic HTML5 styling and enables the use of HTML5 sectioning elements in Internet Explorer 6-8.
But, I like your idea of providing two examples:
Connected to this issue, I'd also update the link for 'It also applies basic styling for HTML5 elements' as there has been additions since the linked commit.
I see the current link points here:
What would be the updated link?
I'm actually in the process of re-writing the README (not sure if it will help, but I figured it would save Alexander some time). If you could provide the new link, I'll incorporate it into my pull request.
@mhulse Current html5shiv.js master's commit link would be https://github.com/aFarkas/html5shiv/blob/e5da0a90797ae8b236d5901fe7b7b8b55b220847/src/html5shiv.js#L215-L220
@Volker-E Thanks!
How's this look:
The HTML5 Shiv enables the use of HTML5 sectioning elements and provides basic HTML5 styling in legacy versions of Internet Explorer.
... ... ... ...
$ bower install html5shiv --save-dev
This will clone the latest version of the HTML5 shiv into the components
directory at the root of your project and also create or update the file bower.json
which specifies your projects dependencies.
Download and extract the latest zip package from the HTML5 Shiv repository and copy dist/html5shiv.js
or dist/html5shiv-printshiv.js
into your project.
<head>
Include the HTML5 shiv at the top of your <head>
, before any stylesheets, in an IE conditional comment.
It is recommended to use HTML5 Shiv in conjunction with normalize.css v1
and use conditional comments to target Internet Explorer 6-8:
<!--[if lte IE 8]>
<script src="components/html5shiv/html5shiv.js"></script>
<![endif]-->
<link rel="stylesheet" href="normalize.css">
Alternatively, if you're not using normalize.css, you can also target IE 9 as HTML5 Shiv provides basic HTML5 element styling:
<!--[if lte IE 9]>
<script src="components/html5shiv/html5shiv.js"></script>
<![endif]-->
Feedback?
Also, there's a few spots in the README that say:
... IE8- ...
The minus is not clear to me. Does that mean only IE8, or is that IE 6-8? I'd like to make those spots more explicit.
I've posted my edits to the README here:
https://gist.github.com/mhulse/5737215
I'd love to get feedback before sending a pull request.
Based on conversation in #98, could the below line be improved?
HTML5 Shiv works as a simple drop-in solution. In most cases there is no need to configure HTML5 Shiv or use methods provided by HTML5 Shiv.
Makes sense to me, especially now that there's improved installation instructions.
In commit 5df33c1, @drzax made this change:
HTML5 Shiv works as a simple drop-in solution as described above. In most cases there is no need to configure HTML5 Shiv or use methods provided by HTML5 Shiv.
Now that there's an "installation" section, maybe that should read:
HTML5 Shiv works as a simple drop-in solution as described in the installation instructions above. In most cases there is no need to configure HTML5 Shiv or use methods provided by HTML5 Shiv.
I'm confused as to why normalise.css deserves a mention here.
The html5 shiv allows styling of elements that lt IE9 or others wouldn't be able to interpret. Where as normalise.css standardises the affects that the browsers default styles of html5 elements has.
Wether to use normalise.css or a CSS reset should be left to the developer. It shouldn't be a recommendation for this script as it has no impact on the html5 shiv works. And could lead to confusion about this scripts dependencies
@thomaswelton
Good points. I agree with you about the mentioning of normalize.css (though, Alexander did say that was the best route to take).
Along those same lines, I think the information about Bower is a bit specialized ... I guess it's good to let people know that it's available as a package for Bower, but should it really be featured as the main item under the installation instructions? I think not, but I'm biased, as I don't use Bower.
I digress ...
The point of me having opened this issue is because the current instructions are confusing.
You say:
The html5 shiv allows styling of elements that lt IE9 or others wouldn't be able to interpret.
Going back to my original question, the confusion are these lines from the current README:
The HTML5 Shiv enables use of HTML5 sectioning elements in legacy Internet Explorer and provides basic HTML5 styling for Internet Explorer 6-9, Safari 4.x (and iPhone 3.x), and Firefox 3.x.
... and:
Include the HTML5 shiv at the top of your
<head>
in a conditional comment before any stylesheets.<!--[if lt IE 9]> <script src="components/html5shiv/html5shiv.js"></script> <![endif]-->
With that said ...
Are you saying that I should change this (in my version of the README):
<head>
Include the HTML5 shiv at the top of your <head>
, before any stylesheets, in an IE conditional comment.
It is recommended to use HTML5 Shiv in conjunction with normalize.css v1
and use conditional comments to target Internet Explorer 6-8:
<!--[if lte IE 8]>
<script src="components/html5shiv/html5shiv.js"></script>
<![endif]-->
<link rel="stylesheet" href="normalize.css">
Alternatively, if you're not using normalize.css, you can also target IE 9 as HTML5 Shiv provides basic HTML5 element styling:
<!--[if lte IE 9]>
<script src="components/html5shiv/html5shiv.js"></script>
<![endif]-->
... to this:
<head>
Include the HTML5 Shiv at the top of your <head>
, before any style sheets, in an IE conditional comment:
<!--[if lte IE 8]>
<script src="components/html5shiv/html5shiv.js"></script>
<![endif]-->
Or something like that ... Ya?
It's much simpler.
Ok, I've removed the info about normalize.css and added the verbiage about it being a "drop-in solution":
@aFarkas FYI, my version of the README has a lots of minor editing tweaks (grammar, punctuation, markdown, other). Obviously, once I do a pull request, you'll be able to compare the diffs.
@mhulse and other
I didn't looked into the details of your readme. It's better to make a pull request and walk through each change. I have updated the readme.
In general: I don't think, that we should explain everything in detail. Usage is very basic and if we start to explain every possibilty and the inner workings, people will get confused.
Here is what I have changed
@mhulse
Would you make a pull request for your changes based on the new readme? As I said, I haven't fully looked over your changes. We can than discuss all changes on this PR.
I'm probably missing something obvious here ... If so, let me apologize in advance for my ignorance.
With that said, could someone help me to understand why the README says this in one spot:
... and a bit further down, it says:
Just curious if using
<!--[if lt IE 9]>
(to be clear, that's "less than IE 9, right?) will cancel out the scripts positive effects on Internet Explorer 9, Safari 4.x (and iPhone 3.x), and Firefox 3.x?I've gotten the approval to drop IE < 9 for one of my latest projects, and I'm trying to determine if I can stop using html5shiv; if it's meant to only be applied to IE < 9, then I wont use it ... On the other hand, if it helps to make IE9 (and the others mentioned above) behave better, then I'd gladly keep it in my templates. :+1:
Anyway, hoping someone can shed some light.
Many thanks for the awesome code!!!! Amazing stuff!!!!