Big CSS or JS files

Assume you have a huge CSS or JS library, maybe 0.3M or even more, that you want on your website. Maybe copy/pasting the library in the Simple Custom CSS and JS editor doesn’t fit your scope.

There are two possibilities for solving this:

  • you save the library on a file hosting, like Amazon S3, and link to it
  • or, you save the library in the website’s Media Library and link to it, just as if the file would be hosted on an external server.

The linking part is similar in both cases. Go to WP Admin -> Custom CSS & JS -> Add Custom HTML and read the comment found in the editor.

Following is a screencast with instructions on how to save a CSS file to the Media Library and link to it.