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

Unexpected CSS token on Safari #5043

Closed
ghost opened this issue Nov 25, 2014 · 33 comments
Closed

Unexpected CSS token on Safari #5043

ghost opened this issue Nov 25, 2014 · 33 comments
Assignees
Milestone

Comments

@ghost
Copy link

ghost commented Nov 25, 2014

I do get 5 warnings with "Unexpected CSS token: :" on Safari for Mac browser (on line 4, though it's minimised).

Using CDN: maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css

@tagliala tagliala added the css label Nov 25, 2014
@TriangleJuice
Copy link

It is caused by the five filter:progid:DXImageTransform.Microsoft.BasicImage code snippets, but not sure why this is or how to fix it.

@tagliala
Copy link
Member

@josokinas could you please check the unminified file?

//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.css

@ghost
Copy link
Author

ghost commented Nov 26, 2014

@tagliala, OK. So the warnings are in following lines:

[Warning] Unexpected CSS token: : (font-awesome.css, line 104)
[Warning] Unexpected CSS token: : (font-awesome.css, line 110)
[Warning] Unexpected CSS token: : (font-awesome.css, line 116)
[Warning] Unexpected CSS token: : (font-awesome.css, line 122)
[Warning] Unexpected CSS token: : (font-awesome.css, line 128)

@whitecat
Copy link

So was this fixed or was it just ignored?

@tagliala
Copy link
Member

@whitecat #5043 (comment)

@MiguelMike
Copy link

Ok, the solution is to place IE filters in dubble quotes. Has this already been fixed?

@edgariscoding
Copy link

So I still get this warning on Safari. Is core going to get updated to avoid this issue?
screen shot 2015-10-15 at 10 57 35 am

@antoinemenini
Copy link

Same problem for me. Does anyone have a fix?

@MiguelMike
Copy link

Here's an example that of how it should look like to prevent the errors
filter: ~"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";

@ghost
Copy link
Author

ghost commented Oct 16, 2015

@MiguelMike, why don't you test it on browsers (IE especially) and create a pull request?

@tagliala
Copy link
Member

I need to be 1000% sure that this works on IE8

@tagliala tagliala reopened this Oct 16, 2015
@tagliala tagliala self-assigned this Oct 16, 2015
@ghost
Copy link
Author

ghost commented Oct 17, 2015

Haven't tested, but from this issue here less/less.js#734 it looks like quotes cannot be used for IE6 and IE7, but for IE8 -ms-filter should be used instead.

Also, here it states that single or double quotes can be used: https://msdn.microsoft.com/en-us/library/ms530752(v=vs.85).aspx

@tagliala
Copy link
Member

Sorry, I come back on my steps, also because I don't know if Dave will keep supporting IE8 in 5.0.0

filter: ~"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";

This does not work in IE8

If you do not need IE8 support, please consider a custom build, you just need to override mixins.less / .scss removing the offending line

Eg of mixins.less

// Mixins
// --------------------------

.fa-icon() {
  display: inline-block;
  font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration
  font-size: inherit; // can't have font-size inherit on line above, so need to override
  text-rendering: auto; // optimizelegibility throws things off #1094
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

}

.fa-icon-rotate(@degrees, @rotation) {
  -webkit-transform: rotate(@degrees);
      -ms-transform: rotate(@degrees);
          transform: rotate(@degrees);
}

.fa-icon-flip(@horiz, @vert, @rotation) {
  -webkit-transform: scale(@horiz, @vert);
      -ms-transform: scale(@horiz, @vert);
          transform: scale(@horiz, @vert);
}

Closing here

@tagliala tagliala removed their assignment Oct 17, 2015
@ghost
Copy link
Author

ghost commented Oct 17, 2015

I guess this...

filter: ~"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";

...should be:

-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";

@dan
Copy link

dan commented Oct 21, 2015

bump.

@ghost
Copy link
Author

ghost commented Jan 21, 2016

Great 👍

@tagliala tagliala added this to the 5.0.0 milestone Jan 21, 2016
@tagliala
Copy link
Member

This will be fixed in FA 5.0.0 because we will drop support for IE8.

Leaving this open

@ghost
Copy link
Author

ghost commented Jan 21, 2016

That is fine, IE8 is oldskul already, but still could be better patched with v4.5.1 for anyone who still needs IE8 support...

@tagliala
Copy link
Member

@juliusosokinas that would be an intentional breaking change, because rotated icons on non-properly declared pages will stop working on IE8

We can't do this on 4.x releases

afc163 added a commit to ant-design/ant-design that referenced this issue Feb 4, 2016
@My1
Copy link

My1 commented Mar 8, 2016

@tagliala how does it work with HTML 4 pages with properly declared doctype?

@tagliala
Copy link
Member

tagliala commented Mar 8, 2016

@My1 Font Awesome 4.5.0 should work just fine, if you edit the css according to #5043 (comment) to solve this issue, it will stop work

@My1
Copy link

My1 commented Mar 8, 2016

I wanted to ask about your test cases. a properly delcared HTML5 page works with the change, a non-properly declared (more or less HTML4) page doesnt work, but the intresting question is a properly declared HTML4 page, AND the reason why it suddenly works when a page is decalred as HTML5.

@tagliala
Copy link
Member

tagliala commented Mar 8, 2016

@My1 I can confirm it works with properly declared HTML4/XHTML pages too.

I will edit my previous comment

@My1
Copy link

My1 commented Mar 8, 2016

so essentially the only victims are those who arent properly declaring HTML, doesnt sound so breaking to me anymore, I mean before going to advanced stuff like webfonts prople should learn the most basic basics yet, and that would be for example delaring HTML.
I mean I have to declare a PHP script too, ya know <?php.

@tagliala
Copy link
Member

@My1 if Dave is going to release a new 4.x version I will also include this fix

@My1
Copy link

My1 commented Mar 21, 2016

that's nice2know.

@tagliala tagliala modified the milestones: 4.5.1, 5.0.0 Apr 5, 2016
@tagliala tagliala self-assigned this Apr 5, 2016
tagliala added a commit that referenced this issue Apr 5, 2016
Caused by `filter: progid:DXImageTransform.Microsoft.BasicImage`
css property. Since we are addressing IE >= 8 and valid HTML5 templates,
we can use `-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage”`
to get the same result

Fix #5043
@tagliala
Copy link
Member

tagliala commented Apr 5, 2016

Fixed in the upcoming 4.6.0

I'm positve it works but I really hope this will not break anything

talbs pushed a commit that referenced this issue Apr 6, 2016
Caused by `filter: progid:DXImageTransform.Microsoft.BasicImage`
css property. Since we are addressing IE >= 8 and valid HTML5 templates,
we can use `-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage”`
to get the same result

Fix #5043
@tagliala tagliala changed the title Unexpected CSS token Unexpected CSS token on Safari Apr 6, 2016
@tagliala tagliala closed this as completed Apr 6, 2016
@ghost
Copy link
Author

ghost commented Aug 5, 2016

So...

Should the "Unexpected CSS token: :" warning still show up with Font Awesome 4.6.3 or am I missing something? It seems like it is still there.
screen shot 2016-08-05 at 3 34 41 pm

@tagliala
Copy link
Member

tagliala commented Aug 5, 2016

please double check that you are using 4.6.3

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

No branches or pull requests

9 participants