Skip to content

Modern-IE/Tailwind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Tailwind for IE6 🦖

Bringing the modern utility-first CSS revolution to the darkest ages of the web: Internet Explorer 6.

Because your enterprise legacy system built in 2003 deserves to look like it was built in 2026.

Features

This engine parses standard Tailwind CSS classes natively in JScript 5.x and maps them directly to IE6-compatible CSS properties, VML (Vector Markup Language), and DirectX Filters.

  • Arbitrary Values Support: Write classes like w-[250px], bg-[#ff0099], text-[13px], rounded-[10px]!
  • Full Color Palette: Comprehensive mapping of Tailwind colors.
  • Spacing & Sizing: Margins, padding, dimensions, and percentage/fractional widths (w-1/2, w-full).
  • Responsive Breakpoints: sm:, md:, lg:, xl:, 2xl: handled dynamically via JS window resizing.
  • Pseudo-classes: hover:, focus:, active:, and even group-hover:!
  • DirectX Filters (Polyfills):
    • opacity-50 (uses alpha(opacity))
    • shadow-lg (uses DXImageTransform.Microsoft.Shadow)
    • blur-md (uses DXImageTransform.Microsoft.Blur)
    • bg-gradient-to-r from-red-500 to-blue-500 (uses Microsoft.gradient)
    • rotate-45, scale-150 (uses Microsoft.Matrix via math trigonometrics)
  • True Rounded Corners: rounded-lg, rounded-full achieved dynamically injecting IE VML (<v:roundrect>).
  • Fake Flex/Grid: grid-cols-3 automatically calculates percentage widths and applies float: left. divide-y and space-x-4 handled via intelligent DOM traversal.

Usage

  1. Drop the script into the <head> or bottom of the <body> of your vintage HTML file.
<!-- Yes, we are writing HTML 4.01 or XHTML 1.0 Strict here -->
<script type="text/javascript" src="tailwind-ie6.js"></script>
  1. Start writing Tailwind as usual:
<div class="max-w-[800px] mx-auto mt-10 p-6 bg-white rounded-xl shadow-lg border border-gray-200">
    <h1 class="text-3xl font-bold text-gray-900 mb-4 tracking-tight">Hello IE6!</h1>
    
    <div class="grid grid-cols-2 space-x-4">
        <div class="bg-blue-500 hover:bg-blue-600 text-white p-4 rounded-md cursor-pointer transition-none">
            Hover me!
        </div>
        <div class="bg-gradient-to-r from-purple-500 to-pink-500 text-white p-4 rounded-[20px] opacity-80">
            Gradients & Arbitrary Radius
        </div>
    </div>

    <!-- Group Hover Example -->
    <div class="group mt-8 p-4 border border-dashed border-gray-400 bg-gray-50">
        <p class="text-gray-500 group-hover:text-[#ff0000] group-hover:font-bold">
            I turn red and bold when you hover my parent container!
        </p>
    </div>
</div>

How it works under the hood

IE6 doesn't support CSS3. It doesn't know what border-radius or box-shadow is. This script reads the className of all elements, parses the Tailwind logic, and directly modifies the element's style object.

  • For layout bugs, it aggressively applies zoom: 1 to trigger IE's internal hasLayout mechanism.
  • For rounded corners, it creates absolute-positioned Vector Graphic nodes behind your elements.

Limitations

  • Performance: Running complex DOM traversal and DX filters on IE6 JScript engine is inherently slow. Don't use this on a page with 10,000 DOM nodes unless you want to hear your Pentium 4 CPU fan scream.
  • Flexbox/Grid: Real Flexbox is mathematically impossible to perfectly polyfill. flex falls back to block, and grid-cols-* uses percentage floats.
  • Animations: transition and animate-* are ignored. Changes happen instantly.

About

Tailwind support designed for Internet Explorer 6

Topics

Resources

License

Stars

Watchers

Forks

Contributors