A place to cache linked articles (think custom and personal wayback machine)
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

index.html 27KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <!doctype html><!-- This is a valid HTML5 document. -->
  2. <!-- Screen readers, SEO, extensions and so on. -->
  3. <html lang="en">
  4. <!-- Has to be within the first 1024 bytes, hence before the `title` element
  5. See: https://www.w3.org/TR/2012/CR-html5-20121217/document-metadata.html#charset -->
  6. <meta charset="utf-8">
  7. <!-- Why no `X-UA-Compatible` meta: https://stackoverflow.com/a/6771584 -->
  8. <!-- The viewport meta is quite crowded and we are responsible for that.
  9. See: https://codepen.io/tigt/post/meta-viewport-for-2015 -->
  10. <meta name="viewport" content="width=device-width,initial-scale=1">
  11. <!-- Required to make a valid HTML5 document. -->
  12. <title>Tech doesn’t make our lives easier. It makes them faster (archive) — David Larlet</title>
  13. <meta name="description" content="Publication mise en cache pour en conserver une trace.">
  14. <!-- That good ol' feed, subscribe :). -->
  15. <link rel="alternate" type="application/atom+xml" title="Feed" href="/david/log/">
  16. <!-- Generated from https://realfavicongenerator.net/ such a mess. -->
  17. <link rel="apple-touch-icon" sizes="180x180" href="/static/david/icons2/apple-touch-icon.png">
  18. <link rel="icon" type="image/png" sizes="32x32" href="/static/david/icons2/favicon-32x32.png">
  19. <link rel="icon" type="image/png" sizes="16x16" href="/static/david/icons2/favicon-16x16.png">
  20. <link rel="manifest" href="/static/david/icons2/site.webmanifest">
  21. <link rel="mask-icon" href="/static/david/icons2/safari-pinned-tab.svg" color="#07486c">
  22. <link rel="shortcut icon" href="/static/david/icons2/favicon.ico">
  23. <meta name="msapplication-TileColor" content="#f7f7f7">
  24. <meta name="msapplication-config" content="/static/david/icons2/browserconfig.xml">
  25. <meta name="theme-color" content="#f7f7f7" media="(prefers-color-scheme: light)">
  26. <meta name="theme-color" content="#272727" media="(prefers-color-scheme: dark)">
  27. <!-- Is that even respected? Retrospectively? What a shAItshow…
  28. https://neil-clarke.com/block-the-bots-that-feed-ai-models-by-scraping-your-website/ -->
  29. <meta name="robots" content="noai, noimageai">
  30. <!-- Documented, feel free to shoot an email. -->
  31. <link rel="stylesheet" href="/static/david/css/style_2021-01-20.css">
  32. <!-- See https://www.zachleat.com/web/comprehensive-webfonts/ for the trade-off. -->
  33. <link rel="preload" href="/static/david/css/fonts/triplicate_t4_poly_regular.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" crossorigin>
  34. <link rel="preload" href="/static/david/css/fonts/triplicate_t4_poly_bold.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" crossorigin>
  35. <link rel="preload" href="/static/david/css/fonts/triplicate_t4_poly_italic.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" crossorigin>
  36. <link rel="preload" href="/static/david/css/fonts/triplicate_t3_regular.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: dark)" crossorigin>
  37. <link rel="preload" href="/static/david/css/fonts/triplicate_t3_bold.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: dark)" crossorigin>
  38. <link rel="preload" href="/static/david/css/fonts/triplicate_t3_italic.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: dark)" crossorigin>
  39. <script>
  40. function toggleTheme(themeName) {
  41. document.documentElement.classList.toggle(
  42. 'forced-dark',
  43. themeName === 'dark'
  44. )
  45. document.documentElement.classList.toggle(
  46. 'forced-light',
  47. themeName === 'light'
  48. )
  49. }
  50. const selectedTheme = localStorage.getItem('theme')
  51. if (selectedTheme !== 'undefined') {
  52. toggleTheme(selectedTheme)
  53. }
  54. </script>
  55. <meta name="robots" content="noindex, nofollow">
  56. <meta content="origin-when-cross-origin" name="referrer">
  57. <!-- Canonical URL for SEO purposes -->
  58. <link rel="canonical" href="https://brettscott.substack.com/p/tech-doesnt-make-our-lives-easier">
  59. <body class="remarkdown h1-underline h2-underline h3-underline em-underscore hr-center ul-star pre-tick" data-instant-intensity="viewport-all">
  60. <article>
  61. <header>
  62. <h1>Tech doesn’t make our lives easier. It makes them faster</h1>
  63. </header>
  64. <nav>
  65. <p class="center">
  66. <a href="/david/" title="Aller à l’accueil"><svg class="icon icon-home">
  67. <use xlink:href="/static/david/icons2/symbol-defs-2021-12.svg#icon-home"></use>
  68. </svg> Accueil</a> •
  69. <a href="https://brettscott.substack.com/p/tech-doesnt-make-our-lives-easier" title="Lien vers le contenu original">Source originale</a>
  70. <br>
  71. Mis en cache le 2024-02-03
  72. </p>
  73. </nav>
  74. <hr>
  75. <p>We have far more technology than any other generation in human history, and it allows us to do things in a fraction of the time that our ancient ancestors did. It must surely follow that we’re the most relaxed generation of all time. Agree?</p>
  76. <p><span>You might find that claim dubious, but if adverts are to be believed, AI, digital payments, self-driving cars and automation in general is only there to make our lives </span><em>easier. </em><span>We carry in our pockets a powerful computer that can take on the role of your personal navigator, translator, matchmaker, meditation teacher, and banker. With so many of our tasks automated, our leisure time must have expanded greatly. Right?</span></p>
  77. <p><span>It matters how we frame this question. If you ask ‘are we working less than before’, research is ambiguous. In rich countries people work less than labourers who toiled during the 19th century industrial revolution, but more than our ancient ancestors. If you ask ‘are our lives more leisurely than ever’, the answer is less ambiguous. Many people feel their lives are frenetic. We’re not only expected to work a lot. We’re expected to</span><em> consume</em><span> a lot. Ask ‘are we more chilled out than ever?’ and the answer is no. People are strung out, stressed out, and burned out.</span></p>
  78. <p><span>There’s more to work than the amount of time spent doing it. Carving a wooden door frame for ten hours in the 1600s is a very different emotional experience to jumping between a hundred emails, meetings and micro-tasks for four hours in 2023. Levels of workplace burnout have skyrocketed. We might think we’ve escaped Charles Dickens’ 19</span><sup>th</sup><span> century sweatshop dystopia, but our global economy now apportions drudge-work to labourers in the Global South while middle-class workers plug into an attention-burning digital matrix that yokes us far beyond ordinary work hours. There’s all sorts of ‘half-work’ going on, such as checking emails while eating breakfast, and promoting yourself via Instagram while on holiday. Even our consumption has become unpaid work: every act of buying something with a card, watching a streaming show, or using Google Maps to get to a concert produces data that will train AIs for big tech.</span></p>
  79. <p>It’s easy to brush these off as unintended by-products of digital life, a necessary downside to the great benefits brought to us by tech. To truly understand our predicament, however, requires us to look at this systemically. We don’t just live in any economy. We live in a mega-scale corporate capitalist economy, and in such a setting technology is never used to save time. It’s used to speed up production and consumption in order to expand the system. The basic rule is this: technology doesn't make our lives easier. It makes them faster and more crammed with stuff.</p>
  80. <div class="captioned-image-container"><figure><a class="image-link is-viewable-img image2" target="_blank" href="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9c525fe-0171-48bc-99c1-53bb8e1887e9_1000x1312.jpeg" data-component-name="Image2ToDOM" rel></a><figcaption class="image-caption">Ye olde rough path to the meadow</figcaption></figure></div>
  81. <p>Let’s look at an example. Imagine it’s the mid-1700s and you live three miles from the meadow where you work the soil. It takes you an hour to walk there along a rough path. Now fast-forward two hundred years. The rough path has been replaced with a smooth highway, and now it takes only ten minutes to drive to the same point by car. Surely you’ve saved 50 minutes? Maybe you can relax in that time, read poetry and smell flowers.</p>
  82. <p><span>But that’s not what happens. In our actual system the technology will be enlisted to expand and accelerate everything. Your meadow will be paved over and replaced with a mall, and you’ll now live in the suburbs of a metropolis. You’re still going to travel for an hour to work, but you’ll now drive at 30mph for 30 miles, instead of walking at 3mph for three. You don’t get to liberate time for yourself by holding your geographic scale constant while your speed increases. No, your geographic scale will expand as your speed does, and this is how mega-cities like Los Angeles develop. They’re </span><em>catalyzed</em><span>, or unleashed, by cars.</span></p>
  83. <p><hr></p>
  84. <p><em>Want to listen to this piece? Find it in audio form on ASOMOCO Audio Edition</em></p>
  85. <p><hr></p>
  86. <p>This principle applies far beyond cars. Our modern lives are built from globe-spanning supply chains that require vast logistics systems and incredible communication speed to make sense. Each technology not only unlocks a new state of expanded acceleration (that will be hardcoded into our lives as the new basis for our survival), but will also be used as the basis for new technologies to continue that process. The vast majority of people do not experience this technology as ‘liberating’ them. Rather, they experience it as something that propagates itself around them, and something they must race to keep up with in order to not be ‘left behind’.</p>
  87. <p>Consider the current AI hype. Believing that AI will save time is like being a person in the late 1800s seeing their first car and thinking “oh how easy it’ll be to get to the meadow now!” People back then didn’t imagine that by the 1960s we’d be stuck in traffic jams for hours in mega-cities. Now apply this to AI. If we fast-forward a decade, it will have recalibrated the entire economy to a state of higher acceleration where you’ll be expected to do far more, at much greater scale, in the same amount of time. At that point, if you’re not using it you’ll feel like a 19th century villager who finds themselves trying to walk to work in the middle of modern Los Angeles.</p>
  88. <p class="button-wrapper" data-attrs='{"url":"https://brettscott.substack.com/p/tech-doesnt-make-our-lives-easier?utm_source=substack&amp;utm_medium=email&amp;utm_content=share&amp;action=share","text":"Share","action":null,"class":"button-wrapper"}' data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://brettscott.substack.com/p/tech-doesnt-make-our-lives-easier?utm_source=substack&amp;utm_medium=email&amp;utm_content=share&amp;action=share" rel><span>Share</span></a></p>
  89. <p><span>This is why the stories we hear about tech are so rife with cognitive dissonance. Marketers and futurists first place themselves in the position of our proverbial villager - hyping the convenience of AI - but if you say you don’t need it they fast-forward their minds into the future and issue dire warnings that if don’t adopt it you’ll be </span><em>left behind</em><span>. What they’re trying to say, in their convoluted and euphemistic way, is this: </span><strong>the global capitalist system doesn’t care whether or not you want to use the technology, or whether you believe it should be used to save your time</strong><span>. </span><strong>You will have to use it, and you’re not in charge of how it will be used systemically</strong><span>. In fact, </span><em>nobody</em><span> is really in charge. Our personal desires will always play second fiddle to the systemic logic of a large-scale economy that is blind to anything except the profit motive. In the absence of us being able to get together and demand something different, our system will always just </span><em>default</em><span> towards increasingly speed and growth. It only has one gear.</span></p>
  90. <p>This is why innovation futurists get stuck in doublethink. They tell you technological change is ‘inevitable’, and that you better sync up, but soften the blow by telling you it’s all happening because you desire it and will benefit. We have to emotionally cope with the state of inertia we’re in, so we accept this circular reasoning. </p>
  91. <p><span>Let’s illustrate this by returning to the Los Angeles example. L.A. only exists in its current form </span><em>because</em><span> of cars, which means life will be difficult there if you don’t have one. In this scenario you’re essentially held hostage by the auto industry, whose products are the very thing that have catalysed our dependence on giant megacities. Rather than acknowledge that, we lapse into a type of </span><a href="https://en.wikipedia.org/wiki/Stockholm_syndrome" rel>Stockholm Syndrome</a><span> where we choose to imagine the car as a saviour that grants us our independence in that context. In reality, the car is just a minimum requirement to scrape by in a car-catalysed environment (to explore this, check out this piece about navigating </span><a href="https://walkingtheworld.substack.com/p/la-without-a-car-part-2" rel>LA by foot</a><span>). Certainly, there are many people in LA who have cars, but who struggle just as much as our ancient ancestors did. There are also many without cars, who struggle far more.</span></p>
  92. <div class="captioned-image-container"><figure><a class="image-link is-viewable-img image2" target="_blank" href="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6713038e-bfce-46fb-932e-796f419b04ac_2048x1253.jpeg" data-component-name="Image2ToDOM" rel></a><figcaption class="image-caption"><span>Life in the shadows of LA (thanks to </span><a href="https://walkingtheworld.substack.com/p/la-without-a-car-part-2" rel>Chris Arnade</a><span> for allowing use of this image)</span></figcaption></figure></div>
  93. <p><span>This topic is close to my heart, because I </span><a href="https://www.penguin.co.uk/books/439997/cloudmoney-by-scott-brett/9781529111484" rel>campaign to protect physical cash</a><span> in places where ‘cashless’ digital payments are spreading. I characterise cash as the </span><a href="https://brettscott.substack.com/p/the-luddites-guide-to-defending-physical-cash" rel>bicycle of payments</a><span>, but the conventional story is that it’s the horse-cart, and that digital payments are rising because they’re more efficient. In the standard view, all the downsides of digital payment (like surveillance, cyber-hacking and centralization of power into Big Finance and Tech) are just manageable by-products of our desire for convenience. Whole sections of London are now cashless (aka. serfdoms of the banking sector), and when asked why, many Londoners do say it’s because cash is ‘inconvenient’, parroting a story that’s also told by the businesses that refuse cash.</span></p>
  94. <div class="captioned-image-container"><figure><a class="image-link is-viewable-img image2" target="_blank" href="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb69f17f-4d30-446a-bf68-24545a00386f_1000x1333.jpeg" data-component-name="Image2ToDOM" rel></a><figcaption class="image-caption">“We only do this because it’s for your own good”</figcaption></figure></div>
  95. <p>What’s fascinating, however, is that these very same people didn’t experience this inconvenience ten years ago, when it felt totally normal to use cash in the UK. If I hop across to Germany, people of exactly the same social class don’t experience this inconvenience even now. In fact, there are hundreds of millions of people across the world who view the cash system as easy to use. So, why do perceptions of inconvenience change depending on where you go and when?</p>
  96. <p><span>Convenience and inconvenience are not absolute properties that can be universally measured or experienced. In my birth country of South Africa, where the pace of life and expectations are different, cash feels totally normal, but in London it doesn’t. That’s because the city is moving into a state of higher automation-acceleration. In the early phases of their London takeover, digital payments companies invested hugely into nudging people towards the belief that cash was inconvenient (through marketing campaigns, and so on), but it’s only when the vortex of automation reorganized the environment that it started to </span><em>feel</em><span> like that. If you’re trying to use cash in Sweden, where many service jobs have been replaced by cash-refusing machines plugged directly into the banking sector (via Visa and Mastercard), it’s going to feel like you’re swimming against the tide. It literally will start to feel arduous to use cash, because the ATMs have been shut down, the branches won’t take it, and you keep getting refused when you try use it. What’s actually happening is that digital payments are being used to accelerate everything, but if you’re a person trying to live a slower life amidst all the others who are trying to keep up, you’ll find yourself out of sync. You’ll not only be culturally shamed for not adopting the new thing, but at some point you’ll simply be blocked, because the foundations of your existence - like the London train system - will force you down the automated path.</span></p>
  97. <div class="captioned-image-container"><figure><a class="image-link is-viewable-img image2" target="_blank" href="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87f163c4-78e3-45dc-ac73-3ee53687a97c_621x760.jpeg" data-component-name="Image2ToDOM" rel></a><figcaption class="image-caption">“You can use any shade of payment, as long as its digital”</figcaption></figure></div>
  98. <p>Because we’re social animals we tend to go along with the trend, and because we live under capitalist acceleration the trend is always one way, because our system only has one gear. We also have the ability to edit our memories, so can find ways to convince ourselves that this was all our own choice. That very same adaptability, though, prevents us from using the new tech to save time, because – under a system with a growth fetish – we’ll be expected to adapt to a new normal in which we have to do more stuff and get more stuff in the same amount of time.</p>
  99. <p>The dark irony then, is that it is the introduction of the new tech that inspires the subsequent irritation at its absence. Twenty years ago nobody fidgeted in agitation if they had to wait ten minutes for a taxi. Now you’ll check your phone incessantly if the Uber is running three minutes later than you expected. And god forbid the driver cancels, because you’ve probably algorithmically planned everything down to the last minute. We increasingly live a ‘just in time’ life because, at a systemic level, there’s pressure to pack in as much stuff as possible at both a consumption and production level. We’re just as dissatisfied, only busier.</p>
  100. <p><span>We face the same issue with the cashless ‘Uberfication’ of payments, but also with AI. The latter will just increase systemic acceleration, after which any situation in which the tech is not available will be perceived as ‘inconvenient’. This – in true Stockholm Syndrome style – will be transformed into a belief that AI is a saviour that helps us survive in a frenetic world (cue all the adverts that start with ‘In today’s fast-paced business environment, AI is more vital than ever…”). In reality, we’ll just be more burned out, which in turn will be weaponised to sell us more acceleration tech. </span><em>Feeling burned out? Why not automate more?</em></p>
  101. <p><span>When trying to defend this, economists typically claim that we have unlimited desire for new stuff. Apparently, rather than dedicating the time gains from technology to leisure, we pour it into making more stuff for ourselves. This is bogus. People do have a limited desire for new things, because dedicating yourself to endless production (and consumption) comes at the expense of hanging out with your family, friends and pets, or doing stuff like walking in the wilderness or surfing the waves. What people actually desire is a </span><em>balance</em><span> of many things, but the system we’re stuck in has unlimited desire for one direction only. That’s because it’s a vortex unleashed by humans who no longer know how to stop it.</span></p>
  102. <p><span>In the mythology of Silicon Valley, and in corporate capitalism more generally, it’s believed that we expand alongside our system, and that new products are turning us into fuller expressions of ourselves. In reality, we’re biological beings with finite capacities ensnared within an economy with an acceleration drive, and its constant attempt to expand just crowds out other stuff in our lives. It’s like opening the tap in a bath that’s already full, and then watching the new water push other water into the overflow. Beyond the ‘overflow’ point, all the happens is that we become more confused, bloated and strung out. The requirement to pack more into the same time just fragments our attention and erodes our patience, which again will be weaponised: </span><em>feeling impatient? Why not speed things up?</em></p>
  103. <p><span>The problem goes deeper than this. Increasingly our tech also opens us up to new vectors of anxiety. Regardless of whether you’re working more or less, your nervous system is now plugged into a neurotic and hypersensitive globe-spanning information system that’s constantly pushing unnecessary things into your consciousness. Perversely, this information obesity actually makes us feel more </span><em>sluggish</em><span>. We might be moving faster, but everything starts to blend into one. The whole point of digital detoxes isn’t only to slow down, but also to make you feel more in control of your life, rather than just drifting with the inertia.</span></p>
  104. <p><span>Given that most people don’t have the spare time to overthrow corporate capitalism (or its geopolitical foundations), is there any way to break out of this? A good starting point is to go down the Zen path and to realise that all these things we’re told we need are just illusions generated by the numb logic of a system that cannot value anything except accumulation and profit. From that point we can strive to build </span><strong>balances of power</strong><span> to prevent the worst excesses of the situation coming out. That’s why I do stuff like </span><a href="https://brettscott.substack.com/p/the-luddites-guide-to-defending-physical-cash" rel>defending physical cash</a><span>. If cash is the bicycle of payments, we have to fight for bicycle lanes. Remember, the only point at which new technology will be used to make our lives easier is at the point where we have a steady-state economy where leisure is valued, rather than a growth-based one. Until that happens, let’s stop deluding ourselves.</span></p>
  105. </article>
  106. <hr>
  107. <footer>
  108. <p>
  109. <a href="/david/" title="Aller à l’accueil"><svg class="icon icon-home">
  110. <use xlink:href="/static/david/icons2/symbol-defs-2021-12.svg#icon-home"></use>
  111. </svg> Accueil</a> •
  112. <a href="/david/log/" title="Accès au flux RSS"><svg class="icon icon-rss2">
  113. <use xlink:href="/static/david/icons2/symbol-defs-2021-12.svg#icon-rss2"></use>
  114. </svg> Suivre</a> •
  115. <a href="http://larlet.com" title="Go to my English profile" data-instant><svg class="icon icon-user-tie">
  116. <use xlink:href="/static/david/icons2/symbol-defs-2021-12.svg#icon-user-tie"></use>
  117. </svg> Pro</a> •
  118. <a href="mailto:david%40larlet.fr" title="Envoyer un courriel"><svg class="icon icon-mail">
  119. <use xlink:href="/static/david/icons2/symbol-defs-2021-12.svg#icon-mail"></use>
  120. </svg> Email</a> •
  121. <abbr class="nowrap" title="Hébergeur : Alwaysdata, 62 rue Tiquetonne 75002 Paris, +33184162340"><svg class="icon icon-hammer2">
  122. <use xlink:href="/static/david/icons2/symbol-defs-2021-12.svg#icon-hammer2"></use>
  123. </svg> Légal</abbr>
  124. </p>
  125. <template id="theme-selector">
  126. <form>
  127. <fieldset>
  128. <legend><svg class="icon icon-brightness-contrast">
  129. <use xlink:href="/static/david/icons2/symbol-defs-2021-12.svg#icon-brightness-contrast"></use>
  130. </svg> Thème</legend>
  131. <label>
  132. <input type="radio" value="auto" name="chosen-color-scheme" checked> Auto
  133. </label>
  134. <label>
  135. <input type="radio" value="dark" name="chosen-color-scheme"> Foncé
  136. </label>
  137. <label>
  138. <input type="radio" value="light" name="chosen-color-scheme"> Clair
  139. </label>
  140. </fieldset>
  141. </form>
  142. </template>
  143. </footer>
  144. <script src="/static/david/js/instantpage-5.1.0.min.js" type="module"></script>
  145. <script>
  146. function loadThemeForm(templateName) {
  147. const themeSelectorTemplate = document.querySelector(templateName)
  148. const form = themeSelectorTemplate.content.firstElementChild
  149. themeSelectorTemplate.replaceWith(form)
  150. form.addEventListener('change', (e) => {
  151. const chosenColorScheme = e.target.value
  152. localStorage.setItem('theme', chosenColorScheme)
  153. toggleTheme(chosenColorScheme)
  154. })
  155. const selectedTheme = localStorage.getItem('theme')
  156. if (selectedTheme && selectedTheme !== 'undefined') {
  157. form.querySelector(`[value="${selectedTheme}"]`).checked = true
  158. }
  159. }
  160. const prefersColorSchemeDark = '(prefers-color-scheme: dark)'
  161. window.addEventListener('load', () => {
  162. let hasDarkRules = false
  163. for (const styleSheet of Array.from(document.styleSheets)) {
  164. let mediaRules = []
  165. for (const cssRule of styleSheet.cssRules) {
  166. if (cssRule.type !== CSSRule.MEDIA_RULE) {
  167. continue
  168. }
  169. // WARNING: Safari does not have/supports `conditionText`.
  170. if (cssRule.conditionText) {
  171. if (cssRule.conditionText !== prefersColorSchemeDark) {
  172. continue
  173. }
  174. } else {
  175. if (cssRule.cssText.startsWith(prefersColorSchemeDark)) {
  176. continue
  177. }
  178. }
  179. mediaRules = mediaRules.concat(Array.from(cssRule.cssRules))
  180. }
  181. // WARNING: do not try to insert a Rule to a styleSheet you are
  182. // currently iterating on, otherwise the browser will be stuck
  183. // in a infinite loop…
  184. for (const mediaRule of mediaRules) {
  185. styleSheet.insertRule(mediaRule.cssText)
  186. hasDarkRules = true
  187. }
  188. }
  189. if (hasDarkRules) {
  190. loadThemeForm('#theme-selector')
  191. }
  192. })
  193. </script>
  194. </body>
  195. </html>