huacnlee / social-share-button

Helper for add social share feature in your Rails app. Twitter, Facebook, Weibo, Douban ...
MIT License
582 stars 311 forks source link

Adding a custom class to social_share_button_tag #139

Open Kosai106 opened 7 years ago

Kosai106 commented 7 years ago

I might be an idiot, but I'm not seeing a way to add a custom class to the tag.

I've tried the following but with no result.

<%= social_share_button_tag(@post.title, url: post_link(@post), desc: @post.description, image: post_image(@post), class: 'custom_class') %>

Am I doing something wrong or is this simply not a possibility at this time?

hoqqun commented 6 years ago

social_share_button_tag dosen't have the class option. So, we need to change the class that have already been applied like below.

$size: 24px;

.social-share-button { .ssb-icon { background-size: $size $size; height: $size; width: $size; } }

Kosai106 commented 6 years ago

@hoqqun This is almost a year old, I don't even exactly remember what the issue was - But it was not possible to solve by editing the existing class - A new class was required for what I wanted to achieve.

probinson2015 commented 5 years ago

social_share_button_tag dosen't have the class option. So, we need to change the class that have already been applied like below.

$size: 24px;

.social-share-button { .ssb-icon { background-size: $size $size; height: $size; width: $size; } }

@hoqqun I don't see class .ssb-icon in the dev tools element inspector. Is your comment still accurate? Am I missing something?