alchaplinsky / polymer-rails

Polymer and web components for Ruby on Rails
MIT License
286 stars 80 forks source link

Error compiling assets #48

Open maca opened 9 years ago

maca commented 9 years ago

I am using paper elements installed through bower in vendor/assets/components. I've overriden paper-styles by cloning the repo as app/assets/components/paper-styles. Everything works fine in development but the assets wont compile in production.

 remote:        Sass::SyntaxError: Invalid CSS after "  @apply": expected "}", was "(--layout-scroll);"
 remote:        (in /tmp/build_cdd01b23e7c8daee3206bba40023a2e5/vendor/assets/components/paper-dialog/paper-dialog.html)

Apparently sass is processing the files.

nonameolsson commented 9 years ago

Does this have anything to do with https://github.com/PolymerElements/paper-drawer-panel/issues/74 ?

Vortex commented 9 years ago

I am getting the same issue, it seems that Sass doesn't like that @apply statement.

nonameolsson commented 9 years ago

So Polymer isn't compatible with Sass at all at the moment?

alchaplinsky commented 9 years ago

Yeah, @apply which is known as experimental extension isn't likely to be supported by sass.

Vortex commented 9 years ago

Solution? Why are the css files run through sass at all?

npezza93 commented 9 years ago

Any progress on this at all?

alchaplinsky commented 9 years ago

@Vortex because rails minifies your css for production and for this purpose uses sass - config.assets.css_compressor = :sass

alchaplinsky commented 9 years ago

@npezza93 If sass maintainers would decide to support experimental syntax from polymer team..

nonameolsson commented 9 years ago

Okey.. So I created a new rails app and installed everything in order from scratch. It worked! After that I removed everything from the other app I tried to use before. Now it works!

I have no idea, but Sass doesn't seem complain about the @apply anymore.

Frexuz commented 9 years ago

@nonameolsson can you post your gem versions? I have

gem 'polymer-rails'

group :assets do
  gem 'sass', '3.4.19'
  gem 'sass-rails', '5.0.4'
  gem 'sprockets', '3.4.0'
  gem 'sprockets-rails', '3.0.0.beta2', :require => 'sprockets/railtie'
end