Skip to content

Instantly share code, notes, and snippets.

View terkel's full-sized avatar

Takeru Suzuki terkel

View GitHub Profile
@mixin subclass ($superclass) {
.#{ $superclass },
[class^="#{ $superclass }-"],
[class*=" #{ $superclass }-"] {
@content;
}
}
@terkel
terkel / SassMeister-input.scss
Created July 16, 2014 12:09
Generated by SassMeister.com.
// ----
// Sass (v3.4.0.rc.1)
// Compass (v1.0.0.alpha.20)
// ----
.outer {
color: red;
.inner {
color: green;
<div data-href="http://YOUR-URL-GOES-HERE" data-layout="button_count" class="fb-share-button"></div>
<script src="//connect.facebook.net/en_US/sdk.js#xfbml=1&amp;version=v2.0" id="facebook-jssdk" async></script>
<a href="https://twitter.com/share" class="twitter-share-button">Tweet</a>
<script src="//platform.twitter.com/widgets.js" id="twitter-wjs" async></script>
<div data-size="medium" class="g-plusone"></div>
<script src="https://apis.google.com/js/platform.js" async defer></script>
<a href="http://b.hatena.ne.jp/entry/" data-hatena-bookmark-layout="standard-balloon" data-hatena-bookmark-lang="en" class="hatena-bookmark-button"></a>
@terkel
terkel / _clearfix.scss
Last active September 25, 2015 06:57
_clearfix.scss
// http://nicolasgallagher.com/micro-clearfix-hack/
$support-ie: 8 !default;
@mixin clearfix {
@if $support-ie and $support-ie != 0 and $support-ie < 8 {
*zoom: 1;
}
&:before,
&:after {
content: " ";
display: table;
@terkel
terkel / _grids.scss
Created April 8, 2011 14:03
Sass module like YUI CSS Grids
// _grids.scss
$gridWidth: 100%;
$colGap: 0;
@mixin grid () {
display: table;
width: $gridWidth + $colGap;
@if $colGap > 0 {
margin-right: - $colGap;
@terkel
terkel / reset.css
Created May 15, 2011 16:47
CSS Reset
* {
padding: 0;
margin: 0;
}
html {
overflow-y: scroll;
font: small; /* for IE6 in quirks mode */
}
body {
font-size: 100%;
@terkel
terkel / jquery.dropdown.js
Created May 18, 2011 09:41
jQuery Dropdown plugin
// jQuery Dropdown plugin
(function ($) {
$.fn.dropdown = function (options) {
var opts = $.extend({
child: 'ul:first',
hoverClass: 'hover',
showTimeout: 100,
showSpeed: 200,
hideTimeout: 200,
hideSpeed: 100
@terkel
terkel / jquery.ua.js
Created June 12, 2011 14:48
jQuery User-Agent Detection Plugin
// See https://github.com/terkel/jquery-ua
@terkel
terkel / jquery.toggleHoverClass.js
Created July 11, 2011 06:53
jQuery Toggle Hover Class Plugin
// jQuery Toggle Hover Class Plugin
(function ($) {
$.fn.toggleHoverClass = function () {
return this.each(function () {
var $this = $(this),
c = this.className,
originalClasses = c? c.split(' '): [],
hoverClasses = [],
hoverClass = 'hover',
len = originalClasses.length,
@terkel
terkel / gist:1077264
Created July 12, 2011 02:09
addClass()
function addClass (elem, classes) {
var c = elem.className;
elem.className = c? c + ' ' + classes: classes;
}