tomayac’s avatartomayac’s Twitter Archive—№ 13,442

      1. …in reply to @v8js
        @v8js @v8js’ dark mode is powered by <dark-mode-toggle> (github.com/googlechromelabs/dark-mode-toggle#readme) and uses method ② (github.com/GoogleChromeLabs/dark-mode-toggle/blob/master/README.md#-using-a-css-class-that-you-toggle), ie, a dark class. Usually, we recommend different stylesheets (web.dev/prefers-color-scheme/#stylesheet-architecture), but for v8.dev it wasn’t worth it (small files).
    1. …in reply to @tomayac
      @v8js Method ① (github.com/GoogleChromeLabs/dark-mode-toggle/blob/master/README.md#-using-different-stylesheets-per-color-scheme-that-are-conditionally-loaded), ie, different stylesheets, would’ve worked w/o JS (for the default color scheme, not the toggling), but because @v8js is about JS, and multiple CSS files would’ve meant touching the service worker logic, we decided for method ②, requiring JS.
  1. …in reply to @tomayac
    @v8js Shout out to @mathias and @RReverser who have helped golf ⛳️ down the size (bundlephobia.com/result?p=dark-mode-toggle@0.4.9) of <dark-mode-toggle>: github.com/GoogleChromeLabs/dark-mode-toggle. Now with this having landed, back to the fishing rod… 🎣 </online> x.com/tomayac/status/1180774251219111936