<?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: 4.34 Shadow DOM - How can i override Popup styles? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-34-shadow-dom-how-can-i-override-popup-styles/m-p/1682405#M88116</link>
    <description>&lt;P&gt;Here is how I got past the shadow root and change the font-family and other things.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Wait until the component and its view are ready
await mapElement.componentOnReady();

// 3Access the shadow root of the component
const shadowRootPop = mapElement.shadowRoot;

// Create a style element
const stylePop = document.createElement("style");
stylePop.textContent = `
  /* Popup header text */

  .esri-popup__main-container.esri-widget{
    font-family: 'Courier New', Courier, monospace !important;
  }
  
  .esri-ui .esri-popup .esri-widget__heading {
    font-weight: 300 !important;
    font-size: 12.5px !important;
    line-height: 1.3 !important;
  }

  .esri-popup__main-container{
  width: 340px !important;}

  /* Optional: move the popup up from bottom if needed */
  .esri-popup__main-container.esri-widget {
    bottom: 80px !important;
  }
`;

// Append the style into the component shadow root
shadowRootPop.appendChild(stylePop);&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 05 Feb 2026 15:58:52 GMT</pubDate>
    <dc:creator>MatthewDriscoll</dc:creator>
    <dc:date>2026-02-05T15:58:52Z</dc:date>
    <item>
      <title>4.34 Shadow DOM - How can i override Popup styles?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-34-shadow-dom-how-can-i-override-popup-styles/m-p/1660421#M87769</link>
      <description>&lt;P&gt;In 4.33 and earlier version of the ArcGIS API it was straight forward to interact with the widgets and components that the API was creating.&lt;/P&gt;&lt;P&gt;In many ways it was a bit of a super power of the API that you could either 1) use the Esri styled widgets, 2) use the styled widgets with some minor style customisation, 3) implement your own using the underlying viewmodel.&lt;/P&gt;&lt;P&gt;With the latest changes to the map components parts are being moved into the ShadowDOM via slots, but now it seems to have become impossible to style parts of the user interface without complex Javascript injection of styling, or extremely simple and constrained changes to colours with css variables.&lt;/P&gt;&lt;P&gt;in 4.33 I overrode the popup styling based on the theme of our application. It uses a mixture of css-variables and additional styling to add border radius e.g. targeting&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;esri-popup__main-container, or&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;esri-popup__pointer-direction.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JonathanDawe_BAS_0-1761303765335.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/142533iC0C5F450889B1C9C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JonathanDawe_BAS_0-1761303765335.png" alt="JonathanDawe_BAS_0-1761303765335.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;How would I achieve something similar in the newer versions of the API? Am I going to have to start reimplementing every Esri component if I want containers to have curved borders?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2025 11:08:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-34-shadow-dom-how-can-i-override-popup-styles/m-p/1660421#M87769</guid>
      <dc:creator>JonathanDawe_BAS</dc:creator>
      <dc:date>2025-10-24T11:08:33Z</dc:date>
    </item>
    <item>
      <title>Re: 4.34 Shadow DOM - How can i override Popup styles?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-34-shadow-dom-how-can-i-override-popup-styles/m-p/1660471#M87776</link>
      <description>&lt;P&gt;Currently in 4.34, only way to do this will be via JS style updates via shadowRoot selectors.&lt;/P&gt;&lt;P&gt;As we are working on the Popup component, and components in general, we are evaluating what type of design tokens we should expose in addition to the calcite tokens. These are items we can add to the list, thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2025 13:37:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-34-shadow-dom-how-can-i-override-popup-styles/m-p/1660471#M87776</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2025-10-24T13:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: 4.34 Shadow DOM - How can i override Popup styles?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-34-shadow-dom-how-can-i-override-popup-styles/m-p/1660479#M87778</link>
      <description>&lt;P&gt;Thanks Rene, In the meantime I managed to hack my styles back in...&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;   const mapElement = document.querySelector('arcgis-map');
    const adoptedStyleSheets = mapElement?.shadowRoot?.adoptedStyleSheets;
    const firstStyleSheet = adoptedStyleSheets?.[0];
    if (firstStyleSheet) {
      // Insert each rule individually
      firstStyleSheet.insertRule(`
        .esri-component {
          box-shadow: none !important;
        }
      `);

      firstStyleSheet.insertRule(`
        .esri-attribution.esri-widget {
          height: 20px !important;
          color: var(--attribution-color) !important;
          background-color: var(--attribution-background-color) !important;
        }
      `);
      firstStyleSheet.insertRule(`
        .esri-popup__main-container.esri-widget {
          border-color: var(--popup-main-container-border-color) !important;
          border-radius: var(--popup-main-container-border-radius) !important;
          border-width: var(--popup-main-container-border-width) !important;
          shadow: var(--popup-main-container-shadow) !important;
          overflow: hidden !important;
          border-style: var(--popup-main-container-border-style) !important;
        }
      `);

      firstStyleSheet.insertRule(`
        .esri-popup__pointer-direction {
          border-color: var(--popup-pointer-direction-border-color) !important;
          border-width: var(--popup-pointer-direction-border-width) !important;
          background-color: var(--popup-pointer-direction-background-color) !important;
          border-style: var(--popup-pointer-direction-border-style) !important;
        }
      `);&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 24 Oct 2025 14:01:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-34-shadow-dom-how-can-i-override-popup-styles/m-p/1660479#M87778</guid>
      <dc:creator>JonathanDawe_BAS</dc:creator>
      <dc:date>2025-10-24T14:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: 4.34 Shadow DOM - How can i override Popup styles?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-34-shadow-dom-how-can-i-override-popup-styles/m-p/1665857#M87867</link>
      <description>&lt;P&gt;This looks brilliant but I can't seem to make it work. Do you update the stylesheet before the arcgisViewReadyChange or after? After the popup view is ready? Could you look at my &lt;A href="https://codepen.io/valcannon/pen/OPMeZKj" target="_self"&gt;pen&lt;/A&gt; and see what I'm doing wrong.&lt;/P&gt;&lt;P&gt;--update: I figured it out. After the arcgisViewReadyChange. Thanks a bunch. &lt;A href="https://codepen.io/valcannon/pen/azNNQxR" target="_self"&gt;pen2&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Nov 2025 18:03:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-34-shadow-dom-how-can-i-override-popup-styles/m-p/1665857#M87867</guid>
      <dc:creator>ValCannon2</dc:creator>
      <dc:date>2025-11-14T18:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: 4.34 Shadow DOM - How can i override Popup styles?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-34-shadow-dom-how-can-i-override-popup-styles/m-p/1668466#M87911</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/7384"&gt;@ReneRubalcava&lt;/a&gt;&amp;nbsp;for the explanation. According to an earlier &lt;A href="https://www.esri.com/arcgis-blog/products/js-api-arcgis/developers/javascript-maps-sdk-a-full-transition-to-components" target="_self"&gt;ESRI Blog&lt;/A&gt;, it says&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Internally, components are constructed using&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/calcite-design-system/components/" target="_blank" rel="noopener"&gt;Calcite Design System’s&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;components, so they can be styled using Calcite’s&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/calcite-design-system/foundations/tokens/usage/" target="_blank" rel="noopener"&gt;design tokens&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;(via CSS)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I thought I could make all calcite-buttons in all web components like arcgis-home rounded by o&lt;SPAN&gt;verriding al calcite-button like below. However, it doesn't seem work.&amp;nbsp; I wonder if I understood it correctly or there's something wrong in my implementation.&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    &amp;lt;script src="https://js.arcgis.com/4.34/"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script type="module" src="https://js.arcgis.com/4.34/map-components/"&amp;gt;&amp;lt;/script&amp;gt;

    &amp;lt;style&amp;gt;
      html,body { margin: 0;height: 100%;} 
      calcite-button {--calcite-button-corner-radius: 50px;}
    &amp;lt;/style&amp;gt;
  &amp;lt;/head&amp;gt;

  &amp;lt;body&amp;gt;
    &amp;lt;arcgis-map item-id="f2e9b762544945f390ca4ac3671cfa72"&amp;gt;
      &amp;lt;arcgis-home slot="top-left"&amp;gt;&amp;lt;/arcgis-home&amp;gt;
    &amp;lt;/arcgis-map&amp;gt;
  &amp;lt;/body&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Nov 2025 15:25:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-34-shadow-dom-how-can-i-override-popup-styles/m-p/1668466#M87911</guid>
      <dc:creator>JackFanZhang</dc:creator>
      <dc:date>2025-11-25T15:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: 4.34 Shadow DOM - How can i override Popup styles?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-34-shadow-dom-how-can-i-override-popup-styles/m-p/1682405#M88116</link>
      <description>&lt;P&gt;Here is how I got past the shadow root and change the font-family and other things.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Wait until the component and its view are ready
await mapElement.componentOnReady();

// 3Access the shadow root of the component
const shadowRootPop = mapElement.shadowRoot;

// Create a style element
const stylePop = document.createElement("style");
stylePop.textContent = `
  /* Popup header text */

  .esri-popup__main-container.esri-widget{
    font-family: 'Courier New', Courier, monospace !important;
  }
  
  .esri-ui .esri-popup .esri-widget__heading {
    font-weight: 300 !important;
    font-size: 12.5px !important;
    line-height: 1.3 !important;
  }

  .esri-popup__main-container{
  width: 340px !important;}

  /* Optional: move the popup up from bottom if needed */
  .esri-popup__main-container.esri-widget {
    bottom: 80px !important;
  }
`;

// Append the style into the component shadow root
shadowRootPop.appendChild(stylePop);&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 05 Feb 2026 15:58:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-34-shadow-dom-how-can-i-override-popup-styles/m-p/1682405#M88116</guid>
      <dc:creator>MatthewDriscoll</dc:creator>
      <dc:date>2026-02-05T15:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: 4.34 Shadow DOM - How can i override Popup styles?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-34-shadow-dom-how-can-i-override-popup-styles/m-p/1682414#M88117</link>
      <description>&lt;P&gt;Clever, but this still feels like a workaround that might not work in the next update (5x, any minute now?). Hopefully there will be access to style attributes in the arcgis-popup component soon.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Feb 2026 15:57:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-34-shadow-dom-how-can-i-override-popup-styles/m-p/1682414#M88117</guid>
      <dc:creator>ValCannon2</dc:creator>
      <dc:date>2026-02-05T15:57:55Z</dc:date>
    </item>
  </channel>
</rss>

