Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V4 alpha 5 Implementation of custom input icons dont work in IE and FF #21017

Closed
philmayfield opened this issue Oct 26, 2016 · 1 comment
Closed

Comments

@philmayfield
Copy link

The alpha 4 implementation of the custom input (custom-select) icon looks like:

$custom-select-indicator: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23333' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E") !default;

Of note the "%23333" which is the hex for # plus the color 333, so #333;

The alpha 5 implementation looks like this:

$custom-select-indicator-color: #333 !default; $custom-select-indicator: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='#{$custom-select-indicator-color}' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E") !default;

Where a sass variable has been added to specify the color. This works great for flexibility and renders correctly for me on Chrome (v54), but does not work in IE (v11) and FF (v47).

I believe that its the combination of hex and plain text that goofs it up? Im not really sure... but what worked for me in all 3 browsers was to remove the # from the color, and add the "%23" to the svg code, like this:

$custom-select-indicator-color: 333 !default; $custom-select-indicator: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23#{$custom-select-indicator-color}' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E") !default;

@mdo
Copy link
Member

mdo commented Oct 26, 2016

Duplicate of #20956 and since fixed with #20962.

@mdo mdo closed this as completed Oct 26, 2016
@mdo mdo added this to the v4.0.0-alpha.6 milestone Oct 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants