Media query with \0 causing parsing issues with node-sass and LESS
Because of the https://github.com/angular/material/commit/f3761781f74065c3d6cba8029a3ba420aab957ff commit, which includes a \0 after the media definition, applications using LESS and importing the generated CSS file with the less option to have access to classes and such within LESS no longer work. LESS doesn't support the \0 media query hack. Import example:
@import (less) 'angular-material/angular-material.css';
When trying to compile LESS you get the following error:
media definitions require block statements after any features in file angular-material\angular-material.css line no. 654
Also having this issue. Had to split up my vendor + app styling, but not ideal.
I think I have a similar problem using SASS:
Error: Invalid CSS after "...a screen\\0 and": expected "{", was "-width: 599px) ..."
on line 1286 of stdin
>> @media screen\0 and (max-width: 599px) {
-------^
@jraadt I also ran into the same with less, and I see that you found the same feature/bug in the less repo as I did. https://github.com/less/less.js/issues/1538
Seems like this could be made to be supported with less anyway by a small modification to that media query?
Same issue using node-sass (which uses libsass under the hood).
I can confirm the issue in node-sass as well. It's breaking everything since the angular-material.css module is not building when we deploy to our server.
same problem, when i try deploy to heroku Related https://github.com/angular/material/issues/6360
+1
+1
+1
+1
+1
Same issue with angular-material 1.0.0 installed over bower. It (libsass?) chokes on the \0 IE hacks:
>> Invalid CSS after "...ia screen\\0 and": expected "{", was "-width:599px){...."
>> Line 6 Column 25446 bower_components/angular-material/angular-material.min.css
+1 angular-material 1.0.1 with node-sass ^3.4.1
+1 me too with angular-material 1.0.1 and node-sass cli
Was there a work around for this?
angular-material 1.0.1-master-d1b7f79
Sass::SyntaxError: Invalid CSS after "...a screen\0 and ": expected "{", was "(max-width: 599..."
I, too, would love a work around for this.
Currently, I'm stuck using 0.9.8, which cuts out a hefty chunk of functionality.
Using Ruby on Rails with the sass-rails gem.
+1 for me too
I was having the same problem while using gulp
What i did was before feeding it into the sass compiler, I replaced all '\0' with a space ' '
return gulp.src(assets.vendorCss.main)
.pipe(replace('screen\\0','screen'))
.pipe(concat(assets.vendorCss.output.filename))
.pipe(sass({outputStyle: 'compressed'}))
.pipe(gulp.dest(assets.vendorCss.output.path))
And now it works greatly Note: I am using gulp-sass for compiling, i am not sure how gulp-ruby-sass handles it but i think this workaround should work for them
It was failing for me in rails using sass-rails. Sprockets doesn't make it easy to pipe it through a string replace function so... Changing line 666 of angular-material.scss from
@media screen\0 {
to
@media screen {
was all that was required for me to get it to compile.
@prijindal this way works for me!
I am now with angular-marterial 1.0.1 and node-saas in my gulp building process.
Just to add a point: replace is not a default function in gulp so you have to install gulp-replace in advance.