photoswipe-rails
photoswipe-rails copied to clipboard
Using @import to load photoswipe CSS
I am using application.scss
where I put @import. Like:
@import "bootstrap";
@import "photoswipe.css";
When I ommit ".css" in "photoswipe.css" (as README says) in development mode I get error:
File to import not found or unreadable: photoswipe.
Load paths:
/Users/stefanhuska/Code/huska-photos/app/assets/config
/Users/stefanhuska/Code/huska-photos/app/assets/images
/Users/stefanhuska/Code/huska-photos/app/assets/javascripts
/Users/stefanhuska/Code/huska-photos/app/assets/stylesheets
/Users/stefanhuska/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/photoswipe-rails-4.1.2/app/assets/images
/Users/stefanhuska/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/photoswipe-rails-4.1.2/app/assets/javascripts
/Users/stefanhuska/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/photoswipe-rails-4.1.2/app/assets/stylesheets
/Users/stefanhuska/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/jquery-rails-4.3.1/vendor/assets/javascripts
/Users/stefanhuska/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/coffee-rails-4.2.2/lib/assets/javascripts
/Users/stefanhuska/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/actioncable-5.1.4/lib/assets/compiled
/Users/stefanhuska/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/actionview-5.1.4/lib/assets/compiled
/Users/stefanhuska/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/turbolinks-source-5.0.3/lib/assets/javascripts
So I added ".css" to @import, but in production mode it doesn't work either :/ Browser JS console shows:
Failed to load resource: the server responded with a status of 404 (Not Found)
http://<mydomain>/assets/photoswipe.css
What I am doing wrong? Thanks for any help.
Hello !
I've exactly the same problem, did you find a solution ?
Thanks a lot !
Same here
I just found an easy solution :
@import "photoswipe/photoswipe"
@import "photoswipe/default-skin/default-skin"
@MatthieuBarthel solution works :+1: (big thanks, also to @kelso for asking it) .
Although that's Sass solution. To be complete the Scss solution is:
@import "photoswipe/photoswipe";
@import "photoswipe/default-skin/default-skin";
small detail, but just to be complete ;)
update provided README update https://github.com/skakri/photoswipe-rails/pull/12 as this is bit painful to figure out