<?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 Custom Widget That Implements /esri/themes/ in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-widget-that-implements-esri-themes/m-p/1131642#M75842</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to create a widget boiler plate so I can refactor some existing code into widget modules. So far things are working, however, all the examples I have seen require the user to pick the CSS esri theme, i.e. light or dark. I would like to implement not only my own custom light and dark elements, but also utilize the available esri themes. Is there an example out there? So far I have a cringy way of determining the user's preferred stylesheet in their HTML:&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var temptheme = "light";
for (let i=0; i&amp;lt;document.styleSheets.length; i++) {
  let ss = document.styleSheets[i].href;
  console.log(`Stylesheet ${i+1} of ${document.styleSheets.length}: ${ss}`);
  if (ss &amp;amp;&amp;amp; ss.split('/assets/esri/themes/').length == 2) {
    temptheme = ss.split('/assets/esri/themes/')[1].split('/')[0];
  }
}
const theme = temptheme.toLowerCase();
console.log(`Theme: ${theme}`);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;René&lt;/P&gt;</description>
    <pubDate>Fri, 07 Jan 2022 16:59:36 GMT</pubDate>
    <dc:creator>René_Ténière</dc:creator>
    <dc:date>2022-01-07T16:59:36Z</dc:date>
    <item>
      <title>Custom Widget That Implements /esri/themes/</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-widget-that-implements-esri-themes/m-p/1131642#M75842</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to create a widget boiler plate so I can refactor some existing code into widget modules. So far things are working, however, all the examples I have seen require the user to pick the CSS esri theme, i.e. light or dark. I would like to implement not only my own custom light and dark elements, but also utilize the available esri themes. Is there an example out there? So far I have a cringy way of determining the user's preferred stylesheet in their HTML:&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var temptheme = "light";
for (let i=0; i&amp;lt;document.styleSheets.length; i++) {
  let ss = document.styleSheets[i].href;
  console.log(`Stylesheet ${i+1} of ${document.styleSheets.length}: ${ss}`);
  if (ss &amp;amp;&amp;amp; ss.split('/assets/esri/themes/').length == 2) {
    temptheme = ss.split('/assets/esri/themes/')[1].split('/')[0];
  }
}
const theme = temptheme.toLowerCase();
console.log(`Theme: ${theme}`);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;René&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jan 2022 16:59:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/custom-widget-that-implements-esri-themes/m-p/1131642#M75842</guid>
      <dc:creator>René_Ténière</dc:creator>
      <dc:date>2022-01-07T16:59:36Z</dc:date>
    </item>
  </channel>
</rss>

