+ Start a Discussion

Lightning button to display color dynamically in LWC

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) 

Your query is answered above.

If need further reference you can check below,

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