madebysource / lesshat

Smart LESS CSS mixins library.
lesshat.com
MIT License
2.19k stars 259 forks source link

Incorrect keyframes syntax breaks Safari9's CSS parser #164

Closed Reinmar closed 8 years ago

Reinmar commented 8 years ago

There's a problem in Safari 9 now, that CSS generated by LESS+LESSHat breaks the entire parser if the keyframes() function was used.

This is the rule that causes this issue:

.content h1:target lesshat-selector {
  -lh-property: 0; } 
@-webkit-keyframes targetLinkOpacity{ 0%{ opacity: 0 } 100%{ opacity: 1 }}
@-moz-keyframes targetLinkOpacity{ 0%{ opacity: 0 } 100%{ opacity: 1 }}
@-o-keyframes targetLinkOpacity{ 0%{ opacity: 0 } 100%{ opacity: 1 }}
@keyframes targetLinkOpacity{ 0%{ opacity: 0 } 100%{ opacity: 1 };
}

It's generated from:

...
&:target {
    .keyframes( ~'targetLinkOpacity, 0%{ opacity: 0 } 100%{ opacity: 1 }' );
}

The problem is in the semicolon at the end of the last keyframe. After manually removing it everything is working fine.

This is a critical issue because Safari totally gives up on parsing once it encounters a syntax issue. I guess that this issue is related to #93. That semicolon seems to terminate the -lh-property: 0... value that LESS Hat uses to workaround the inability to generate keyframes in LESS.

hashplus commented 8 years ago

+1

maeertin commented 8 years ago

+1

emilsall commented 8 years ago

+1

vincentboiardt commented 8 years ago

+1

Npahlfer commented 8 years ago

+1

lpcustom commented 8 years ago

+1

fr-olivier commented 8 years ago

+1

ghost commented 8 years ago

+1

shleyze commented 8 years ago

+1

fredck commented 8 years ago

+1

oleq commented 8 years ago

+1

mlewand commented 8 years ago

+1

danjford commented 8 years ago

+1

EvHaus commented 8 years ago

+1

munkacsimark commented 8 years ago

+1

uberTof commented 8 years ago

Yup, our entire web app of 14k lines of CSS crumbles in Safari 9 because of one semi-colon due to lesshat keyframes mixin.

jakubweber commented 8 years ago

+1

aukgit commented 8 years ago

+1

petrbrzek commented 8 years ago

Sorry guys for waiting so long. I've merged #166 so it should be fixed. If the problem persist let me know and I'll open the issue again.

mboudreau commented 8 years ago

This has been fixed in 4.0.1.