<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Map Theme Toggle with React in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-theme-toggle-with-react/m-p/1482146#M84761</link>
    <description>&lt;P&gt;Thanks I'll give that a shot.&lt;/P&gt;</description>
    <pubDate>Fri, 31 May 2024 16:35:44 GMT</pubDate>
    <dc:creator>jjgarrett0</dc:creator>
    <dc:date>2024-05-31T16:35:44Z</dc:date>
    <item>
      <title>Map Theme Toggle with React</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-theme-toggle-with-react/m-p/1481044#M84748</link>
      <description>&lt;P&gt;I'm looking for some help with dynamically setting the map theme for dark and light modes in a React application. The documentation says to import the css file for whichever theme you want, but I would like to be able to toggle a button in the react application to switch it between light and dark. Does anyone have some suggestions?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2024 13:09:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-theme-toggle-with-react/m-p/1481044#M84748</guid>
      <dc:creator>jjgarrett0</dc:creator>
      <dc:date>2024-05-30T13:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: Map Theme Toggle with React</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-theme-toggle-with-react/m-p/1481250#M84750</link>
      <description>&lt;P&gt;There is a calcite tutorial on how to do this you can apply to a react application.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/calcite-design-system/tutorials/build-a-dark-mode-switch/" target="_blank"&gt;https://developers.arcgis.com/calcite-design-system/tutorials/build-a-dark-mode-switch/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The main thing to know is this part of the tutorial.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;        const updateDarkMode = () =&amp;gt; {
          // Calcite mode
          document.body.classList.toggle("calcite-mode-dark");
          // ArcGIS Maps SDK theme
          const dark = document.querySelector("#arcgis-maps-sdk-theme-dark");
          const light = document.querySelector("#arcgis-maps-sdk-theme-light");
          dark.disabled = !dark.disabled;
          light.disabled = !light.disabled;
          // ArcGIS Maps SDK basemap
          map.basemap = dark.disabled ? "gray-vector" : "dark-gray-vector";
          // Toggle ArcGIS Maps SDK widgets mode
          const widgets = document.getElementsByClassName("esri-ui");
          for (let i = 0; i &amp;lt; widgets.length; i++) {
            widgets.item(i).classList.toggle("calcite-mode-dark");
          }
        };

        document.querySelector("calcite-switch").addEventListener("calciteSwitchChange", updateDarkMode);&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 30 May 2024 15:50:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-theme-toggle-with-react/m-p/1481250#M84750</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2024-05-30T15:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: Map Theme Toggle with React</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-theme-toggle-with-react/m-p/1482146#M84761</link>
      <description>&lt;P&gt;Thanks I'll give that a shot.&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2024 16:35:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/map-theme-toggle-with-react/m-p/1482146#M84761</guid>
      <dc:creator>jjgarrett0</dc:creator>
      <dc:date>2024-05-31T16:35:44Z</dc:date>
    </item>
  </channel>
</rss>

