-
Notifications
You must be signed in to change notification settings - Fork 377
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
Change to importable CSS #1607
Comments
@NullVoxPopuli The css is now not anymore auto-imported. It must be manually done like you have described. CSS import example is present in documentation: |
I also stumbled upon the change in v2 when importing css in vanilla css contexts. FWIW, I found it possible to import the css directly into /assets/styles.css like this: @import 'ember-power-select/vendor/ember-power-select.css'; (It may be a matter of personal taste, but I sometimes find it cleaner to import css directly in css, and not via js.). |
Importing in css is fine, but more confusing to recommend, because in order to get the css to be part of your module graph, you need css imported into js. (Docs could always be sure to mention this, however) |
There are a lot of options to import the css in the app... but i think we should add only one way in documencation (which is already), because i think that is the recommended way. Option 1 (recommended): // app.js or other js file
import 'ember-power-select/styles'; Option 2: /* assets/styles.css */
@import 'ember-power-select/vendor/ember-power-select.css'; Option 3: |
Option 3 should be banned from historical records 😅 Option 2 in fine for tiny apps. But only importing in js, or css-that-participates-in-the-module-graph, can you canditionally get the power-select css upon an
This would be ideal, but (un)fortunately we don't have only one way. |
okay thank you! If i have understand correctly, we should add option 2 also in docs with example from a route and describe, that there is also possible to use in component and controllers... right? The blueprint adds always this lines in app.js like in your initial comment |
yeah, exactly.
yeah, it's the lazy documentation way. And depending on your app's build config, you can use @import 'ember-power-select/styles` and have it participate in the module graph. It's a weird balance between trying to document what's possible, and trying not to cover all cases possible. |
@NullVoxPopuli @johanrd i have added the option in docs... would you like to review before we merge it (see #1627)? Docs preview: https://deploy-preview-1627--rubber-tapper-eddies-44787.netlify.app/docs/installation |
oh, great. Looks good to me. I learnt something new regarding the module-graph benefits of importing through js, thanks! Regarding the benefits – if i understand it correctly – importing directly to |
Correct @mkszepp looks good! |
Great! Many thanks for inputs... PR is merged and so i think, that we can also close this issue |
few reasons:
potential examples:
The text was updated successfully, but these errors were encountered: