HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
filamentgroup
loadCSS
JavaScript2014–2018
filamentgroup / loadCSS · Archived

loadCSS

Load CSS asynchronously

7Distinct people
8Mentions
0Explicit recommenders
6.6KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Load CSS asynchronously

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 8–Nov 15 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/15/2026, 2:04:58 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year8 dated mentions

Observed mentions: 2014-07-06 15:13:43 UTC to 2018-08-04 17:57:14 UTC.

012342014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 2 mentions; 2 submissions, 0 comments20142015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments20162017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2018

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC220
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC000
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC404
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC101
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC101

What Hacker News says

8 sources
Clicking the permalink often brings up reply for lower nested comments. >There is no reason to load any JavaScript on a page that only contains some text and images. While I've not read through all of Amp's JS to know what it's for, I will say I've used JS to specifically speed up static pages before. One example is the Filament Group's loadCSS script[0]. This allows for cross-platform asynchronous CSS loading. Font loading is also another tricky subject. Linking non-blocking font assets while minimizing FOIT and FOUT is still not a solved problem. Smashing Magazine just had a 50 minute video presentation[1] on this problem. JS loaders are a common approach. So I disagree with you that page speed is not the primary goal here, simply because I've run into these same kinds of problems myself and can relate. Google also has the advantag
Read the rest
In One Year Without AMP
Version B could probably be optimized here by not loading two very similar fonts. You can also try loading the font locally first, to avoid the download if it's installed on the user's system. Finally, unicode-range lets you avoid the download completely if that character isn't included on the page. Not a likely outcome on an English page, but a good practice regardless. Webfonts are tough to optimize, but not impossible. Right now there's solutions of using Javascript to background the font so it's non-blocking (eg. loadCSS[1]), but it's not ideal when trying to keep overhead down. The situation should improve once font-display[2] becomes standardized. For what it's worth though, I find Version B looks much nicer. [1] https://github.com/filamentgroup/loadCSS [2] https://css-tricks.com/font-display-masses/
In The web sucks if you have a slow connection
HTTP/2 helps with that but the total size still matters. This is particularly relevant for resources like CSS which block rendering – even with HTTP/2 making it less important whether that's one big resource or a dozen small ones, the page won't render until it's all been transferred. https://github.com/filamentgroup/loadCSS#recommended-usage-p... has a rather nice way to load CSS asynchronously in browsers which support rel=preload.
In The average size of Web pages is now the average size of a Doom install
Sure, here's some notes I have from building the Shittalk Generator Minify HTML (http://www.willpeavy.com/minifier/) Minify CSS (YUICompressor) Minify JS (Google Closure Compiler) Enable gzip compression Replace jQuery (29kB) with Zepto (9.6kB) Remove Bootstrap.js dependancy (usually, you don't need it) Heavy reliance on async ajax calls (only load visible page content, load everything else on scroll using a function like below) $(window).ready(function () { $(this).one('scroll', function () { //only executes once // call this data when a user scrolls down for the first time // only do this with below-the-fold content }); }); Make efficient database queries, bundle them together when you can. Use loadCSS to asynchronously load non-essential CSS after the page has been loaded: https:
Read the rest
//github.com/filamentgroup/loadCSS Try out different CDN's - some CDN's have bootstrap.min.css around 30kb, and other services have it compressed to 19kB (CDNJS works best for me) Use the following sites to find what's impacting load times/page size: http://tools.pingdom.com/fpt/#!/dVQE7B/http://daviseford.com... https://gtmetrix.com/ https://developers.google.com/speed/pagespeed/insights/
In Milligram: A minimalist CSS framework
Seriously. CSS loading/parsing is render blocking. By loading CSS that isn't needed immediately asynchronously in a way that will use the browser cache if it's available, it makes the page visible much faster. It feels like overkill in the simple example, but it's a tried and true method. ( https://github.com/filamentgroup/loadCSS has > 2k stars if that kinda thing means anything) From my experience on a large website (m.trulia.com), On a 3G connection with an 'average' (nexus 5) phone, this technique made almost a 2 second difference in perceived load time.
In Google recommends inlining small CSS

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.