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

feat(@schematics/angular): add 'none' value for the 'style' option of the component schematic #21141

Merged
merged 1 commit into from Jun 21, 2021
Merged

feat(@schematics/angular): add 'none' value for the 'style' option of the component schematic #21141

merged 1 commit into from Jun 21, 2021

Conversation

daiscog
Copy link
Contributor

@daiscog daiscog commented Jun 16, 2021

Allow setting --style=none for the component schematic to prevent generation of any style file. Previously this was possible only with --inlineStyle=true, which had the side-effect of adding an inline style block to the component decorator. Useful for components or projects which have entirely externalised stylesheets and never want to use component-specific styles.

Motivation

In our project we have an externally-managed SCSS project to allow our customers theming flexibility. As such our components only use the BEM classes from this project. Almost none of our components contain any actual CSS.

Every time we run ng g c ... we have to then manually delete the style file or style block from the component decorator in the generated .component.ts file, which is a little tedious. This PR will allow us to set none as the default value for the styles option for the component schematic in our angular.json, giving us a nice little productivity and quality-of-life boost. :)

@google-cla google-cla bot added the cla: yes label Jun 16, 2021
… the component schematic

Allow setting `--style=none` for the component schematic to prevent generation of any style file.  Previously this was possible only with `--inlineStyle=true`, which had the side-effect of adding an inline style block to the component decorator.  Useful for components or projects which have entirely externalised stylesheets and never want to use component-specific styles.
@clydin clydin added needs: discussion On the agenda for team meeting to determine next steps target: minor This PR is targeted for the next minor release labels Jun 17, 2021
@dgp1130 dgp1130 removed the needs: discussion On the agenda for team meeting to determine next steps label Jun 17, 2021
@dgp1130 dgp1130 requested a review from clydin June 17, 2021 17:11
@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label Jun 18, 2021
@filipesilva filipesilva merged commit 8ad1539 into angular:master Jun 21, 2021
@daiscog daiscog deleted the add-none-style-option-to-componnent-schematic branch June 21, 2021 10:50
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jul 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants