function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
rushirushi 

Lightning button to display color dynamically in LWC

Hello,
I am trying to create a LWC component to be used in lighting app page and community page.
Page contains lighting button with brand variant and display color dynamically if community    Red
large flexi page.   Green
medium.    Yellow 
small.   Blue
 

I updated xml file targets to lighting app page and community page.
created html file to use flexipageregionwidth and based on the region size display related colors using CSS file. 

I am able to apply button border colors but unable to fill the button.
please anyone could answer this why fill is not working for lighting button.
Thanks in advance!

AbhishekAbhishek (Salesforce Developers) 
https://salesforce.stackexchange.com/questions/253161/changing-colors-of-lightning-button

Your query is answered above.

If need further reference you can check below,
https://medium.com/@prashant90.pandey/add-and-remove-styling-upon-button-click-in-lightning-web-component-daa72790ce5b


If it helps mark it as the best answer.
AnudeepAnudeep (Salesforce Developers) 
Also, recommend reviewing this post