Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Based on font-awesome, social_colors_rails provide official colors of social brand icons. See them on the Social colors rails official page.
Add these line to your application's Gemfile:
gem 'font-awesome-rails'
gem 'social_colors_rails'
And then execute bundle install
For simple use, add it to your rails asset-pipeline
/*
*= require font-awesome
*= require social_colors_rails
* Or for production
*= require social_colors_rails.min
*/
in your application.css
file
Or if you work with SASS
@import "font-awesome";
@import "social_colors_rails";
You can customize the social_colors_rails plugin by importing the sass file and overwrite variables.
// Import your custom variables before the social_colors lib
@import "_custom_variables";
@import "font-awesome";
@import "social_colors_rails/init";
The prefered method is to use the social_tag
helper
social_tag
# => <a class="icon-stack stack-circle facebook" target="_blank" rel="external nofollow" href="#">
# <i class="fa fa-facebook"></i>
# </a>
social_tag url: "https://www.facebook.com/devsbrain/"
# => <a class="icon-stack stack-square facebook" target="_blank" rel="external nofollow" href="https://www.facebook.com/devsbrain/">
# <i class="fa fa-facebook"></i>
# </a>
social_tag "github", "https://github.com/TimVille"
# => <a class="icon-stack stack-circle github" target="_blank" rel="external nofollow" href="https://github.com/TimVille">
# <i class="fa fa-github"></i>
# </a>
social_tag "github", "https://github.com/TimVille", style: "square"
# => <a class="icon-stack stack-square github" target="_blank" rel="external nofollow" href="https://github.com/TimVille">
# <i class="fa fa-github"></i>
# </a>
social_tag "github", "https://github.com/TimVille", size: "2x"
# => <a class="icon-stack stack-circle github stack-2x" target="_blank" rel="external nofollow" href="https://github.com/TimVille">
# <i class="fa fa-github"></i>
# </a>
social_tag "github", "https://github.com/TimVille", title: "My awesome link title"
# => <a class="icon-stack stack-circle github" target="_blank" rel="external nofollow" title="My awesome link title" href="https://github.com/TimVille">
# <i class="fa fa-github"></i>
# </a>
social_tag "github", "https://github.com/TimVille", nofollow: false
# => <a class="icon-stack stack-circle github" target="_blank" rel="external" href="https://github.com/TimVille">
# <i class="fa fa-github"></i>
# </a>
social_tag "github", "https://github.com/TimVille", external: false
# => <a class="icon-stack stack-circle github" target="_blank" href="https://github.com/TimVille">
# <i class="fa fa-github"></i>
# </a>
But if you prefer, you can just wrap your font-awesome icon with these classes
<div class="icon-stack |brand-name|"></div>
New button are available with text possibilities. To add it with a rails helper, just use a link_to
link_to "Your text", "#", class: "btn btn-social btn-|size| |brand-name|"
<!-- Plain button -->
<a href="#" class="btn btn-social |brand-name| btn-|size|">
Your text here <i class="fa fa-|brand-name|"></i>
</a>
<!-- Outline button -->
<a href="#" class="btn btn-social-outline |brand-name| btn-|size|">
Your text here <i class="fa fa-|brand-name|"></i>
</a>
Options are available for stack style and stack size.
Add them next to icon-stack
class to apply them!
stack-circle
stack-square
stack-square-o
(stack||btn)-2x
(stack||btn)-3x
(stack||btn)-4x
//
// Stack parameters
//
$stack-lighten-amount: 10%;
$stack-darken-amount: 10%;
$stack-alpha-amount: 0;
$stack-hover-color: #424242;
$stack-hover-color-inverse: #424242;
$stack-shadow-color: transparentize(#000, 0.8);
$stack-shadow-length: 6;
$stack-shadow-blur: 4px;
$border-width: 3px;
$border-width-2x: 4px;
$border-width-3x: 5px;
$border-width-4x: 6px;
$stack-square-radius: 20%;
$btn-outline-radius: 8px;
$stack-4x: 3em;
$stack-3x: 2.5em;
$stack-2x: 2em;
$stack-anim-duration: .3s;
$stack-anim-ease: ease;
//
// Font-awesome icon shadow parameters
//
$icon-shadow-blur: 1px;
$icon-shadow-lighten-amount: 20%;
$icon-shadow-darken-amount: 30%;
$icon-shadow-alpha-amount: 0.7;
$icon-shadow-color: #000;
$icon-shadow-color-inverse: #000;
$icon-shadow-length: 100;
$icon-shadow-length-o: 6;
$icon-color: #fff;
$icon-hover-lighten-amount: 10%;
$icon-bg-hover-lighten-amount: 3%;
$icon-anim-duration: .4s;
$icon-anim-ease: ease;
//
// Button parameters
//
$btn-hover-lighten-amount: 10%;
$btn-bg-hover-lighten-amount: 3%;
<div class="icon-stack stack-circle github stack-4x">
<i class="fa fa-github"></i>
</div>
Brand names | ||
---|---|---|
Amazon | Android | |
Behance | Bitbucket | |
Codepen | ||
Delicious | Deviantart | Dropbox |
Etsy | ||
Firefox | Flickr | |
Github | Gitlab | Google-plus |
Houzz | ||
Lastfm | ||
Rss | ||
Skype | Slack | Snapchat |
Soundcloud | Spotify | Stack-Exchange |
Stack-Overflow | Steam | Stumbleupon |
Trello | Tripadvisor | Tumblr |
Viadeo | Vimeo | Vine |
Yahoo | Yelp | Youtube |
Envelope |
You can contribute by forking this project. Enjoy!
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that social_colors_rails demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.