Back in Sept 2015, CSS for mobile was only 6.4kb for an anonymous user (T97289) with JS disabled.
Since then it's been steadily increasing and it's not 9.3kb.
After a brief investigation, we can remove up to 2-3kb (20-30%) of CSS from the critical path. This should improve the time to first paint for all our users, meaning they can access our content quicker (how much quicker I'm not sure, but we can find out and I suspect it's noticeable)
To do so we'd make the following changes
[] Simplify #page-actions rules which are unnecessarily verbose
[] Restrict gallery styles to only pages which need it - we currently load all styles for galleries on all pages. We should use mediawiki.page.gallery.styles instead.
[] Separate styles for logged in users from anons - this is a huge saving and mostly focuses around the notification icon
[] Do not load overlay styles on page load. For some reason we do this and there is no need.
[] Load mw-ui-button-group only on special pages which need it
[] Do not load mw-ui-button on page load - this is a large stylesheet and we should look to load a minimal version on the critical path. This should cover basic padding/colors for a neutral button. We do not use progressive buttons anywhere in the main UI.
[] Load touch-events, position-fixed rules via JavaScript
[] Remove unused/redundant rules - we've picked up a lot of cruft over the years. multi-line and two-line, .mw-mf-banner, .mw-mf-image-replacement, .no-js-edit, .no-js-only, #mw-mf-last-modified seleectors
[] Limit #secondary-action . language-selector rule to main page - this is the only place it can be used
[] Restrict portal-column-left-wide rules to Portal: namespace
[] Move display:none rules to MobileFormatter e.g. #filetoc,.mw-editsection
[] Only load .beta code inside beta mode
[] Limit return-link css rule to pages that need it
After these changes, when loading page with JS disabled, I see unused CSS rules drop from 60% unused to 30% unused.
= Additional changes to investigate
[] Investigate whether the references-column-count, references-column-count,.column-count and references rules are redundant now given changes to Cite extension
[] Investigate whether lazy-image-placeholder css rules can be loaded via JS
[] Investigate what impact simplifying selectors for table/thumb would have