nygardk / react-share

Social media share buttons and share counts for React
MIT License
2.6k stars 433 forks source link

How to change Icon backgrou color #430

Closed Kolajosh closed 1 year ago

Kolajosh commented 2 years ago

tried using bgstyle to change color, It doesn't work. Suggestions??

tagucch commented 2 years ago

Please try bgStyle={{ fill: 'red' }}.

example: <TwitterIcon size={50} bgStyle={{ fill: 'red' }} />

スクリーンショット 2022-01-29 0 58 46

bgStyle can received CSS properties that can used with SVG. These articles summarize the details. Fills and Strokes - SVG: Scalable Vector Graphics | MDN SVG Properties and CSS | CSS-Tricks - CSS-Tricks

example: <TwitterIcon size={50} bgStyle={{ fill: 'red', stroke: 'yellow', strokeWidth: '10' }} />

スクリーンショット 2022-01-29 1 04 05

By the way, this is what happens when you use iconFillColor.

example: <TwitterIcon size={50} bgStyle={{ fill: 'red', stroke: 'yellow', strokeWidth: '10' }} iconFillColor='black' />

スクリーンショット 2022-01-29 1 05 52
damsalem commented 2 years ago

Thanks for the write-up @tagucch any chance we can get that added to the official docs @nygardk ??