Skip to content

Instantly share code, notes, and snippets.

@mchung
Created February 15, 2012 16:31
Show Gist options
  • Save mchung/1837110 to your computer and use it in GitHub Desktop.
Save mchung/1837110 to your computer and use it in GitHub Desktop.
.btn-custom {
background-color: hsl(357, 59%, 43%) !important;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorStr="hsl(357, 59%, 63%)", endColorStr="hsl(357, 59%, 43%)");
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorStr="#D8696F", endColorStr="#AE2D33");
background-repeat: repeat-x;
}
@mchung
Copy link
Author

mchung commented Feb 15, 2012

Charlie-

IE9 doesn't observe startColorStr/endColorStr when values are declared using HSL. They have to be declared using RGB.

@charliepark
Copy link

Marc, thanks. I'd need to convert the HSL to RGB, then, and after that, it should work?

@charliepark
Copy link

Sorry ... just so I'm clear: they'd need to be in hex format?

@mchung
Copy link
Author

mchung commented Feb 15, 2012

Charlie,

That's correct. Replace hsl(357, 59%, 63%) with #D8696F

@charliepark
Copy link

Marc, I'm having trouble finding a reliable hsl -> hex converter. For now, I've removed the filter line from it, but I hope to get it back in there once I find a good conversion script. In the meantime, it should fall back to simply the background color. Can you let me know if that hsl value works for you in IE?

@mchung
Copy link
Author

mchung commented Feb 15, 2012

I visited bootstrap buttons and I don't see the changes you mentioned, the filter:progid..gradient is still present in the example.

Also I noticed a difference with the styles in the Examples and the styles in the textarea.

a) The css in the Examples (i.e. .btn.e) omits:

filter: progid:DXImageTransform.Microsoft.gradient...

b) The css in the Examples uses:

background-image: linear-gradient(top, hsl(0, 69%, 42%), hsl(0, 69%, 22%));

while the css generated for the textarea (by the javascript function generateHSLGradient()) uses:

background-image: linear-gradient(hsl(201, 100%, 50%), hsl(201, 100%, 30%));

@charliepark
Copy link

Sorry about the CSS differences. I'd been using a slightly earlier version of the script when I'd made the examples. The filter: should be removed now, and the gradient should now not show the "top" (as that's the default).

Do the buttons look "normal" on IE, though? That is, they might not show the gradient, but do they at least carry the button color and contrasting text color? (You might need to do a force-refresh to get the newest code to show up.)

@mchung
Copy link
Author

mchung commented Feb 15, 2012

Hey no problem. Now, I have to reveal a secret. I don't use IE. I've been using http://browserling.com to test it along with a few other browsers I don't have access to.

Sadly, the site doesn't seem to be working at the moment. Once it's back up, I'll take a look and let you know.

@charliepark
Copy link

Marc ... no need for you to check on it (especially if you're having to go through a proxy!), but I think we've finally got it working for IE. Thanks again for your help with this!

@mchung
Copy link
Author

mchung commented Feb 29, 2012 via email

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