Skip to content
This repository has been archived by the owner on Apr 28, 2020. It is now read-only.

corysimmons/selectivizr2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Selectivizr 2

✨ Now with maintenance! ✨

What happened to the old project?

Keith Clark was eaten alive by sabre-tooth rattlesnakes or something. Who knows?

Good on him for originally inventing this though. 🍻

Why support old IE?

Why completely turn your back on it? I'm not saying give it special attention (unless you're making a website for the most populated country in the world), but why not toss some polyfills in conditional comments and at least give the poor bastards who are stuck on IE6-IE8 something to look at.

It requires almost 0 effort on your part and can make your website viewable to a lot of people.

What is Selectivizr?

Selectivizr is a polyfill that makes IE6-8 work with most CSS3 selectors (like :nth-child).

Installation

  • bower install --save selectivizr2

Usage

To use the library, you'll need to include the latest jQuery 1.x.x.

Then add the following conditional comment after your stylesheets and jQuery:

<!--[if lt IE 9]>
  <script src="selectivizr2.js"></script>
<![endif]-->

Example

<!doctype html>
<html>
  <head>
    <title>Selectivizr Test</title>
    <link rel="stylesheet" href="style.css">
  </head>
  <body>

    <div>Hello World</div>

    <script src="https://code.jquery.com/jquery-1.12.3.min.js"></script>
    <!--[if lt IE 9]>
      <script src="selectivizr2.js"></script>
    <![endif]-->
  </body>
</html>
div:nth-of-type(1) {
  background: blue;
}

That's it. That's how polyfills typically work. Load the .js and bam!

The only people downloading this file will be people below IE9. This means we're not punishing people using modern browsers.

How can I test my site in IE7-IE8?

  • Use a Virtual Machine
    • Learn how to install and setup VMs with VirtualBox. It's cross-platform and there are probably lots of YouTube videos on it so grab a ☕ and enjoy.
    • Microsoft offers Windows images specifically so you can try out old browsers.
    • IEVMS is the incredibly easy way to get/maintain these VMs.
  • BrowserStack is expensive and slow, but if you can't figure out the other techniques you can use it. I highly suggest you figure out how to use VMs though. It's a skill worth learning.

I'm not even sure how to test in IE6 anymore, but... seriously?

Why shouldn't I use X?

Caveats

TBH, I'm not an amazing JS developer yet, so I really have no idea wtf is going on. I'm happy to merge stuff as long as it seems legit but I'm probably not going to spend a ton of time working on this codebase.

About

💎 Selectivizr maintained.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 45.0%
  • HTML 35.0%
  • CSS 20.0%