Skip to content

Instantly share code, notes, and snippets.

@kawasako
kawasako / gist:3993311
Created November 1, 2012 12:17
テスト
<h1>test</h1>
@kawasako
kawasako / gist:6326361
Last active December 21, 2015 15:28
@mixin float
// clearfix
@mixin clearfix {
zoom: 1;
&:after {
content: "";
display: block;
clear: both;
}
}
@kawasako
kawasako / gist:6326468
Created August 24, 2013 06:40
CSS "+"selector
// Example ul>li*3
// Bad
ul {
li{
margin-top: 10px;
border-top: 1px solid #ccc;
&:first-child {
margin-top: 0;
border-top: none;
@kawasako
kawasako / gist:6326561
Created August 24, 2013 07:01
CSS3 ie icon animation
// Example .ball>.ie
@-webkit-keyframes pop {
0% {
top: 0;
}
10% {
top: -30px;
}
30% {
// Example
@mixin hoge {
p {
color: red;
@content;
}
}
.alert {
@kawasako
kawasako / server.rb
Created August 24, 2013 21:38
webrick simple server
require 'webrick'
include WEBrick
s = HTTPServer.new(
:Port => 8000,
:DocumentRoot => '.'
)
trap("INT"){ s.shutdown }
s.start
@kawasako
kawasako / gist:6340979
Created August 26, 2013 12:35
SCSS @extend :active
// Example
.hoge:active{
color: red;
}
.fuga {
@extend .hoge:active;
}
@kawasako
kawasako / gist:6342210
Created August 26, 2013 14:46
SCSS @mixin inline-block
// Mixin
@mixin inline-block() {
display: inline-block;
*zoom: 1; // hasLayout true for ie7
*display: inline; // for ie7
}
@kawasako
kawasako / gist:6342876
Last active December 21, 2015 17:49
SCSS @each
// Example
$colors: red, blue, green;
@each $color in $colors {
.#{$color} {
color: $color;
}
}
// Example
@mixin hoge($num, $str){
// if $num
@if $num < 10 {
margin-top: $num;
}@else{
margin-top: 15px;
}