discourse/lib/stylesheet
Joe cfde4419f5
DEV: Preload CSS in the `<head>` (#17322)
This commit adds preload links for core/plugin/theme CSS stylesheets in the head.

Preload links are non-blocking and run in parallel. This means that they should have already been downloaded by the time we use the actual stylesheets (in the <body> tag).

Google is currently complaining about this here and this PR will address that warning.

This commit will also fix an issue in the splash screen where it sometimes doesn't respect the theme colors - causing a slightly jarring experience on dark themes.

Note that I opted not to add new specs because the underlying work required already has a lot of coverage. The new methods only change the output HTML so we can chuck that in the document <head>

This change also means that we can make all the stylesheets non-render blocking, but that will follow in a separate commit.
2022-07-05 00:23:09 +08:00
..
manager DEV: Ensure stylesheet sourcemap URLs include __ws hostname param (#15934) 2022-02-14 19:53:39 +00:00
compiler.rb DEV: Upgrade to Rails 7 2022-04-28 11:51:03 +02:00
importer.rb DEV: Upgrade to Rails 7 2022-04-28 11:51:03 +02:00
manager.rb DEV: Preload CSS in the `<head>` (#17322) 2022-07-05 00:23:09 +08:00
watcher.rb DEV: Fix stylesheet watcher (#16635) 2022-05-04 11:58:52 -04:00