~/talk

Lessons Learned from Building a CSS Minifier

Talkat GOTO Copenhagen 2014 · 2014-09-25..09-26· [css, web-performance]
slides:none on file

Builds cssshrink.com, a JavaScript CSS minifier that uses the Gonzalez AST and npm modules, reuses the color library for brute‑force color shortening, and runs pixel‑diff tests with PhantomJS to assert visual parity. It removes comments/whitespace, strips units from zeros, removes unnecessary quotes, merges adjacent identical media queries/selectors, and drops duplicate declarations. A browser‑specific generation step cuts Bootstrap payload by about 48% for old IE, but the tool is not yet production‑benchmarked.

AI-written summary · about

  1. 0:00Introduction
  2. 1:05Agenda
  3. 3:21Motivation
  4. 6:58CSS is hard
  5. 8:22Crockford on CSS
  6. 9:43Solution
  7. 10:53Partial parsing
  8. 11:54How about
  9. 13:22Next: write a parser
  10. 14:06Next: use a parser
  11. 17:54Space, comments
  12. 18:41Colors
  13. 20:14Zeros, numbers
  14. 20:49Quotes
  15. 23:02Pseudo
  16. 24:39font-weight
  17. 24:50Lowercase
  18. 25:46Duplicate declarations
  19. 26:51Duplicate selectors
  20. 27:01Adjacent selectors
  21. 27:21Adjacent blocks
  22. 28:00Random nonsense
  23. 30:18Shorthands
  24. 31:00Unit conversions
  25. 31:43Duplicate keyframes
  26. 32:22Rename
  27. 33:31Supporting tools
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.