<?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 Styling / CSS for Calcite Button in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/styling-css-for-calcite-button/m-p/1293891#M81270</link>
    <description>&lt;P&gt;I have incorporated a Calcite button that opens a Calcite modal with some general information about the app.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The interaction with the calcite button is different than the regular ESRI JavaScript widgets.&amp;nbsp; I am using the light stylesheet.&amp;nbsp; When the user hovers over one of the ESRI widgets (Home, Zoom in/Out/Expand), the button background changes from white to light grey.&amp;nbsp; For the Calcite button, it changes the color of the outline slightly but not the background.&amp;nbsp; I would like the Calcite button to match the background color/styling of the ESRI widgets when the user hovers over.&lt;/P&gt;&lt;P&gt;In addition, the Calcite button has a blue outline when the user clicks it and remains until something else in the UI is clicked.&amp;nbsp; I would prefer not to have this blue outline.&lt;/P&gt;&lt;P&gt;How do I access these properties via CSS if possible?&amp;nbsp; The &lt;A href="https://developers.arcgis.com/calcite-design-system/components/button/#api-reference-properties-appearance" target="_self"&gt;Calcite Button documentation page&lt;/A&gt;&amp;nbsp;has limited options.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#infoIcon {
        display: block;
	      position: absolute;		   
	      top: 200px;
              left: 15px;        
      }
/* css below works if I want to change background color of .esri-widget buttons */ 

 .esri-widget--button:hover {
    background-color: #992727;
    color: #2e2e2e
}
/*This does nothing to change calcite-button behavior*/
calcite-button {
      background-color: #773838;
    }

/*html for calcite button*/
&amp;lt;div id="infoIcon"&amp;gt;
        &amp;lt;calcite-button id="example-button" icon-start="information" scale= "m" appearance="outline-fill" kind="neutral"&amp;gt;&amp;lt;/calcite-button&amp;gt;        
      &amp;lt;/div&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 29 May 2023 17:40:17 GMT</pubDate>
    <dc:creator>Leonidas</dc:creator>
    <dc:date>2023-05-29T17:40:17Z</dc:date>
    <item>
      <title>Styling / CSS for Calcite Button</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/styling-css-for-calcite-button/m-p/1293891#M81270</link>
      <description>&lt;P&gt;I have incorporated a Calcite button that opens a Calcite modal with some general information about the app.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The interaction with the calcite button is different than the regular ESRI JavaScript widgets.&amp;nbsp; I am using the light stylesheet.&amp;nbsp; When the user hovers over one of the ESRI widgets (Home, Zoom in/Out/Expand), the button background changes from white to light grey.&amp;nbsp; For the Calcite button, it changes the color of the outline slightly but not the background.&amp;nbsp; I would like the Calcite button to match the background color/styling of the ESRI widgets when the user hovers over.&lt;/P&gt;&lt;P&gt;In addition, the Calcite button has a blue outline when the user clicks it and remains until something else in the UI is clicked.&amp;nbsp; I would prefer not to have this blue outline.&lt;/P&gt;&lt;P&gt;How do I access these properties via CSS if possible?&amp;nbsp; The &lt;A href="https://developers.arcgis.com/calcite-design-system/components/button/#api-reference-properties-appearance" target="_self"&gt;Calcite Button documentation page&lt;/A&gt;&amp;nbsp;has limited options.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#infoIcon {
        display: block;
	      position: absolute;		   
	      top: 200px;
              left: 15px;        
      }
/* css below works if I want to change background color of .esri-widget buttons */ 

 .esri-widget--button:hover {
    background-color: #992727;
    color: #2e2e2e
}
/*This does nothing to change calcite-button behavior*/
calcite-button {
      background-color: #773838;
    }

/*html for calcite button*/
&amp;lt;div id="infoIcon"&amp;gt;
        &amp;lt;calcite-button id="example-button" icon-start="information" scale= "m" appearance="outline-fill" kind="neutral"&amp;gt;&amp;lt;/calcite-button&amp;gt;        
      &amp;lt;/div&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 May 2023 17:40:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/styling-css-for-calcite-button/m-p/1293891#M81270</guid>
      <dc:creator>Leonidas</dc:creator>
      <dc:date>2023-05-29T17:40:17Z</dc:date>
    </item>
    <item>
      <title>Re: Styling / CSS for Calcite Button</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/styling-css-for-calcite-button/m-p/1294083#M81277</link>
      <description>&lt;P&gt;Please take a look at this document on calcite component theming and colors:&amp;nbsp;&lt;A href="https://developers.arcgis.com/calcite-design-system/foundations/colors/" target="_blank"&gt;https://developers.arcgis.com/calcite-design-system/foundations/colors/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This SDK sample shows some of the techniques shown in the document:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=featurelayer-query" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=featurelayer-query&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 15:02:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/styling-css-for-calcite-button/m-p/1294083#M81277</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2023-05-30T15:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: Styling / CSS for Calcite Button</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/styling-css-for-calcite-button/m-p/1295409#M81295</link>
      <description>&lt;P&gt;Thanks for this.&amp;nbsp; The example helped to get me on the right track to figure out how to use the calcite css variables.&amp;nbsp; I was able to inspect the code in Chrome and figure out what was going on.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ended up finding out how to use the :hover css selector which let me switch the color of the icon:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;#infoIcon:hover&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;--calcite-ui-foreground-1&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;#f3f3f3&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;In the end, I stumbled across an example of creating an esri widget button class which worked better and already had similar styling to the other esri widgets out of the box.&amp;nbsp; Hopefully this helps someone else so I'll post some of my code below.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;//CSS for placement location 
#infoSWPapp {
        display: block;
	    position: absolute;		   
	    top: 170px;
        left: 15px;
      }
//Add the button div to the UI in script section/file
view.ui.add(["infoSWPapp"], "manual");

//set esri class for the div and use icon from esri icons in body section
&amp;lt;div id="infoSWPapp" class="esri-component esri-widget--button esri-widget" role="button"&amp;gt;
        &amp;lt;span id="infoIconImage" class="esri-icon esri-icon-description"&amp;gt;&amp;lt;/span&amp;gt;
&amp;lt;/div&amp;gt;
//JS code to open modal window when button is clicked
&amp;lt;script&amp;gt;         
         const modal = document.getElementById("example-modal");
         const infoButton = document.getElementById("infoSWPapp");
        
         infoButton.addEventListener("click", function() {
        modal.open = true; 
    });        
           &amp;lt;/script&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2023 15:49:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/styling-css-for-calcite-button/m-p/1295409#M81295</guid>
      <dc:creator>Leonidas</dc:creator>
      <dc:date>2023-06-02T15:49:20Z</dc:date>
    </item>
  </channel>
</rss>

