It is not possible to use defer or async attribute on stylesheet link, it's reserved only to

tag https://stackoverflow.com/questions/25890729/defer-or-async-allowed-on-a-stylesheet-include

Comments

heyyo created an issue. See original summary.

aaronsansal’s picture

Yes, as you said, the async/defer is just for script tag. The option attribute to CSS link tag could be rel="preload".

aaronsansal’s picture

Status: Active » Fixed

You're right, async/defer only exist for scripts. Fixed in 1.1.0 (commit 964cbc4).

The CSS option is now "Preload (non render-blocking)": stylesheets are rendered as <link rel="preload" as="style" onload="this.onload=null;this.rel='stylesheet'"> with a <noscript> fallback, and the module no longer adds async/defer attributes to <link>. The update hook resets the previous CSS async/defer setting to "None", since it never had any effect.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

aaronsansal’s picture

Version: 1.0.1 » 1.1.0

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.