real-world-css-libraries
v1.0.6
Published
Unminified, real-world, CSS files from open source projects.
Readme
real-world-css-libraries
Corpus of unminified, real-world, CSS files from open source projects.
For use in minification tests and tooling benchmarks.
To see how various CSS Minification Tools perform when minifying these files:
- https://www.keithcirkel.co.uk/css-minify-tests/#real-world
Usage
npm i -D real-world-css-libraries
// Import the synchronous function
import getRealWorldCSS from 'real-world-css-libraries';
let libraries = [];
try {
libraries = getRealWorldCSS();
} catch (error) {
console.log('Failed to read the CSS files.');
console.log(error);
}
console.log(libraries);
/*
* [
* {
* fileName: '960.gs-v0.0.0.css',
* name: '960.gs',
* version: 'v0.0.0',
* license: 'GPL-3.0 or MIT',
* source: '/*\n 960 Grid System ~ Core CSS.\n Learn more ~ http://9...',
* size: 9989,
* url: 'https://github.com/nathansmith/960-Grid-System/blob/master/code/css/960.css'
* },
* {
* fileName: 'animate-v4.1.1.css',
* name: 'Animate',
* version: 'v4.1.1',
* license: 'Hippocratic-2.1',
* source: '@charset "UTF-8";\n/*!\n * animate.css - https://animate.s...',
* size: 95377,
* url: 'https://github.com/animate-css/animate.css/blob/main/animate.css'
* },
* ...
* ]
*/
// Example: If you only wanted the names of libraries that use MIT License:
const namesOfLibrariesCompatibleWithMITLicense = libraries
.filter((library) => {
return library.license.includes('MIT');
})
.map((library) => {
return library.name;
});
console.log(namesOfLibrariesCompatibleWithMITLicense);
// ['960.gs', '98', 'AdminLTE', ...]Note: The size is from the original file size on disk. This will be different from source.length. If you are comparing the output of a minifier, for example, by using output.length of it as a string, then to get a more accurate comparison for percentage of size reduction, you should use output.length / source.length instead of output.length / size. Counting the number of characters is different than the actual filesize, because not all characters are 1 byte.
Non-npm usage
If you are using a different programming language/package management system and can't npm i this library, you have some other options:
- Download via
gitgit clone https://github.com/TheJaredWilcurt/real-world-css-libraries.gitgit clone [email protected]:TheJaredWilcurt/real-world-css-libraries.git
- HTTPS download via UNPKG:
- https://app.unpkg.com/real-world-css-libraries
- Manually download repo as a ZIP file:
- https://github.com/TheJaredWilcurt/real-world-css-libraries/archive/refs/heads/main.zip
Then you can then use the metadata.json file and loop over the files in the libs folder yourself, for your usage.
Adding a library
- Ensure it is part of a public repo that has an open source license
- Create a file in the
libsfolder with the name lowercased and hyphenated, then a-vfollowed by the version number (if the source is not versioned, use0.0.0), then.css - The first line of the file must follow this pattern for automation to work:
[Slash][Asterisk][Space][URL_TO_SOURCE][Space][Asterisk][Slash][New line]- Example:
/* https://github.com/user/repo/tree/main/file.css */
- The last line of the CSS file must be a
/n(new line character). - If the source does not use MIT license, update the
nameLicenseMapinindex.js. - Run
npm t, this will preview the output and update the list of libraries in theREADME.md- If the new library's name needs correcting (like
Mycssreposhould beMy CSS Repo), updatenameMapinindex.jsand runnpm tagain.
- If the new library's name needs correcting (like
License
This repo and all original work within is licensed under MIT. However, the files in the libs folder have their own licenses, which can be seen below. I've modified each file to include a single line comment at the top with a link to the original source file, and where needed, ensured there is a single empty return at the end of each file. For simplicity, each of these changes is re-licensed using the exact same original license that was associated with that library. So the (slightly) modified copy of FF-Ultima in /libs/ff-ultima-v4.3.0.css, for example, retains it's original MPL-2.0 license. Effectively all the files in the /lib folder have a "pass-through" license back to their original in the sense that my modifications are intentionally minor and inconsequential and therefor should not require a re-licensing of them, but if in a legal sense these minor changes require re-licensing, they are intentionally re-licensed with a matching license of the original. No other changes were made to these files, as I want to keep them representative to what exists in the real world, bugs and all.
Skipped Libraries
These libraries were explicitly not included because they lack a compatible license. Issues have been created for them to add a license, if they do in the future, they can be included in this repo.
- https://github.com/cyanharlow/purecss-francine/issues/63
- https://github.com/datguypiko/Firefox-Mod-Blur/issues/238
- https://github.com/pattle/simpsons-in-css/issues/3
- https://github.com/soulwire/Makisu/pull/23
- https://github.com/jackyzha0/sunlit/issues/4
- https://github.com/replete/obsidian-minimal-theme-css-snippets/issues/13
Libraries included:
There are 220 files totaling 41.61MB of unminified CSS.
Library | License :-- | :-- 30 Days 30 Submits #18 | MIT 3D transforms | MIT 960.gs | GPL-3.0 or MIT 98 | MIT Academicons | MIT AdminHub | MIT AdminLTE | MIT AMOLED-cord | MIT Animate | Hippocratic-2.1 Animating Hamburger Icons | MIT Animo | MIT Animsition | MIT Awesome Bootstrap Checkbox | MIT Balloon | MIT Basscss | MIT Beer CSS | MIT Blooger_Website | Apache-2.0 Blue-Topaz Obsidian | MIT Boilerform | MIT Bojler | MIT Bootplus | Apache-2.0 or GPL-2.0 Bootstrap 4 | MIT Bootstrap 5 | MIT Bttn | MIT Bulma | MIT Carbon | Apache-2.0 Cardinal | MIT Checka11y | MIT Chota | MIT Cirrus | MIT Classless | MIT CleanSlate | MIT ClickEffects | MIT CodeFrame | MIT Colofilter | MIT Concise | MIT Crayon | MIT CrookedStyleSheets | MIT cs16.css | MIT CSS Diner | MPL-2.0 CSS Plot | MIT CSS Social Buttons | MIT CSS Spinners | MIT CSS Zen Garden #215 | CC-BY-NC-SA-1.0 css-extras | CC0-1.0 or MIT CSS3 Buttons | MIT CSSCO | MIT cssicon | CC0-1.0 Cutestrap1 | MIT Cutestrap2 | GPL-3.0 Destyle | MIT Devices | MIT Doxygen Awesome | MIT Effeckt | MIT ElegantFin | MIT Enferno | MIT Evil | Public Domain Facebook Buttons | MIT FF-Ultima | MPL-2.0 Fileicon | MIT Finimalism | GPL-3.0 Firefox-ONE | MPL-2.0 Firefox-UWP-Style | MIT Flakes | MIT Flex Layout Attribute | MIT FluentBird | MIT Fomantic UI | MIT Font Awesome | MIT Foundation | MIT Freebies | MIT Furatto | MIT Gallery | MIT GitHub-Dark | BSD-2-Clause GitHub-Markdown | MIT GitHub-Windows | MIT gitweb-theme | MIT google-type | MIT Gridism | MIT Gridlex | MIT Gumby | MIT Gutenberg | MIT Halfmoon | MIT HalfStyle | MIT Hint | MIT Holmes | GPL-3.0 Hover Buttons | MIT HTML Sheets of Paper | MIT Hugo Universal Theme | MIT Icon Hover Effects | MIT Instagram.css | MIT Jupyter Themes | MIT Justified | MIT Kickoff | MIT KNACSS | WTFPL Less Framework | MIT Linktree | MIT littlebox | MIT Load Awesome | MIT Loaders | MIT Luxbar | MIT Lynx | MIT markdown-css | MIT Material for Bootstrap | MIT medium.css | MIT Meyer | Public Domain Microsoft Metro Buttons | CC-BY-3.0 Microtip | MIT Mini Reset | MIT Mini | MIT Missing | BSD-2-Clause Mobi | MIT Mocka | MIT Modern CSS Resets | MIT MVCSS | MIT MVP | MIT My Internet | MIT Natural Selection | MIT NES.css | MIT Normalize | MIT object-fit Polyfill | MIT Obnoxious | MIT Obsidian Colored Sidebar | MIT Obsidian Modular CSS Layout | GPL-3.0 Obsidian Notebook Themes | MIT OffCanvasMenuEffects | MIT Orbit | MIT OrgCSS | MIT or 996ICU Paper | MIT PatternBolt | MIT PatternFly | MIT Pesticide | MIT Phonon | MIT Photon | MIT Picnic | MIT Pico | MIT Pills | MIT Portfolio Template | GPL-3.0 Preboot | MIT Pretty Checkbox | MIT Progress Tracker | MIT ProtonMail Themes | GPL-3.0 ProxMorph | MIT Pure | BSD-3-Clause Pygments Fruity | Unlicense Ratchet | MIT Remedy Quotes | MPL-2.0 Remedy | MPL-2.0 Repaintless | MIT Reset | MIT Responsive 4 | MIT Responsive 5 | MIT Ress | MIT Ripple UI | MIT Sakura | MIT Sanitize | CC0-1.0 SAPC-APCA | AGPL-3.0 Select2 Bootstrap | MIT Select | MIT Semantic UI | MIT Shards | MIT Shina Fox | MPL-2.0 Sierra | GPL-2.0 Simple Grid | MIT Simple Line Icons | MIT Simple | MIT SimpTip | MIT Skeleton | MIT SlitSlider | MIT Social Sign-in Buttons | Unlicense SPCSS | MIT Spectre | MIT Spicetify Bloom | MIT Spicetify Dribbblish | MIT Spicetify Text | MIT Spinkit | MIT Stackicons | MIT StackOverflow-Dark | CC-BY-SA-4.0 Stacks | MIT Swagger UI Themes 2 | MIT Swagger UI Themes 3 | MIT System | MIT Tablecloth | MIT Tachyons | MIT Tailwind Cards | MIT Tailwind | MIT The 50 Front-end Project #44 | BSL-1.0 The New CSS Reset | MIT Toast | MIT Tocas | MIT Tooltip Twispy | MIT Tootik | MIT Tuesday | MIT Tufte | MIT Tui | MIT tw-animate-css | MIT UIkit | MIT Unfold | CC-BY-SA-3.0 Universal.css | WTFPL USWDS | CC0-1.0 Utility OpenType | MIT Vim CSS3 Syntax | MIT Virtual Bookshelf | Unlicense VitePress | MIT Vivify | MIT Voxels | MIT w3css | MIT Waffle Grid | MIT Water | MIT Weather Icons | MIT Webgradients | MIT Wenk | MIT Wikipedia Dark | CC-BY-SA-4.0 Windows 95 | MIT Windows 98 | MIT Wing | MIT Woah | MIT WTF Forms | MIT YaCy | CC-BY-2.0 Yue | MIT Zotero Dark Theme | GPL-3.0
