Code Monkey home page Code Monkey logo

css-social-buttons's Introduction

Zocial CSS Social Buttons

The idea is to create beautiful social buttons using only CSS, rendering popular social icons as a font, and requiring minimal extra markup.

Benefits

  • Buttons always look sharp at any size and screen resolution.
  • Easily customize the size and call to action of the buttons.
  • Easily localize button text to other languages.

Usage

  1. Can be any element e.g. a, div, button etc.
  2. Add class of .zocial and add class for name of service e.g. .dropbox, .twitter, .github
  3. Optional: Add a class of icon to display as icon instead of button
  4. Optional: Change font size of the element to resize button

There's also a LESS version from @gustavohenke here

Examples:

<button class="zocial facebook">Sign in with Facebook</button>

or

<a class="zocial twitter">Follow Me</a>

Demo

https://smcllns.github.io/css-social-buttons/

Browser Support

  • custom font file for all social icons works well in any browser supporting @font-face
  • icon font use private unicode spaces for accessibility
  • CSS3 degrades gracefully in IE8 and below

CDN

This project is available on CDNJS: https://cdnjs.com/libraries/css-social-buttons

How to contribute

  1. Install Font Custom (*)
  2. Add or update the icon .svg in the src/ folder.
  3. Set the button and font color in templates/zocial.css file.
  4. Run fontcustom compile
  5. Update the demo page (index.html) with both the button and icon.
  6. Test rendering. If broken go to step 2.
  7. Send pull-request !

(*) if you are having difficulting installing Font Custom, you can use a docker container. Instead of running #4, run docker run -v ${PWD}:/project drichner/fontcustom compile from the root of this directory.

License

Under MIT License

The GitLab logo is derived from this which is released under CC BY-NC-SA 4.0.

css-social-buttons's People

Contributors

crowmagnumb avatar heuzef avatar inquam avatar jvatic avatar karlwilbur avatar kkirsche avatar limeblast avatar martindlut avatar nitrix avatar pxwise avatar sabrecat avatar shaun-floss avatar sheabunge avatar smcllns avatar stefanobernardi avatar suttonj avatar tonydspaniard avatar vikaskyadav avatar walski avatar winniehell avatar xgp avatar ymarcus93 avatar zimbatm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

css-social-buttons's Issues

Wrapping error with a recent build of dev channel chrome

I'm not positive about this, but I think a recent change to dev channel chrome has made the buttons' text wrap sometimes, making them look pretty bad. They still look good in FF, and i'm almost positive they were fine before in chrome. This could also be a chrome bug.

For me, this fixed it:

.zocial { whitespace: no-wrap; }

Add title attribute to sample icon-only buttons

On the sample page, most of the icon+text buttons mention the name of the service or network, but some of the icon-only ones aren't recognisable if you don't already use them. Could those buttons have a title attribute that indicate what they are for? e.g.

<a href="#" class="zocial icon yelp" title="Yelp"><span>Write a review on Yelp</span></a>

Predefined link hover text color messing up buttons

If I have a color set on the a:hover element before the zocial style rules take place, Zocial will not override this and instead use the previously defined color on hover.

For example, if I had this in my stylesheet:

a:hover { color: orange; }

Hovering over a button with white text will change the text to orange. This looks very ugly, and so a default hover state color for a link will .zocial should be defined.

Copyright question

As I understand this you are the original author of these fonts(?). Still, there is an Adobe copyright in the ttf metadata. Why is this? In particular, is it clear that Adobe does not have any license restrictions on this font?

Icons not showing

I just downloaded the files and uploaded to a test server.

But i can't see any icons on buttons, on chrome nothing appear and on firefox the code from css file appear.

http://d.pr/i/n2FO

What i am doing wrong? i checked the paths to the fonts, all are correct. I have no idea why couldn't work.

Can be a server issue?

icons not showing up

I am using this in an application built in Ruby on Rails 3.2.1 I have been finding it difficult to integrate as the I am unable to show the logo on the left side of the button but instead it shows the unicode. your help will be appreciable.

Include 'Install Method' by Bower Package Manager

After using the Social buttons in a couple recent projects and using Bower as a package manager to help me keep my Javascript and libraries organized, I believe that it would be nice to have Zocial included in the Bower Registry.

All that is needed is a components.json file in the root of samcollins/css-social-buttons which would include:

{
  "name": "Zocial",
  "version": "1.0.0",
  "main": ["./css/zocial.css"]
}

and then a simple command to register with Bower's Registry: bower register zocial git://github.com/samcollins/css-social-buttons.

Afterwords, adding a simple message to the README.md stating that you can also install (basically download) Zocial CSS Social Buttons via Bower Package Manager.

Thanks for your hard work as well!

Add BitBucket icon

Hi,

Since you've got a BitBucket icon. Maybe it'd be good to add a BitBucket icon for people who use that service?

(feels so bad talking about bitbucket here on github)

untappd icon

It would be cool if an untappd icon were added! Thanks for the awesome work on this.

Nicole

Where have the private unicode chars gone?

Hey,
What happened to the private unicode chars that were present on every single icon?
I know that there are some icons that still use 'em, but they're very few, and not the main ones.

Thanks

Improve GitHub icon

The current icon for GitHub is nice, but it would be great to have an icon that includes GitHub's "octocat" (as seen in the favicon of this website). Perhaps the octocat icon could become the new GitHub icon, and the old GitHub icon could become an icon simply for Git.

Make CSS selectors alphabetical

Can the two sections, currently with the header Button icon and main button area by made alphabetical?

They currently seem to be in a random order, but having them alphabetical will allow users to see at a glance if their favourite social network is supported without having to check through the whole list extremely carefully.

e.g.

.zocial.amazon > span:before {content: "a";}
.zocial.android > span:before {content: "&";}
.zocial.aol > span:before {content: "\"";}
.zocial.appstore > span:before {content: "A";}
.zocial.bitcoin > span:before {content: "2"; color: #f7931a !important;}
.zocial.blogger > span:before {content: "B";}
.zocial.call > span:before {content: "7";}
.zocial.disqus > span:before {content: "Q";}
.zocial.dribbble > span:before {content: "D";}
...

Cannot mix icon class with regular extended buttons

When adding an icon class to the row with regular extended buttons a height issue comes into play. In the screenshot below I removed the overview which revels the elongated text beneath the button. Would wrapping the other text in a span or other element be a viable solution to this.

screen

Add lkd.to icon

Hello,

Saw other social icons using lkd.to as an icon and I'd like to add it to my site using zocial.

Think you could add lkd.to?

Lowercase hex codes

You've currently got a mixture of upper and lowercase hex colour codes in your CSS - please can these be standardised?

Preferably to lowercase - no shift key needed, all other values within CSS are lowercase (ideally including url() paths), several popular standards like WordPress use lowercase, doesn't feel like "shouting", etc.

App.net

Hey,

First, thanks for all the great buttons. Second, have you considered to add a app.net button?

Cheers,
Simon

Consistently use hex colours, not named colours

Currently there are two named colours (green and blue).

These are both inconsistent with all of the other hex colours, and take up either the same or more bytes than their hex equivalents.

Loading fonts from different domains

Firefox don't allow including fonts cross domain. You can set the CORS header Access-Control-Allow-Origin but you aren't allowed to add header everywhere.

Easiest way of solving this problem is to include the fonts in the CSS file base64 encoded.

What do you say @SamCollins about this?

Add support for Yahoo

This project is awesome. Thanks Sam! I'd love support for a Yahoo button as well. E.g. for users who are connecting their Yahoo mail address book.

Protect top credit block

Most CSS minifiers will strip comments, but some will keep ones that with a !. I'd suggest amending the top block of credit/attribution comments into one block and adding a ! at the start:

/*!
Code written by Sam Collins (@smcllns) of www.eventasaur.us
You are free to use this work commercially.
You are free to extend this work without permissions from the author (just do so tastefully eh?).
Enjoy.
*/

This should ensure that if your CSS gets dropped into another style sheet, that the credit is still maintained (in at least a few more circumstances than it would right now).

identi.ca icon

It would also be great to have an identi.ca icon.

Thanks a ton!
Nicole

Font load issue on IE8

Hi Sam,

Im testing your the asssssome "css socia"l in IE8 and apparently ... the custom font not loaded proper or something like this ... can you give a try ??

NOTE: im currenlty using webfonts in other pages in IE8 and works fine with these ...

According this paper :

http://caniuse.com/#feat=fontface

it have a partial support ...

thks, once for this excelent work !

IE7 Compatability

Hey Sam,

This is not an issue but rather just a note for everyone. I was trying to get your icons working in IE7 (I know - I hate it too!) And I came across this stackoverflow question which helped:

http://stackoverflow.com/questions/4181884/after-and-before-css-pseudo-elements-hack-for-ie-7

Basically, you just need to add

<!--[if lt IE 8]>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE8.js"></script>
<![endif]-->

and the icons will now work in IE7 - not sure about IE6 but I draw the line at IE7 :)

Add Stackoverflow Icon

Thanks for putting this project out in the community-- its perfect for something I'm getting ready to implement on my blog!

One icon I noticed you are missing that I think is important for developers is a Stackoverflow icon. Whether you are someone who answers a lot of questions on SO, or just have your online resume posted on careers.stackoverflow.com, I think its a pretty important site for developers. Would you mind adding a SO icon? I'd greatly appreciate it!

license

Are you planning to select and state a license for the project?

Unshortened hex codes

There's at least 3 instances of #ff0000 that have not been shortened down to #f00.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.