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

Can not load css for external package #418

Closed
1 of 3 tasks
alla-lipina opened this issue Feb 26, 2018 · 5 comments
Closed
1 of 3 tasks

Can not load css for external package #418

alla-lipina opened this issue Feb 26, 2018 · 5 comments

Comments

@alla-lipina
Copy link

alla-lipina commented Feb 26, 2018

This is my intent (choose one)

  • I want to report a bug
  • I want to request a feature or change
  • I want to provide or change a feature

The problem

Following the documentation for setting up the react-day-picker in my project I try to require styles usying css-loader like this:

import "react-day-picker/lib/style.css";

but it doesn't work.

Proposed solution

🤔

@dmbch
Copy link
Contributor

dmbch commented Feb 27, 2018

Hey @Lipina, thanks for this report! I am a afraid it appears that this might just be hops‘ current behavior: we are currently using css-loader with CSS modules for all CSS files.

As soon as we can merge #417 or #354 we will have a per-file opt-out for this behavior (see bc3a94a)

Could you temporarily include that component’s CSS locally in your project and wrap its class identifiers like so :global(.xxx) (see https://github.com/css-modules/css-modules/blob/master/README.md#exceptions)?

@dmbch
Copy link
Contributor

dmbch commented Apr 9, 2018

This issue can now (finally) be resolved: https://github.com/xing/hops/releases/tag/v10.3.0

@Lipina please verify.

@alla-lipina
Copy link
Author

It doesn't work for me unfortunately. 🤷‍♀️

I tried both import "react-day-picker/lib/style.css"; and import "react-day-picker/lib/style.css?global";

@ZauberNerd
Copy link
Contributor

Hi @Lipina unfortunately we didn't test this thorough enough and still have issues with files that are loaded from node_modules instead of file relative.
For now to work around this issue, you probably could import like this: import "./node_modules/react-day-picker/lib/style.css?global"; - and if that doesn't work you could place the style.css in your application folder and load it like this: import "./style.css?global";

@ZauberNerd
Copy link
Contributor

This has been merged into master with #688 and will be included in the next release of Hops 11 RC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants