Skip to content

Instantly share code, notes, and snippets.

View antsa's full-sized avatar

Antti Salonen antsa

  • Kisko Labs
  • Helsinki
View GitHub Profile
@chriseppstein
chriseppstein / 0_selector_hacks.scss
Created September 14, 2011 04:27
This gist demonstrates some uses of the new sass feature: Passing content blocks to mixins.
@mixin ie6 { * html & { @content } }
#logo {
background-image: url("/images/logo.png");
@include ie6 { background-image: url("/images/logo.gif"); }
}
@anthonyshort
anthonyshort / _media-queries.scss
Created March 13, 2012 10:37
Media Queries in Sass
// Media Queries in Sass 3.2
//
// These mixins make media queries a breeze with Sass.
// The media queries from mobile up until desktop all
// trigger at different points along the way
//
// And important point to remember is that and width
// over the portrait width is considered to be part of the
// landscape width. This allows us to capture widths of devices
// that might not fit the dimensions exactly. This means the break
function whichTransitionEvent(){
var t;
var el = document.createElement('fakeelement');
var transitions = {
'transition':'transitionend',
'MSTransition':'msTransitionEnd',
'MozTransition':'transitionend',
'WebkitTransition':'webkitTransitionEnd'
}
@chriseppstein
chriseppstein / _grid-system.scss
Created August 22, 2011 17:43
Building Responsive Layouts with Sass
@import "compass/utilities/general/clearfix";
$gutter-width: 10px; // All grids systems have the same gutter width
$float-direction: left;
$left-gutter-width: ceil($gutter-width / 2) !default;
$right-gutter-width: $gutter-width - $left-gutter-width !default;
$base-line-height: 21px;
$show-grid-background: false;
@mixin centered {
@neiled
neiled / hamlhtml5boilerplate.html.haml
Created November 25, 2010 23:20
My haml version of the html 5 boiler plate code
!!! 5
/[if lt IE 7] <html lang="en" class="no-js ie6">
/[if IE 7 ] <html lang="en" class="no-js ie7">
/[if IE 8 ] <html lang="en" class="no-js ie8">
/[if IE 9 ] <html lang="en" class="no-js ie9">
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
%head
%meta{:charset => "utf-8"}/
/
Always force latest IE rendering engine (even in intranet) &amp; Chrome Frame
@charlesroper
charlesroper / 1. input.scss
Created July 29, 2011 09:58
Responsive Web Design with Sass (SCSS syntax)
@function pxem($pxval, $base: 16px) {
// Function to take a pixel value and divide it by a base value in order to
// return the size in ems. Default base value is 16px
@return ($pxval / $base) * 1em; // multiply by 1em to convert px to ems.
}
body {
background-color: #DCDBD9;
color: #2C2C2C;
font: normal 100% Cambria, Georgia, serif;
@idan
idan / _more.scss
Created June 6, 2011 08:40
More is Less
$less-column-width: 68px;
$less-gutter-width: 24px;
@function column-width($columns) {
@return ($less-column-width * $columns) + ($less-gutter-width * ($columns - 1));
}
@function grid-padding-px($columns) {
@if $columns == 10 {
@return 48px;
@efedorenko
efedorenko / gist:2028193
Created March 13, 2012 11:22
Function for alpha blending
// Turns out this function already exists in Sass: mix(fg, bg, %) (http://d.pr/mGqa)
// Alpha blending
@function blend($bg, $fg) {
$r: red($fg) * alpha($fg) + red($bg) * (1 - alpha($fg));
$g: green($fg) * alpha($fg) + green($bg) * (1 - alpha($fg));
$b: blue($fg) * alpha($fg) + blue($bg) * (1 - alpha($fg));
@arielsalminen
arielsalminen / triggerpoints.css
Created May 15, 2011 12:54
Triggerpoints for kiskolabs.com
/* 970px and under */
@media screen and (max-width: 970px) { ... }
/* 840px and under */
@media screen and (max-width: 840px) { ... }
/* 740px and under */
@media screen and (max-width: 740px) { ... }
/* 600px and under */
@media screen and (max-width: 600px) { ... }
/* 480px and under */
@media screen and (max-width: 480px) { ... }
@AndrewVos
AndrewVos / .tmux.conf
Last active March 17, 2017 16:42
Tmux status that draws a rabbit if your cpu is not in heavy use, or a turtle if it is
set status-right "#(cpu.rb)"
set status-interval 5