-
Notifications
You must be signed in to change notification settings - Fork 137
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
How is it intended that we import CSS? #999
Comments
No, you should not need to configure your own CSS loading stack. It's included by default in the Embroider spec. The problem you're hitting is that there's a bunch of legacy behavior specifically for
This is not going to work or do what you want. I would recommend co-locating CSS files with the components that need them and importing them into the components. This ensure that before the component's module evaluates, the CSS is loaded. It doesn't guarantee how it gets loaded, in terms of whether it will get a specific URL in the output or even whether it has a URL at all. |
what do I do for my shadow-dom situation where I want to import the entirety of my app.css? I have no component-local css |
I replied to this question here: #995 (comment) |
awesome! thanks! so, moving forward with avoiding the legacy style pipeline, how do you set up a new one? I've
but no dice -- my assets directory has no css (other than vendor and test-support, but those are legacy pipeline) |
I can't tell if what I'm doing isn't working because I'm doing it wrong, the blogs / docs I'm reading are wrong, or embroider is interfering 🤔 |
@NullVoxPopuli have you managed to overcome this yet? Running into the same issue |
Yup, importing css, and having css be part of the module graph works great now! |
in many webpack projects (outside of ember+embroider) you can do this:
but at the moment I'm getting this error:
When I inspect
/tmp/embroider/66dd2e/frontend/
, I see that my app.css has moved to/assets
, which I guess makes sense since that's the output directory. But a little weird, cause I expected that I'd be able to resolve all dev-time paths in their dev-time locations.So now I've changed my import in app.css to:
and got past that error, but now a new error:
which is unexepected to me, because in the normal style pipeline codemirror-theme.css is handled just fine 🤔
So, my hunch is that I now need to configure asset loading to use my own css/postcss loader stack, rather than the default, kinda what I probably need to do anyway for: #729
The text was updated successfully, but these errors were encountered: