-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
ember-cli-addon including styles folder #1853
Comments
My guess is that the styles will have to be imported in your app.css. Try adding This seems weird though as I'd probably expect them to be included in the output as well. Maybe we should auto add addon's styles to the vendor.css ? |
This is a bug. The intent is to have the addon's styles in app/ concat'ed into app-name.css and the ones in addon/ concat'ed into vendor.css |
@bcardarella - I thought that the styles in |
I am still having trouble with this after the 0.0.44 update. I have a boilerplate project and I want all the styles (top-menu.css, side-menu.css etc) all included into the projects that are using the addon. How do I achieve this? |
@bcardarella is the concat automatic or as a result of |
@stefanpenner automatic for whatever is in |
@bcardarella - The code exists to do this, but most likely it is only grabbing |
@rwjblue gotcha |
@bcardarella any thoughts on allowing selective css imports from an addon? |
@stefanpenner I don't think that should happen if you put your styles in |
@bcardarella, @stefanpenner - Agreed, at that point the styles are actually "vendor" files (they are in support of the rest of the app if needed/used). |
@bcardarella another example that I'm sure you are familiar with is how ruby's require system works. When you have a gem, you then translating that back to ember-cli-addons it seems that
I believe ^^ gives us a scss story that is symmetric to our js story. |
@stefanpenner I don't see the two as compatible. With ruby you have the option of requiring a file that could have other deps and those get pulled into automatically. That isn't happening with the styles in ember-cli. It's one and done. |
@stefanpenner In addition, with the If the concern is about having the styles always opt-in then I'd be OK with eliminating |
@bcardarella maybe we are confused because different per-processors do different things. Got time this week for a quick google hangout to sanity check each other? |
So what's going on with this right now? |
So how do we package styles up as part of the addon? I have the css file in the dist directory, but it doesn't automatically get included. Do I need to add an import for it in index.js? Not sure of the best way to accomplish this. I would assume they would be included by default. To be more specific as to my issue, I am trying to use ember-cli-less, which I use to create my css file. The first issue, is it won't find app.less, unless I put it in the dummy app. I want to pull app/styles/app.less, how do I do that? The second issue is automatically including the css that is generated into the addon. I put this in my Brocfile.js: var app = new EmberAddon({
outputPaths: {
app: {
css: {
'app': '/assets/ember-x-editable.css'
}
}
}
}); For some reason instead of looking for app/styles/ember-x-editable.less, it is looking for tests/dummy/app/styles/ember-x-editable.less. How do I make it look at just app and not the dummy app? |
Has a solution for this been implemented? Is there a way to do it with .less files or are only .css and .scss supported as of now? I can't make it work with ember-cli-less. Are there any guides on including styles in addons out there? I would really appreciate some guidance! @stefanpenner @rwjblue @bcardarella |
i am aware of this issue, no need to ping me. I am working through all the issues as time/energy permits. |
Any update/documentation about this? |
Is there a recommended workaround for this when writing an addon that requires embedded css? (upgrading ember-split-view to 1.13.7) |
I wanted to chime in on this - I feel like that components in ember addons should be able to use the pod structure that is already half set up. The styles for an addon component should live in It would feel much cleaner to me to have all the dependencies for a component within a folder, which is the reason for pod structure IMO. |
Still trying to figure this out over a year later. Anyone have some insights? |
this issue puzzles me. I ended up sharing a post on my path toward figuring out how an addon can use CSS and processing here -> https://pixelhandler.com/posts/developing-ember-addons-next-generation-css-with-postcss |
Although this sucks, this isn't really a bug. We will need to explore improving the world of css (from add-ons) CSS is strange thing when it comes to composition, which makes it strange. Anyways, I'm closing this issue. As this issue tracker should stay on focus, and be for bugs. That doesn't mean we don't care, but this needs to be explored from RFC / POC and in. Work like @pixelhandler post is interesting, and a great idea. |
4 years later, I'm trying to figure this out, too. ;) @pixelhandler your blog has an expired certificate, and I can't view it. :- |
I have created an ember-addon using
ember addon myaddon
I have css styles in the styles folder.
The other folders /components, /templates etc are all getting merged properly. Styles do not seem to get merged at all into projects using the addon.
I can't find an example anywhere of importing styles using the most recent ember-cli-addon plugin.
What am I doing wrong?
The text was updated successfully, but these errors were encountered: