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

Per Style Extract Option with Custom Named Styles #5420

Closed
1 of 2 tasks
mmellison opened this issue Mar 14, 2017 · 3 comments
Closed
1 of 2 tasks

Per Style Extract Option with Custom Named Styles #5420

mmellison opened this issue Mar 14, 2017 · 3 comments
Labels
feature Issue that requests a new feature P5 The team acknowledges the request but does not plan to address it, it remains open for discussion

Comments

@mmellison
Copy link

Bug Report or Feature Request (mark with an x)

  • bug report -> please search issues before submitting
  • feature request

Versions.

@angular/cli: 1.0.0-rc.2
node: 7.7.2
os: linux x64
@angular/common: 2.4.9
@angular/compiler: 2.4.9
@angular/core: 2.4.9
@angular/forms: 2.4.9
@angular/http: 2.4.9
@angular/platform-browser: 2.4.9
@angular/platform-browser-dynamic: 2.4.9
@angular/router: 3.4.9
@angular/cli: 1.0.0-rc.2
@angular/compiler-cli: 2.4.9

Desired functionality.

The features provided by #3401 have been very helpful, however, I have a need for an additional option for styles which would override the global --extract-css option on a per stylesheet basis.

Example:

"styles": [
  "styles.scss",
  { "input": "preload.scss", "output": "preload-styles", "extract": True }
],

My usecase is I am wanting the main styles to be loaded asynchronously via the javascript bundle to allow the page content to load, but keep a small stylesheet which is loaded immediately. The small stylesheet generally contains minimal styles for my loading screen and loading animation.

Obviously, I can manually compile my preload styles and inline them into my index.html to achieve the same effect, but it would be nice to have this accomplished all in the build step.

@filipesilva
Copy link
Contributor

We use extract with another meaning in the CLI. Extracting CSS in builds is opposed to keeping the CSS inside a JS bundle (as webpack does by default).

I agree with your usecase and think it would be a nice feature to have. Would just name it something like inline instead.

@filipesilva filipesilva added P5 The team acknowledges the request but does not plan to address it, it remains open for discussion type: discussion feature Issue that requests a new feature labels Mar 18, 2017
@filipesilva filipesilva self-assigned this May 23, 2017
@mgechev
Copy link
Member

mgechev commented Dec 17, 2018

@seglberg I'd recommend you to explore ngx-build-plus to customize your build for this feature. In case you find that it's not possible to satisfy your use case, please open a new issue. Thanks! :)

@mgechev mgechev closed this as completed Dec 17, 2018
@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 Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature Issue that requests a new feature P5 The team acknowledges the request but does not plan to address it, it remains open for discussion
Projects
None yet
Development

No branches or pull requests

4 participants