Skip to content

Instantly share code, notes, and snippets.

/*
Scoped Media Query Mixins - an element query workaround.
@mixin respond-to-all : generates @media () {}
@mixin respond-to-screen : generates @media screen and () {}
@mixin respond-to-screen-only : generates @media screen only and () {}
Accepts the following input :
@graste
graste / RTL.md
Created November 1, 2013 22:15 — forked from Integralist/RTL.md

Right-to-Left (RTL)

Implementation

There are two methods to use in order to flip CSS styles: interpolated properties and the flip() function.

  • Interpolation should be used for any property which has a direction (e.g. padding-left, margin-right, border-right, left, etc.)
  • flip() should be used for all other properties

Which properties need to be flipped?

@graste
graste / _BreakpointBomb.scss
Last active December 28, 2015 23:29
SCSS breakpoint debugging for inuit.css
@each $name in bomb1, bomb2, bomb3 {
@include keyframe($name){
0% {
z-index: 9001; /* IT'S OVER 9000!!!!! */
opacity: 1;
}
90% {
opacity: 1;
}
100% {
@graste
graste / pr.md
Created November 21, 2013 12:11 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

/*
The following style of inheritance is called 'classical inheritance'
The fundamentals of it are using functions as a 'Constructor' (class) to create new objects.
*/
function Article(title, date, description) {
this.title = title || 'No title provided';
this.date = date || 'No date provided';
this.description = description || 'No description provided';
}
/**
* (C)Leanest CSS spinner ever
*/
@keyframes spin {
to { transform: rotate(1turn); }
}
.progress {
position: relative;

What are we trying to observe? Raw object data.

// Objects
var obj = { id: 2 };
obj.id = 3; // obj == { id: 3 }
 
// Arrays
var arr = ['foo', 'bar'];
arr.splice(1, 1, 'baz'); // arr == ['foo', 'baz'];
<!DOCTYPE html>
<!--[if IE 8]> <html lang="sv-SE" class="no-js ie8"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="sv-SE" class="no-js"> <!--<![endif]-->
<head>
<meta charset="UTF-8">
<title>Breakpoint detection test</title>
<style type="text/css" media="screen">
@media screen and (min-width: 320px) {
#page:after {
content: 'smallest'; /* represent the current width-bracket */
// ----
// Sass (v3.3.0.rc.2)
// Compass (v1.0.0.alpha.17)
// ----
// Extend function, JS STYYYYLE !
// ------------------------------------------------------------
// @param (map) $obj: default object
// @param (map) $extObj: conf object
// ------------------------------------------------------------