Skip to content

Instantly share code, notes, and snippets.

@tsi
tsi / css.css
Last active December 11, 2015 19:38
Comparing Sass vs CSS layout systems - using CSS
/* With a CSS grid system */
/* Using a Css system, you'll have in your mark-up something like that
*
* <div class="col span_1_of_2"></div>
* <div class="col span_1_of_2"></div>
*
* Then, for a simple rwd task, you'll have this in your CSS:
* (taken from http://www.responsivegridsystem.com/)
*/
@tsi
tsi / _pie.scss
Last active December 10, 2015 20:08
Extending the standard compass CSS3 mixins with CSS3PIE
///////////////////////////////////////////////////////////////////
// Extending the standard compass CSS3 mixins with CSS3PIE
///////////////////////////////////////////////////////////////////
$pie: url('/RELATIVE/PATH/TO/PIE.htc');
$pie-approach: relative;
@import "compass/css3";
@mixin pie-border-radius($radius, $position: $pie-approach) {
@tsi
tsi / _triangle.scss
Last active November 27, 2016 14:16
Sass triangle
@mixin triangle(
$dir: top,
$pos: 50%,
$color1: #fff,
$color2: darken($color1, 30%),
$size1: 6px,
$size2: $size1
) {
$opos: map-get(( top: bottom, right: left, bottom: top, left: right ), $dir);
$transparent: if($dir == left or $dir == right, (top, bottom), (left, right));
@tsi
tsi / template.php
Created October 17, 2012 19:20
Add role based calsses to <body>
function THEME_preprocess_html(&$vars) {
if ($vars['user']) {
foreach($vars['user']->roles as $key => $role){
$vars['classes_array'][] = 'role-' . drupal_html_class($role);
}
}
}
@tsi
tsi / salsa-demo.scss
Created October 2, 2012 17:48
salsa-demo.scss
@import "compass/css3";
@import "salsa/salsa";
// container grids
.container {
text-align: center;
.element {
@include border-radius(12px);
@include box-shadow(0 0 40px rgba(0,0,0,.3) inset);
@include transition(margin .5s);
@tsi
tsi / _inline-block.scss
Last active October 8, 2015 18:17
Inline block with ie7 support
/*
* ##### Sasson - advanced drupal theming. #####
*
* SASS mixins
* http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#mixins
*
*/
// Inline block with ie7 support
@mixin inline-block($alignment: false, $ie7-support: false) {
@tsi
tsi / dabblet.css
Created August 15, 2012 08:38
CSS flipping inheritance
/**
* CSS flipping inheritance
*/
/* Original code */
.class {
margin-left: 3em; /* Will be flipped */
margin-right: 2em; /* Will be flipped */
padding-left: 1em; /* Will be flipped and reseted */
}
@tsi
tsi / dabblet.css
Created August 15, 2012 07:39 — forked from anonymous/dabblet.css
CSS flipping tools
/**
* CSS flipping tools
*/
/* Original code */
.class {
padding: 1px 2px 3px 4px;
margin-right: 3em;
background: url(image.gif) no-repeat right center;
margin-bottom: 20px;
@tsi
tsi / fileWatcher.js
Last active October 8, 2015 14:58
Improved file watcher
/**
* This script will watch files for changes and
* automatically refresh the browser when a file is modified.
*
* Usage:
*
* - Include it:
* <script src="/js/fileWatcher.js"></script>
*
* - Call it from your script (or un-comment the call below):
@tsi
tsi / dabblet.css
Created August 11, 2012 11:59 — forked from anonymous/dabblet.css
Media queries and @import rules
/**
* Media queries and @import rules
*/
@import "http://twitter.github.com/bootstrap/assets/css/bootstrap.css";