https://t.co/DnPwQxhXMt
https://t.co/SMN1pi8agT
https://t.co/FZuz0FzvsQ
https://t.co/IDQwSCHt5V
https://t.co/n6l64idlm4
https://t.co/IA4lDAgqCL
https://t.co/4ZrZTrs4IO
https://t.co/AV1Me7F2lz
https://t.co/bOKZHl8qP6
https://t.co/vp7WqfnuFK
https://t.co/VPBcYYnOsi
https://t.co/fwa1vYedDa
https://t.co/Xrd7U5PJab
https://t.co/T61syxgOHe
https://t.co/7CvndSkFrW
https://t.co/jzlINb7rxV
https://t.co/NMpl1IErLk
https://t.co/bD2MhN7dWq
https://t.co/GUJDDao6Nf
https://t.co/YRR0ZJn5Nl
https://t.co/HcShICxx74
https://t.co/asEf0It9Pd
https://t.co/0xMyPgYFjK
https://t.co/TuW9lKkXNM
https://t.co/yZzsJjvyQ9
https://t.co/MhrPlHMvwm
https://t.co/g8N5rJ52Yy
https://t.co/MP2Lsg5GTr
https://t.co/XBL79F391j
https://t.co/DqHIUeIvXu
https://t.co/41ofEBURsE
https://t.co/Cr6gq5uxXR
https://t.co/PhlwrHaVMO
https://t.co/8YTN4Aamu7
https://t.co/XXRdse2Xnc
https://t.co/UnwhuHEYsQ
https://t.co/He0uDYZ0Ru
https://t.co/Clcpy36ngs
https://t.co/N5Rx2X4Fv7
https://t.co/dhGD07KOBo
https://t.co/gb7MI8Anli
https://t.co/25yWqvMRnW
https://t.co/GROARD3hky
https://t.co/LVCnAdNOLG
https://t.co/cdWI5l4gfD
https://t.co/ioE3iwPKNG
https://t.co/cbbdvfbZt1
https://t.co/a4tp0FTkhh
https://t.co/Pu0gUocXNK
https://t.co/d1Xt8QTA8D
https://t.co/n3W2CLSMrJ
https://t.co/hqSznpW3Uu
https://t.co/yvtG509G4K
https://t.co/1TW5gQb0aP
https://t.co/8CUS3Tlv4r
https://t.co/Xc1OemqNzG
https://t.co/VF9rOWmgYK
https://t.co/IzCZW5tgnP
https://t.co/Yd4Vd67NeH
https://t.co/6dUx3F0tn3
https://t.co/nzoKyGAL1A
https://t.co/49HCM4z1Vj
https://t.co/0EztQoB1uT
https://t.co/NJ6NiegakN
https://t.co/2R2qPMsojJ

You May Also Like

A brief analysis and comparison of the CSS for Twitter's PWA vs Twitter's legacy desktop website. The difference is dramatic and I'll touch on some reasons why.

Legacy site *downloads* ~630 KB CSS per theme and writing direction.

6,769 rules
9,252 selectors
16.7k declarations
3,370 unique declarations
44 media queries
36 unique colors
50 unique background colors
46 unique font sizes
39 unique z-indices

https://t.co/qyl4Bt1i5x


PWA *incrementally generates* ~30 KB CSS that handles all themes and writing directions.

735 rules
740 selectors
757 declarations
730 unique declarations
0 media queries
11 unique colors
32 unique background colors
15 unique font sizes
7 unique z-indices

https://t.co/w7oNG5KUkJ


The legacy site's CSS is what happens when hundreds of people directly write CSS over many years. Specificity wars, redundancy, a house of cards that can't be fixed. The result is extremely inefficient and error-prone styling that punishes users and developers.

The PWA's CSS is generated on-demand by a JS framework that manages styles and outputs "atomic CSS". The framework can enforce strict constraints and perform optimisations, which is why the CSS is so much smaller and safer. Style conflicts and unbounded CSS growth are avoided.