A place to cache linked articles (think custom and personal wayback machine)
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

index.html 25KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <!doctype html><!-- This is a valid HTML5 document. -->
  2. <!-- Screen readers, SEO, extensions and so on. -->
  3. <html lang="fr">
  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>In Portugal, There Is Virtually No One Left to Vaccinate (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. <!-- Documented, feel free to shoot an email. -->
  28. <link rel="stylesheet" href="/static/david/css/style_2021-01-20.css">
  29. <!-- See https://www.zachleat.com/web/comprehensive-webfonts/ for the trade-off. -->
  30. <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>
  31. <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>
  32. <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>
  33. <link rel="preload" href="/static/david/css/fonts/triplicate_t3_regular.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: dark)" crossorigin>
  34. <link rel="preload" href="/static/david/css/fonts/triplicate_t3_bold.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: dark)" crossorigin>
  35. <link rel="preload" href="/static/david/css/fonts/triplicate_t3_italic.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: dark)" crossorigin>
  36. <script>
  37. function toggleTheme(themeName) {
  38. document.documentElement.classList.toggle(
  39. 'forced-dark',
  40. themeName === 'dark'
  41. )
  42. document.documentElement.classList.toggle(
  43. 'forced-light',
  44. themeName === 'light'
  45. )
  46. }
  47. const selectedTheme = localStorage.getItem('theme')
  48. if (selectedTheme !== 'undefined') {
  49. toggleTheme(selectedTheme)
  50. }
  51. </script>
  52. <meta name="robots" content="noindex, nofollow">
  53. <meta content="origin-when-cross-origin" name="referrer">
  54. <!-- Canonical URL for SEO purposes -->
  55. <link rel="canonical" href="https://www.nytimes.com/2021/10/01/world/europe/portugal-vaccination-rate.html">
  56. <body class="remarkdown h1-underline h2-underline h3-underline em-underscore hr-center ul-star pre-tick" data-instant-intensity="viewport-all">
  57. <article>
  58. <header>
  59. <h1>In Portugal, There Is Virtually No One Left to Vaccinate</h1>
  60. </header>
  61. <nav>
  62. <p class="center">
  63. <a href="/david/" title="Aller à l’accueil"><svg class="icon icon-home">
  64. <use xlink:href="/static/david/icons2/symbol-defs-2021-12.svg#icon-home"></use>
  65. </svg> Accueil</a> •
  66. <a href="https://www.nytimes.com/2021/10/01/world/europe/portugal-vaccination-rate.html" title="Lien vers le contenu original">Source originale</a>
  67. </p>
  68. </nav>
  69. <hr>
  70. <div class="css-s99gbd StoryBodyCompanionColumn"><div class="css-53u6y8"><p class="css-axufdj evys1bk0">Portugal’s health care system was on <a class="css-1g7m0tk" href="https://www.nytimes.com/2021/02/02/world/europe/portugal-coronavirus-surge-hospitals.html" title="">the verge of collapse</a>. Hospitals in the capital, Lisbon, were <a class="css-1g7m0tk" href="https://www.aljazeera.com/features/2021/2/19/portugals-undertakers-struggle-to-cope-with-waves-of-covid-dead" title="" rel="noopener noreferrer" target="_blank">overflowing</a> and the authorities were asking people to treat themselves at home. In the last week of January, nearly 2,000 people died as the virus spread.</p><p class="css-axufdj evys1bk0">The country’s vaccine program was in a shambles, so the government turned to Vice Adm. Henrique Gouveia e Melo, a former submarine squadron commander, to right the ship.</p><p class="css-axufdj evys1bk0">Eight months later, Portugal is <a class="css-1g7m0tk" href="https://www.nytimes.com/interactive/2021/world/covid-vaccinations-tracker.html" title="">among the world’s leaders</a> in vaccinations, with roughly 86 percent of its population of 10.3 million fully vaccinated. About 98 percent of all of those eligible for vaccines — meaning anyone over 12 — have been fully vaccinated, Admiral Gouveia e Melo said.</p><p class="css-axufdj evys1bk0">“We believe we have reached the point of group protection and nearly herd immunity,” he said. “Things look very good.”</p></div></div>
  71. <div class="css-s99gbd StoryBodyCompanionColumn"><div class="css-53u6y8"><p class="css-axufdj evys1bk0">On Friday, Portugal ended nearly all of its coronavirus restrictions. There has been a sharp drop in new cases, to about 650 a day, and <a class="css-1g7m0tk" href="https://www.ecdc.europa.eu/en/cases-2019-ncov-eueea" title="" rel="noopener noreferrer" target="_blank">vanishingly few deaths</a>.</p></div></div>
  72. <div class="css-s99gbd StoryBodyCompanionColumn"><div class="css-53u6y8"><p class="css-axufdj evys1bk0">Many Western nations fortunate enough to have abundant vaccine supplies have seen <a class="css-1g7m0tk" href="https://www.nytimes.com/interactive/2020/us/covid-19-vaccine-doses.html" title="">inoculation rates</a> plateau, with more than 20 percent of their populations still unprotected. So other governments are looking to Portugal for possible insights and are watching closely to see what happens when nearly every eligible person is protected.</p><p class="css-axufdj evys1bk0">False dawns in the coronavirus pandemic have been as common as new nightmare waves of infection. So Portugal could still see a setback as the Delta variant continues to spread globally.</p><p class="css-axufdj evys1bk0">There have been worrying signs from Israel and elsewhere that protection offered by vaccines can fade over time, and a worldwide debate is raging over who should be offered booster shots and when.</p></div></div>
  73. <div class="css-s99gbd StoryBodyCompanionColumn"><div class="css-53u6y8"><p class="css-axufdj evys1bk0">Portugal may soon start offering boosters to older people and those deemed clinically vulnerable, Admiral Gouveia e Melo said, and he was confident they could all be reached by the end of December.</p><p class="css-axufdj evys1bk0">But for the moment, as bars and nightclubs buzz with life, infections dwindle and deaths plummet, the country’s vaccination drive has succeeded even after encountering many of the same <a class="css-1g7m0tk" href="https://www.nytimes.com/2020/07/18/health/coronavirus-anti-vaccine.html" title="">hurdles that caused others to flounder</a>.</p><p class="css-axufdj evys1bk0">The same <a class="css-1g7m0tk" href="https://www.nytimes.com/live/2020/2020-election-misinformation-distortions" title="">flood of misinformation</a> about vaccines has filled the social media accounts of the Portuguese. The country is run by a minority <a class="css-1g7m0tk" href="https://www.nytimes.com/2019/10/06/world/europe/portugal-election-costa.html" title="">left-wing government</a>, a reflection of its political divisions. And, according to public opinion polls, there was widespread doubt about the vaccines when they first arrived.</p><p class="css-axufdj evys1bk0">Admiral Gouveia e Melo has been credited with turning it around. With a background working on complicated logistical challenges in the military, he was named in February to lead the national vaccination task force.</p><p class="css-axufdj evys1bk0">Standing 6 feet 3 inches, the admiral made it a point to wear only his combat uniform in his many public and television appearances as he sought to essentially draft the nation into one collective pandemic-fighting force.</p></div></div>
  74. <div class="css-s99gbd StoryBodyCompanionColumn"><div class="css-53u6y8"><p class="css-axufdj evys1bk0">“The first thing is to make this thing a war,” Admiral Gouveia e Melo said in an interview, recalling how he approached the job. “I use not only the language of war, but military language.”</p></div></div>
  75. <div class="css-s99gbd StoryBodyCompanionColumn"><div class="css-53u6y8"><p class="css-axufdj evys1bk0">While politicians around the world have invoked a similar martial rhetoric, he said it was critical to his success that he was widely seen as detached from politics.</p><div role="complementary" aria-labelledby="storyline-latest-updates" class="css-y1f5ai"><div class="css-8atqhb"><div class="css-rchdvv"><time class="css-101kej7" datetime="2021-10-03T22:54:17.000Z"><span>Updated </span><p class="css-ki347z"><span class="css-1stvlmo">Oct. 3, 2021, 6:54 p.m. ET</span><span class="css-kpxlkr"></span></p></time><span class="css-1dv1kvn" aria-live="polite"></span></div><p class="styln-survey-component" id="storyline-survey-latest-updates"></p></div></div><p class="css-axufdj evys1bk0">He quickly assembled a team of some three dozen people, led by elite military personnel — including mathematicians, doctors, analysts and strategic experts from Portugal’s Army, Air Force and Navy.</p><p class="css-axufdj evys1bk0">Asked what other countries can do to bolster their own vaccination efforts, he did not hesitate to offer his best advice.</p><p class="css-axufdj evys1bk0">“They need to find people who are not politicians,” he said.</p><p class="css-axufdj evys1bk0">Before the pandemic, Portugal was fortunate to have <a class="css-1g7m0tk" href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8158178/" title="" rel="noopener noreferrer" target="_blank">a robust national vaccination program</a>. It grew out of the country’s devastating experience battling polio, which was still affecting the country after Admiral Gouveia e Melo was born in 1960. He recalls when the daughter of a family friend fell ill from the disease and the suffering that followed.</p><p class="css-axufdj evys1bk0">Manuela Ivone da Cunha, a Portuguese anthropologist who has studied anti-vaccination movements, said that “vaccine doubters and anti-vaxxers are in the minority in Portugal, and they are also less vocal” than they are in many other countries.</p><p class="css-axufdj evys1bk0">Leonor Beleza, a former Portuguese health minister who is now the president of the Champalimaud medical foundation, said Portugal’s rollout clearly benefited from the discipline stemming from the nomination of a military officer.</p></div></div>
  76. <div class="css-s99gbd StoryBodyCompanionColumn"><div class="css-53u6y8"><p class="css-axufdj evys1bk0">“He formulated a communications policy about what was happening that gave credibility and trust,” she said.</p></div></div>
  77. <div class="css-s99gbd StoryBodyCompanionColumn"><div class="css-53u6y8"><p class="css-axufdj evys1bk0">As the task force devised the most efficient system to safely stream the most people through inoculation centers, they used troops to build confidence in the system. People could see the vaccines were safe as soldier after soldier got shots.</p><div id="NYT_MAIN_CONTENT_3_REGION" class="css-9tf9ac" data-testid="region"><section id="styln-prism-freeform-1627053111063" class="interactive-content interactive-size-scoop css-retkgj"><div class="css-17ih8de interactive-body"><div id="prism-freeform-block-97231" class="css-12vbvwq" role="complementary" data-storyline="Vaccine and Mask Mandates" data-truncated="true" tabindex="0"><div class="css-qjk116"><section class="css-eb027h"><div class="css-19zsuqr"><p class="css-1gtxqqv"><h4 class="css-1kpebx">The State of Vaccine Mandates in the U.S.</h4></p></div><ul><li><ul class="css-1xzcza9"><li class="css-3btd0c"><strong>Vaccine rules</strong>.<strong> </strong>On Aug. 23, the F.D.A. <a href="https://www.nytimes.com/2021/08/23/us/politics/fda-approval-pfizer-vaccine.html">granted full approval to Pfizer-BioNTech’s coronavirus vaccine</a> for people 16 and up, paving the way for mandates in both the <a href="https://www.nytimes.com/2021/09/09/us/politics/federal-employee-vaccine-mandate.html">public</a> and <a href="https://www.nytimes.com/2021/09/29/business/united-airlines-vaccine-mandate.html">private</a> sectors. Such mandates are <a href="https://www.nytimes.com/article/covid-vaccine-mandates.html">legally allowed</a> and have been upheld in court challenges.</li><li class="css-3btd0c"><strong>College and universities.</strong> More than 400 colleges and universities are requiring students to be vaccinated against Covid-19. <a href="https://www.nytimes.com/2021/05/22/us/college-vaccine-universities.html">Almost all are in states that voted for President Biden</a>.</li><li class="css-3btd0c"><strong>Schools. </strong>California became the first state to issue a vaccine mandate <a href="https://www.nytimes.com/2021/08/11/us/california-teachers-vaccine-mandate.html">for all educators</a> and has announced plans to add the Covid-19 vaccine as <a href="https://www.nytimes.com/2021/10/01/us/california-student-vaccine-mandate.html?action=click&amp;pgtype=Article&amp;state=default&amp;module=styln-coronavirus&amp;region=MAIN_CONTENT_3&amp;context=storylines-godeep">a requirement to attend school</a> as early as next fall. <a href="https://www.nytimes.com/2021/09/09/us/la-vaccine-mandate-students-schools.html?action=click&amp;pgtype=Article&amp;state=default&amp;module=styln-coronavirus&amp;region=MAIN_CONTENT_3&amp;context=storylines-godeep">Los Angeles</a> already has a vaccine mandate for public school students 12 and older who are attending class in person starting Nov. 21. New York City has introduced a vaccine mandate for teachers and staff, but it has yet to take effect because of legal challenges. On Sept. 27, a federal appeals panel <a href="https://www.nytimes.com/2021/09/27/nyregion/new-york-city-schools-vaccine-mandate.html?action=click&amp;pgtype=Article&amp;state=default&amp;module=styln-coronavirus&amp;region=MAIN_CONTENT_3&amp;context=storylines-godeep">reversed a decision</a> that temporarily paused that mandate.</li><li class="css-3btd0c"><strong>Hospitals and medical centers</strong>. Many <a href="https://www.nytimes.com/2021/07/21/health/covid-vaccine-hospitals.html">hospitals and major health systems</a> are requiring employees to get vaccinated. Mandates for health care workers in <a href="https://www.nytimes.com/2021/09/30/us/california-vaccine-mandate-health-care.html">California</a> and <a href="https://www.nytimes.com/2021/09/28/nyregion/vaccine-health-care-workers-mandate.html">New York State</a> appear to have compelled thousands of holdouts to receive shots.</li><li class="css-3btd0c"><strong>New York City</strong>. Proof of vaccination is required of workers and customers for <a href="https://www.nytimes.com/2021/08/03/nyregion/nyc-vaccine-mandate.html">indoor dining, gyms, performances</a><a href="https://www.nytimes.com/2021/08/03/nyregion/nyc-vaccine-mandate.html"> and other indoor situations</a>. City <a href="https://www.nytimes.com/live/2021/08/23/world/covid-delta-variant-vaccine/nyc-schools-employee-vaccine-mandate">education staff</a> and <a href="https://www.nytimes.com/2021/07/20/nyregion/mandatory-vaccine-public-hospitals.html">hospital workers</a> must also get a vaccine.</li><li class="css-3btd0c"><strong>At the federal level. </strong>On Sept. 9,<strong> </strong>President Biden announced a vaccine mandate for the <a href="https://www.nytimes.com/2021/09/09/us/politics/federal-employee-vaccine-mandate.html">vast majority of federal workers</a>. This mandate will apply to employees of the <a href="https://www.whitehouse.gov/about-the-white-house/our-government/the-executive-branch/">executive branch</a>, including the White House and all federal agencies and members of the armed services.</li><li class="css-3btd0c"><strong>In t</strong><strong>he private sector.</strong> Mr. Biden has mandated that <a href="https://www.nytimes.com/2021/09/09/us/politics/biden-mandates-vaccines.html">all companies with more than 100 workers</a> require vaccination or weekly testing, helping propel new corporate vaccination policies. Some companies, like <a href="https://www.nytimes.com/2021/09/29/business/united-airlines-vaccine-mandate.html">United Airlines</a> and <a href="https://www.nytimes.com/2021/09/30/business/tyson-foods-vaccination-mandate-rate.html">Tyson Foods</a>, had mandates in place before Mr. Biden’s announcement.</li></ul></li></ul></section><p class="css-6mllg9"></p><button type="button" class="css-16ed7iq" aria-label="expand or collapse modal" id="prism-freeform-button-97231"></button></div></div></div></section></div><p class="css-axufdj evys1bk0">At the same time, the task force made a point of showing doctors and nurses getting their shots, as well, to drive home the message of vaccine safety.</p><p class="css-axufdj evys1bk0">While other countries have featured doctors, nurses, police officers and soldiers in their vaccine campaigns, Admiral Gouveia e Melo said the consistency of the messaging was critical.</p><p class="css-axufdj evys1bk0">Still, as the campaign moved onto younger age groups over the summer — with less than half of the public vaccinated — there were signs that resistance was building.</p><p class="css-axufdj evys1bk0">In a submarine, the admiral said, you are in a slow ship trying to catch faster ships.</p><p class="css-axufdj evys1bk0">“You have to position yourself and be smart about how to do it,” he said, “and seize the opportunity when it arrives.”</p></div></div>
  78. <div class="css-s99gbd StoryBodyCompanionColumn"><div class="css-53u6y8"><p class="css-axufdj evys1bk0">In July, Admiral Gouveia e Melo seized such an opportunity.</p><p class="css-axufdj evys1bk0">Protesters were blocking the entrance to a vaccination center in Lisbon, so he donned his combat uniform and went there with no security detail.</p><p class="css-axufdj evys1bk0">“I went through these crazy people,” he said. “They started to call me ‘murderer, murderer.’”</p><p class="css-axufdj evys1bk0">As the television cameras rolled, the admiral calmly stood his ground.</p><p class="css-axufdj evys1bk0">“I said the murderer is the virus,” Admiral Gouveia e Melo recalled. The true killer, he said, would be people who live like it is the 13th century without any notion of reality.</p><p class="css-axufdj evys1bk0">“I attempted to communicate in a very true and honest way about all doubts and problems,” he said.</p><p class="css-axufdj evys1bk0">But not everybody welcomed his approach.</p><p class="css-axufdj evys1bk0">“We don’t really have a culture of questioning authorities,” said Laura Sanches, a clinical psychologist who has criticized Portugal’s mass vaccination rollout as too militaristic and called for it to exclude younger people.</p><p class="css-axufdj evys1bk0">“And the way he always presented himself in camouflage army suits — as if he was fighting a war — together with the language used by the media and the politicians, has contributed to a feeling of fear that also makes us more prone to obey and not question,” she said.</p><p class="css-axufdj evys1bk0">Still, the public messaging campaign — including an aggressive television and media blitz — made steady progress.</p></div></div>
  79. <div class="css-s99gbd StoryBodyCompanionColumn"><div class="css-53u6y8"><p class="css-axufdj evys1bk0">“In the beginning, we had some 40 percent who were unsure,” Admiral Gouveia e Melo said. Now, according to polls, he said, only 2.2 percent do not want the vaccine.</p><p class="css-axufdj evys1bk0">As he stepped down from the task force this week, the admiral said he felt the country was on a good course. But, ever the submariner, he cautioned that vigilance would remain essential to ensuring that this war was won.</p></div></div>
  80. </article>
  81. <hr>
  82. <footer>
  83. <p>
  84. <a href="/david/" title="Aller à l’accueil"><svg class="icon icon-home">
  85. <use xlink:href="/static/david/icons2/symbol-defs-2021-12.svg#icon-home"></use>
  86. </svg> Accueil</a> •
  87. <a href="/david/log/" title="Accès au flux RSS"><svg class="icon icon-rss2">
  88. <use xlink:href="/static/david/icons2/symbol-defs-2021-12.svg#icon-rss2"></use>
  89. </svg> Suivre</a> •
  90. <a href="http://larlet.com" title="Go to my English profile" data-instant><svg class="icon icon-user-tie">
  91. <use xlink:href="/static/david/icons2/symbol-defs-2021-12.svg#icon-user-tie"></use>
  92. </svg> Pro</a> •
  93. <a href="mailto:david%40larlet.fr" title="Envoyer un courriel"><svg class="icon icon-mail">
  94. <use xlink:href="/static/david/icons2/symbol-defs-2021-12.svg#icon-mail"></use>
  95. </svg> Email</a> •
  96. <abbr class="nowrap" title="Hébergeur : Alwaysdata, 62 rue Tiquetonne 75002 Paris, +33184162340"><svg class="icon icon-hammer2">
  97. <use xlink:href="/static/david/icons2/symbol-defs-2021-12.svg#icon-hammer2"></use>
  98. </svg> Légal</abbr>
  99. </p>
  100. <template id="theme-selector">
  101. <form>
  102. <fieldset>
  103. <legend><svg class="icon icon-brightness-contrast">
  104. <use xlink:href="/static/david/icons2/symbol-defs-2021-12.svg#icon-brightness-contrast"></use>
  105. </svg> Thème</legend>
  106. <label>
  107. <input type="radio" value="auto" name="chosen-color-scheme" checked> Auto
  108. </label>
  109. <label>
  110. <input type="radio" value="dark" name="chosen-color-scheme"> Foncé
  111. </label>
  112. <label>
  113. <input type="radio" value="light" name="chosen-color-scheme"> Clair
  114. </label>
  115. </fieldset>
  116. </form>
  117. </template>
  118. </footer>
  119. <script src="/static/david/js/instantpage-5.1.0.min.js" type="module"></script>
  120. <script>
  121. function loadThemeForm(templateName) {
  122. const themeSelectorTemplate = document.querySelector(templateName)
  123. const form = themeSelectorTemplate.content.firstElementChild
  124. themeSelectorTemplate.replaceWith(form)
  125. form.addEventListener('change', (e) => {
  126. const chosenColorScheme = e.target.value
  127. localStorage.setItem('theme', chosenColorScheme)
  128. toggleTheme(chosenColorScheme)
  129. })
  130. const selectedTheme = localStorage.getItem('theme')
  131. if (selectedTheme && selectedTheme !== 'undefined') {
  132. form.querySelector(`[value="${selectedTheme}"]`).checked = true
  133. }
  134. }
  135. const prefersColorSchemeDark = '(prefers-color-scheme: dark)'
  136. window.addEventListener('load', () => {
  137. let hasDarkRules = false
  138. for (const styleSheet of Array.from(document.styleSheets)) {
  139. let mediaRules = []
  140. for (const cssRule of styleSheet.cssRules) {
  141. if (cssRule.type !== CSSRule.MEDIA_RULE) {
  142. continue
  143. }
  144. // WARNING: Safari does not have/supports `conditionText`.
  145. if (cssRule.conditionText) {
  146. if (cssRule.conditionText !== prefersColorSchemeDark) {
  147. continue
  148. }
  149. } else {
  150. if (cssRule.cssText.startsWith(prefersColorSchemeDark)) {
  151. continue
  152. }
  153. }
  154. mediaRules = mediaRules.concat(Array.from(cssRule.cssRules))
  155. }
  156. // WARNING: do not try to insert a Rule to a styleSheet you are
  157. // currently iterating on, otherwise the browser will be stuck
  158. // in a infinite loop…
  159. for (const mediaRule of mediaRules) {
  160. styleSheet.insertRule(mediaRule.cssText)
  161. hasDarkRules = true
  162. }
  163. }
  164. if (hasDarkRules) {
  165. loadThemeForm('#theme-selector')
  166. }
  167. })
  168. </script>
  169. </body>
  170. </html>