<?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: Overwriting theme colors in Calcite Design System Questions</title>
    <link>https://community.esri.com/t5/calcite-design-system-questions/overwriting-theme-colors/m-p/1064383#M15</link>
    <description>&lt;P&gt;Hi Anthony! I'm not sure what your code looks like exactly, but here's an option to override that CSS property from a container node:&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&amp;lt;div style="--calcite-ui-text-1: #FCF;"&amp;gt;&lt;BR /&gt;  &amp;lt;calcite-accordion&amp;gt;&lt;BR /&gt;    &amp;lt;calcite-accordion-item item-title="Accordion Item"&amp;gt;Accordion Section Content &amp;lt;/calcite-accordion-item&amp;gt;&lt;BR /&gt;    &amp;lt;calcite-accordion-item item-title="Accordion Item 2" active&amp;gt;Accordion Section Content &amp;lt;/calcite-accordion-item&amp;gt;&lt;BR /&gt;    &amp;lt;calcite-accordion-item item-title="Accordion Item 3"&amp;gt;Accordion Section Content &amp;lt;/calcite-accordion-item&amp;gt;&lt;BR /&gt;  &amp;lt;/calcite-accordion&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;It follows the same approach we have in our Storybook docs here, which shows how you can override theme colors:&lt;BR /&gt;&lt;A href="https://esri.github.io/calcite-components/?path=/story/theming-custom-theme--interactive" target="_blank"&gt;https://esri.github.io/calcite-components/?path=/story/theming-custom-theme--interactive&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you want to programmatically update the font color, you can query the target nodes'&amp;nbsp;&lt;A href="https://developer.mozilla.org/en-US/docs/Web/API/Element/shadowRoot" target="_blank"&gt;shadow roots&lt;/A&gt;, in order to style the CSS custom property for that class only:&lt;/P&gt;&lt;PRE&gt;document.querySelectorAll("calcite-accordion-item").forEach(node =&amp;gt; node.shadowRoot.querySelector(".accordion-item-title").style.setProperty("--calcite-ui-text-1", "#FCF"));&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 02 Jun 2021 22:18:16 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-06-02T22:18:16Z</dc:date>
    <item>
      <title>Overwriting theme colors</title>
      <link>https://community.esri.com/t5/calcite-design-system-questions/overwriting-theme-colors/m-p/1064338#M14</link>
      <description>&lt;P&gt;I'm using the ESRI Design System Components in an ArcGIS for Javascript 4.19 application. I'm returning an entirely Calcite Components UI for a custom widget. I can't seem to set custom&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;style="color:#FCF"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;attributes on the Calcite Components in the widget code itself, and because they are rendered in a shadow DOM, I also can't programmatically access these nodes to modify them later. Is there a recommended way to override '&lt;SPAN&gt;--calcite-ui-text-1' with a custom brand color, for example?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ideally I would like to apply this override to Accordion headers (.accordion-item-title) only, leaving child button labels and all other Calcite text as they are by default.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jun 2021 20:26:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/calcite-design-system-questions/overwriting-theme-colors/m-p/1064338#M14</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-06-02T20:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: Overwriting theme colors</title>
      <link>https://community.esri.com/t5/calcite-design-system-questions/overwriting-theme-colors/m-p/1064383#M15</link>
      <description>&lt;P&gt;Hi Anthony! I'm not sure what your code looks like exactly, but here's an option to override that CSS property from a container node:&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&amp;lt;div style="--calcite-ui-text-1: #FCF;"&amp;gt;&lt;BR /&gt;  &amp;lt;calcite-accordion&amp;gt;&lt;BR /&gt;    &amp;lt;calcite-accordion-item item-title="Accordion Item"&amp;gt;Accordion Section Content &amp;lt;/calcite-accordion-item&amp;gt;&lt;BR /&gt;    &amp;lt;calcite-accordion-item item-title="Accordion Item 2" active&amp;gt;Accordion Section Content &amp;lt;/calcite-accordion-item&amp;gt;&lt;BR /&gt;    &amp;lt;calcite-accordion-item item-title="Accordion Item 3"&amp;gt;Accordion Section Content &amp;lt;/calcite-accordion-item&amp;gt;&lt;BR /&gt;  &amp;lt;/calcite-accordion&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;It follows the same approach we have in our Storybook docs here, which shows how you can override theme colors:&lt;BR /&gt;&lt;A href="https://esri.github.io/calcite-components/?path=/story/theming-custom-theme--interactive" target="_blank"&gt;https://esri.github.io/calcite-components/?path=/story/theming-custom-theme--interactive&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you want to programmatically update the font color, you can query the target nodes'&amp;nbsp;&lt;A href="https://developer.mozilla.org/en-US/docs/Web/API/Element/shadowRoot" target="_blank"&gt;shadow roots&lt;/A&gt;, in order to style the CSS custom property for that class only:&lt;/P&gt;&lt;PRE&gt;document.querySelectorAll("calcite-accordion-item").forEach(node =&amp;gt; node.shadowRoot.querySelector(".accordion-item-title").style.setProperty("--calcite-ui-text-1", "#FCF"));&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 02 Jun 2021 22:18:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/calcite-design-system-questions/overwriting-theme-colors/m-p/1064383#M15</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-06-02T22:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: Overwriting theme colors</title>
      <link>https://community.esri.com/t5/calcite-design-system-questions/overwriting-theme-colors/m-p/1064388#M16</link>
      <description>&lt;P&gt;Thank you so much! After quick tests both methods look great places to start. Much appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jun 2021 22:24:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/calcite-design-system-questions/overwriting-theme-colors/m-p/1064388#M16</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-06-02T22:24:24Z</dc:date>
    </item>
  </channel>
</rss>

