• Stars
    star
    189
  • Rank 204,649 (Top 5 %)
  • Language
    Ruby
  • Created about 13 years ago
  • Updated about 13 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Sass and Compass CSS3 social buttons framework

Zocial, a CSS3 social buttons Sass framework.

Zocial is a CSS3 social buttons set and vector icons with @font-face as a Sass mixin and usable as a Compass extension.

HUGE thanks to Sam Collins for all his hard work on the original CSS3 button set and the Zocial icons font! Without his work, this project would not exist.

This project includes buttons for:

  • Twitter
  • Facebook
  • Google+
  • GitHub
  • RSS
  • Smashing Magazine
  • and MANY more ...

Installation

The first step is to install the Ruby gem. If you are not yet setup to work with Sass and Compass, please see the getting started guide at The Sass Way.

(sudo) gem install zocial

Next, we need to require Zocial in the Compass config file of your project.

require 'zocial'

Next is a very crucial step ... getting the fonts installed to your project. This is the step you'll get hung up on if you didn't do the previous steps. Head back to the terminal and run this command from the root of the project you're installing Zocial to.

# execute at the root of your project
compass install zocial/fonts

You should see something like this:

-> % compass install zocial/fonts
directory fonts/zocial/ 
  create fonts/zocial/zocial-regular-webfont.eot
  create fonts/zocial/zocial-regular-webfont.svg
  create fonts/zocial/zocial-regular-webfont.ttf
  create fonts/zocial/zocial-regular-webfont.woff

Once you've done this, your project will be ready to use Zocial! The next step is to "mixin" Zocial which is covered in the usage section.

Usage

Zocial has a few defaults in place that you can override for your project.

// Defaults
$zocial-font-size: 1.8em
$zocial-font-weight: bold
$zocial-icon-font: zocial
$zocial-icon-default: "\0020"
$zocial-text-font: helvetica

$zocial-font-size is set using ems and will vary in size based on your default font size.

$zocial-icon-font is set to "zocial" by default. In a previous version, there was a "lite" version of the font offered as open source, but now the full Zocial font is now included as open source and you can use all the buttons zocial has to offer.

$zocial-icon-default is set to an empty space by default. Feel free to update this if you plan to use a default button and want to set a default icon.

$zocial-text-font is set to "helvetica" by default, but can set to any of the fonts defined. In a future release, we plan to work on adding better options for using other fonts. Please be patient.

Mixins

Once you have Zocial's settings in place, it's time to mixin zocial. Zocial has two mixins, one for the free set (zocial-lite) and one for the full set (zocial-full) that can purchased here.

To use the free set that comes with this project, use this mixin:

// SCSS
@include zocial;

// Sass
+zocial

HTML Markup

Here's a snippet of example HTML markup in both HTML and Haml. The caveat or gotcha that most people stumble over is the required nested <span> element. As you can see, each Zocial button gets the required .zocial class name plus the button name.

<button class="zocial twitter">
  <span>Sign in with Twitter</span>
</button>
<a class="zocial twitter" href="#">
  <span>Sign in with Twitter</span>
</a>

%button.zocial.twitter
  %span Sign in with Twitter
%a(href="#" class="zocial twitter")
  %span Sign in with Twitter

To use just the icon version of the Zocial button, all you need to do is add the class name .icon to the above markup. Here's is the repeated code, but this time adding the .icon class.

<button class="zocial icon twitter">
  <span>Sign in with Twitter</span>
</button>
<a class="zocial icon twitter" href="#">
  <span>Sign in with Twitter</span>
</a>

%button.zocial.icon.twitter
  %span Sign in with Twitter
%a(href="#" class="zocial icon twitter")
  %span Sign in with Twitter

Buttons classes

The examples shown above illustrate how to use the Twitter Zocial button. Below are the full class options for the named buttons.

  • .twitter
  • .facebook
  • .googleplus
  • .github
  • .rss
  • .smashingmag

Font Family Choices

Icon font:

  • zocial

Text font:

  • helvetica
  • arial (alias to helvetica)
  • lucida-grande
  • lucida (alias to lucida-grande)
  • tahoma
  • times
  • georgia

License

Copyright (c) 2011 Sam Collins (@smcllns) and Adam Stacoviak (@adamstac)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

sinatra-bootstrap

A simple Sinatra starting point
Ruby
378
star
2

animate.sass

Sass and Compass CSS animation library based on Animate.css
Ruby
325
star
3

grid-coordinates

Sass and Compass highly-configurable CSS grid framework
CSS
108
star
4

meyer-reset

Eric Meyer CSS reset in Sass
Ruby
106
star
5

serve-bootstrap

Serve Bootstrap to aid in rapid design using Haml, Sass and Compass
Ruby
83
star
6

staticmatic-bootstrap

StaticMatic bootstrap with support for Haml, Sass, Compass and jQuery
JavaScript
71
star
7

pictos-free

Sass and Compass interface icon set (Pictos Free) from Drew Wilson
Ruby
52
star
8

font-stacks

Sass and Compass font-family library of common web-friendly font stacks
Ruby
39
star
9

nanoc-bootstrap

Nanoc bootstrap with support for Haml, Sass, Compass and jQuery
Ruby
36
star
10

jquery-qt-controller

A jQuery powered Quicktime Interface Controller
JavaScript
20
star
11

thor-wordpress

A set of Thor tasks to make developing with Wordpress easier
18
star
12

mailplane-hide-gmail-ads-css

A simple CSS file to use with Mailplane to hide the Gmail ads
14
star
13

compass-extension-bootstrap

Compass extension bootstrap is a simple starting point for creating Compass extensions.
Ruby
14
star
14

sass-textmate-bundle

A TextMate bundle to aid in rapid Sass development (indented syntax)
14
star
15

960-grid-system-textmate-bundle

TextMate Bundle for rapid development with 960.gs and HAML
12
star
16

smashing-layout

The Sass Way to recreate Smashing Magazine's layout (circa 2009)
Ruby
9
star
17

pictosfree.heroku.com

The demo for Pictos Free
Ruby
7
star
18

foundation-sass

SASSy-fied
JavaScript
6
star
19

nesta-bootstrap

A clean starting point for Nesta based sites using Haml, Sass and Compass
JavaScript
6
star
20

grid-coordinates.com

Hompage for Grid Coordinates - Sass based CSS Grid Framework Generator (Compass Extension)
Ruby
4
star
21

compass-simple

A simple, no fluff, project to use when illustrating code samples using Haml, Sass and Compass
Ruby
3
star
22

coffeefancy

Community-driven Coffee repo. Stars, stars, stars!
2
star
23

smashinglayout.com

Homepage for Smashing Layout - The Sass Way to recreate Smashing Magazine's layout (circa 2009)
JavaScript
2
star
24

ignitehouston-staticmatic

StaticMatic version of letsignitehouston.com
Ruby
1
star
25

itseasyjustsignup

Ruby
1
star
26

bedrock

Bedrock is a work in-progress.
Ruby
1
star
27

learningruby

Memoirs of an aspiring Rubyist
Ruby
1
star