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

Using @import to load photoswipe CSS #9

Open
kelso opened this issue Oct 23, 2017 · 4 comments
Open

Using @import to load photoswipe CSS #9

kelso opened this issue Oct 23, 2017 · 4 comments

Comments

@kelso
Copy link

kelso commented Oct 23, 2017

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.

@jeangus
Copy link

jeangus commented Nov 20, 2017

Hello !

I've exactly the same problem, did you find a solution ?

Thanks a lot !

@MatthieuBarthel
Copy link

Same here

@MatthieuBarthel
Copy link

I just found an easy solution :

@import "photoswipe/photoswipe"
@import "photoswipe/default-skin/default-skin"

@equivalent
Copy link

equivalent commented Sep 29, 2021

@MatthieuBarthel solution works 👍 (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 #12 as this is bit painful to figure out

equivalent added a commit to equivalent/photoswipe-rails that referenced this issue Sep 29, 2021
related to skakri#9  . Current solution in Readme is bit confusing if you use @bootstrap or other gems...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants