-
Notifications
You must be signed in to change notification settings - Fork 12k
feat(@schematics/schematics): add includeStyles option on component #18420
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
Conversation
update schema add test
@geromegrignon, can you please mention the use cases? It would help us evaluate this request better. Thanks. |
Using tailwind is a good example |
The main use case for me was when you have a SCSS structure (like we have in AIO) you don't need individual stylesheets or inline styles at all on a component level basis. I'm wondering if we can make this a global config setting instead? |
Yes, we do have the exact use case, and we ended up deleting the scss files after generating the component. |
I marked this for further discussion with the team to see if we’d want to add this option. Side note: while I do understand that in some cases you might not want components styles, I think those should be minimal unless using a CSS framework where you don’t need write your own CSS. Than again probably you still might want some component specific styling. From a performance perspective, my personal suggestion would to go for components styles instead of global styles (styles.css). Here’re some reasons:
In addition to that I think it is also a better DX as it makes it easier to maintain component specific styles. Do use the global stylesheet, but I see this to be used more for generic utility classes and browsers resets and normalisation styles. (Ie: truly global) |
About use cases, i would add :
|
Hi @geromegrignon, Thanks for your contribution. We have discussed this during our team meeting and we decided that for the time being we'd like to keep this out for a number of reasons. We'd like to re-evaluate all the options of our schematics. The component schematic currently has 21 options, 3 of which are related to styling Having so many options is also a maintain concern, additionally it makes each option less discoverable in the documentation and help page. Therefore, we'd like to evaluate the possibility of merging/removing some of these. At the moment users can opt to not create external CSS files using Thanks again! |
Hi @alan-agius4, thanks for the response and the time invested in reviewing it. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
There are several use cases where we create components knowing there will be no styles attached.
To keep them as simple as possible, there should be an option to create them without any styles/stylesUrl property into the @component metadata.
new Component schematic option