Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

styles.css not included inline in server render #974

@arutnik

Description

@arutnik

I'm submitting a ...

- [ ] bug report <!-- Please search GitHub for a similar issue or PR before submitting -->
- [ x] feature request
- [ ] Support request => Please do not submit support request here, instead see https://github.com/angular/universal/blob/master/CONTRIBUTING.md#question

What modules are related to this Issue?

- [ ] aspnetcore-engine
- [ ] common
- [ x] express-engine
- [ ] hapi-engine
- [ ] module-map-ngfactory-loader

Current behavior?

The CSS declared in styles.css is included in the client bundle, but it is not inlined into the server bundle the way component styles are.

Expected behavior?

Any CSS in the styles.css should be (optionally?) inlined in the server rendered html and transitioned out when the client loads, the way other component CSS does.

Minimal reproduction with instructions

  1. Clone this repo
  2. Add any CSS to styles.css that should apply anywhere. Eg. body { color: pink; }
  3. Open any server rendered route and view the html that is generated
  4. Note that the CSS rule you added does not appear inlined in the HTML, it only appears once the client bundle is loaded.

Environment:

@nguniversal versions

  • aspnetcore-engine:
  • common:
  • express-engine:
  • hapi-engine:
  • module-map-ngfactory-loader:
<!--
Output from: `ng --version`.
If nothing, output from: `node --version` and `npm --version`.
  Windows (7/8/10). Linux (incl. distribution). macOS (El Capitan? Sierra?)
-->

Other information (optional)

My application has a lot of base styles defined in styles.css and it looks really bad before the transition to the client application when these styles are not available in the server view.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions