This is to investigate optimizing how we load OOUI in MediaWiki. I have some thoughts I have written down on another machine, that all seemed fairly easy to implement. They don't seem like large gains, but may be worth it.
- CSS minifier:
- Remove whitespace around CSS selectors: a + b, a > b, etc.; f.e. example #p-logo + div.portal h3
- Remove whitespace inside parentheses: ( foo ); f.e. example :lang( ml )
- Remove " from url() values and attribute selectors: url( "img.src" ), [type="radio"]
Remove leading 0 from fractional CSS values: 0.8emT111239- Ensure hex colors are output in shorthand notation: #fff (LESS compiler sets them back to 6-digit notation in contrast to f.e. Sass)
- Icons:
- Remove domain from URLs like //xx.wikipedia.org/w/load.php?...
- Remove whitespace and ids from embedded SVG files
- Reconsider Flow's use of .mw-ui-hovericon (dropdown menu items that gain progressive/constructive/destructive styling on hover) – T110051
- T175318: Optimize SVGs in data URIs
- T160690: Be able to request a custom icon pack on-the-fly without bloating RL module registry
Related T178867: [EPIC] Unify and optimize SVG markup across Foundation products
- ResourceLoader:
- Do something magical to avoid double-loading 'oojs-ui.styles' and friends due to T87871.