fonttools
purgecss
Our great sponsors
fonttools | purgecss | |
---|---|---|
17 | 51 | |
4,022 | 7,638 | |
1.9% | 0.4% | |
9.9 | 8.1 | |
6 days ago | 7 days ago | |
Python | TypeScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
fonttools
-
The new Google Fonts: find what you’re looking for
The tool parent and sibling comment listed allows you to do basic subsetting [1], and generates the formats you need. If you do this more often, it is of course useful to learn how to do this yourself. A commonly used tool is pyftsubset, part of fonttools [2]
-
Retro Pixel Font - A new font and the intro of how to make it
In short, I draw glyphs in png and use python to build fonts (by https://github.com/fonttools/fonttools ). I agreed on some rules and then everything became simple. No required professional font editer.
- I created a language for font design using FontForge
-
Self-Hosting Fonts - No more excuses
What I like the most is that you can also download google-fonts and convert them automatically. Webfont-Kit-Generator uses fonttools (written in Python), that's pretty cool too.
-
How much do custom fonts affect an app size?
A drawback to icon fonts is that by default, you are carrying all of the glyphs in an icon font along for the ride. You can mitigate that by using a tool like fonttools to strip out the unused font glyphs.
-
Montserrat cyrillic issues?
If you want to look inside a font file, you can use the ttx command line tool (included with fontTools) to convert binary fonts to human-readable XML format. You can also open them in a font editor like FontForge or Glyphs if you want a GUI, but font editors may not show you everything that's inside the file.
-
10 ways to speed up web font loading
Font subsetting means trimming your fonts down to only the characters you need. Subsetting can yield massive amounts of size savings without having any drawbacks as long as you are not using the characters you remove. The simplest way to do this is subsetting to remove languages that you do not use. For example, take Inter, one of the most popular fonts. If you include all languages, which includes the Latin alphabet, Cyrillic, Vietnamese, and Greek, the size of the WOFF2 font is 95kb. However, chances are you are not using all of those languages. If you remove all characters outside of the English language, the size is reduced to just 16kb! There are many ways to subset fonts, including Google Fonts (and by extension, Google Webfonts Helper), Everything Fonts, and fontTools.
-
The pdfplumber module is awesome
If you're in the first case, here's a good place to start reading: https://github.com/adobe-type-tools/cmap-resources. If you're in either the second or the third case, you'll have to use a library like fontTools (see here: https://github.com/fonttools/fonttools) to query the font's cmap table in reverse---if the subsetter didn't strip it out when embedding the font, that is! Note that this isn't guaranteed to work or yield a unique result, especially with non-Latin scripts.
-
How I reduced Raveberry's transferred frontend code by 90%
Similar to the approach used for the css code, the fonts were also modified to only contain used symbols. A script parses html and javascript files to find used identifiers. Then, fonttools is used to create a subtyped font file with only these symbols. Since Raveberry only uses a small set of icons and Font Awesome provides a lot of them, this approach eliminates the vast majority. The resulting font files are 6.7KB and 2.3KB, much smaller than the original ones.
purgecss
-
Optimize CSS with SAT Solving
As a starting point, Tailwind used to use PurgeCSS [0] but I'm not sure what they use now.
-
Frontend development roadmap
PurgeCss
-
Removing unused CSS in a Django template-based project
When I searched online I couldn't find an "industry standard" solution to this problem. What I ended up doing was using the popular tool PurgeCSS along with a quick Python script to generate the appropriate command. What the PurgeCSS tool does is search for all your HTML files, gather all the CSS classes used, and then "purge" all the unused ones from the CSS file. You just need to declare all the HTML files you have.
-
23 of the best Eleventy Themes (Starters) for 2023
Skeleventy gives you a rock-solid foundation to build fast and accessible static websites, with clean, understated design. Features include a minimal build pipeline with Laravel Mix, the Sass-powered utility class generator Gorko, Purge CSS, an HTML minifier, SEO-friendly page metadata, image lazy loading, responsive navigation, and an XML sitemap.
- Eliminating unused selectors from Sass
-
Workplaces for digital nomads: the frontend
Unable to get rid of unused styles. Importing components individually and setting styles in SASS can greatly simplify builds, but several common unused styles can't be deleted using PurgeCSS and analogues due to dynamic class names.
-
Does My Website Look Big in This? Six Tips to Lower your Page Weight
If you’re hand-crafting your CSS, using only the exact classes you need, you’ll still probably find that your CSS file size grows as your site does. But it doesn’t need to grow too much — you can remove unused classes with tools like Purge CSS .
-
Artisanal Web Development
Joost interprets this approach as deliberately avoiding frameworks that ‘simplify’ code by including predefined classes and functions that are shipped client-side, even if they’re not used. In principle you’d think these frameworks would be helpful, and they certainly can be, on the development side. The trouble is, unless they’re pared back with additional tooling (like PurgeCSS, for example), even well designed and developed sites can bloat significantly.
-
How to improve the PageSpeed score of your Nuxt.js website in 6 steps
Purge CSS is another great option to keep your stylesheet size low and increase the PageSpeed score. It's especially useful if you're importing some 3rd party stylesheets and would like to use only what's required. The configuration usually takes a bit of tinkering to get right, but it's definitely worth the effort.
-
Remove unused CSS with PurgeCSS
Check out PrugeCSS
What are some alternatives?
vue-vite-starter-template - A single page app Vite starter template, created to easily bootstrap Vue.js 2 apps
cssnano - A modular minifier, built on top of the PostCSS ecosystem.
PostCSS - Transforming styles with JS plugins
esbuild-loader - Webpack loader for esbuild: Speed up your build ⚡️
snarkdown - :smirk_cat: A snarky 1kb Markdown parser written in JavaScript
purifycss - Remove unused CSS. Also works with single-page apps.
twin.macro - 🦹♂️ Twin blends the magic of Tailwind with the flexibility of css-in-js (emotion, styled-components, solid-styled-components, stitches and goober) at build time.
storybook - Storybook is a frontend workshop for building UI components and pages in isolation. Made for UI development, testing, and documentation.
tailwindcss-jit
PrismJS - Lightweight, robust, elegant syntax highlighting.
uncss - Remove unused styles from CSS
Ahoy - Simple, powerful, first-party analytics for Rails