Skip to content

Feature request: option to add attributes to style tag for styles added via angular-cli.json to index.html #7841

@cmddavid

Description

@cmddavid

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [X] feature request

Versions.

All versions

Repro steps.

Not relevant, new feature

The log given by the failure.

Not relevant, new feature

Desired functionality.

I would like to be able to set the media and onload attribute to styles added via angular-cli.json to index.html so I can prevent "render blocking" CSS for my application. The docs at https://github.com/angular/angular-cli/wiki/angular-cli don't mention anything about this being possible. My research on this matter seems to tell me this is not yet possible but it would be crucial to achieve a perfect score on Google Pageinsights.

This feature would also help to make CSS work only for specific devices, for example mobile, web, print.

Mention any other details that might be useful.

More info on render blocking CSS and how it can be prevented:
http://keithclark.co.uk/articles/loading-css-without-blocking-render/

Good to know: I'm using Angular Universal starter

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions