Uploaded image for project: 'Planet4'
  1. Planet4
  2. PLANET-5850

Investigate alternative to loading CSS variables ponyfill on all browsers

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Released
    • Icon: Should have Should have
    • 2.49.2
    • None
    • 3
    • Performance
    • Sprint #154
    • titan

      We currently load an additional external script that ensures CSS variables support on all browsers. This is actually only needed for a small part of browsers, so in probably over 99% of cases this degrades the performance with no benefit.

      I already tried using feature detection, but that didn't work reliably for me on Opera Mini.

      Options:

      • Feature detection
      • PostCSS plugin to include fallbacks (graceful degradation, won't support custom settings e.g. campaign sidebar)
      • Simply remove the script without alternative if the result looks acceptable.

       Previous attempt https://github.com/greenpeace/planet4-master-theme/compare/css-vars-feature-detection uses document.write, but it didn't work reliably on Opera mini. 

      Some info on this closed PR too https://github.com/greenpeace/planet4-master-theme/pull/1195 

      Tasks:

      • Investigate if it's worth it based on % of affected browsers
      • Implement solution if needed

            pvincent Pieter Vincent
            pvincent Pieter Vincent
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: