Skip to content

Instantly share code, notes, and snippets.

View sturobson's full-sized avatar
:atom:
coding things

Stuart Robson sturobson

:atom:
coding things
View GitHub Profile
...
// test for font-face version to load via Data URI'd CSS
// Basically, load WOFF unless it's android's default browser, which needs TTF, or ie8-, which needs eot
var fonts = ns.files.css.fontsWOFF,
ua = win.navigator.userAgent;
// android webkit browser, non-chrome
if( ua.indexOf( "Android" ) > -1 && ua.indexOf( "like Gecko" ) > -1 && ua.indexOf( "Chrome" ) === -1 ){
fonts = ns.files.css.fontsTTF;
}
.accordion {
.js & {
display: none;
}
.js .open + & {
display: block;
}
li {
border-top: 1px solid #e2e4e6;
&:first-child {
@sturobson
sturobson / gist:6639967
Created September 20, 2013 16:11
320 bookmarklet
javascript:open( location, 'iPhone:portrait', 'innerWidth='+(320)+' ,innerHeight='+(480)+' ,scrollbars=yes' );
@sturobson
sturobson / SassMeister-input.scss
Created October 26, 2013 21:20
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.10)
// ----
//elements get appended with "__" and the $name
@mixin e($name) {
@at-root #{&}__#{$name} {
@content;
}
@sturobson
sturobson / gist:7418645
Created November 11, 2013 19:13
What I want in my gruntfile... I'm trying to develop a little styleguide / basic template prototyping thing for a client using Grunt. As much as I love Mixture the client can't afford to have the software available for each freelancer so I'm thinking this list of things would be the next best thing.
// Autoprefixer
https://github.com/nDmitry/grunt-autoprefixer
// Sassdown
https://github.com/nopr/sassdown
// Compass
https://github.com/gruntjs/grunt-contrib-compass
// Connect
@sturobson
sturobson / gist:7450697
Created November 13, 2013 15:14
naming convention opinion...
I'm front-end'ing a site for a client that has a 'favourite' or 'star-ing' functionality.
My question is, how to name whether the item has been starred or not.
Current logic in my CSS has things that are already .is-open, .is-closed, .is-active, .is-inactive, .is-visible and .is-hidden
I'm currently toying with
.is-favourited and .is-Notfavourited but that's pretty crap
// Mobile / Desktop JS
$( '.desktop-site-link' ).click(function() {
viewport = document.querySelector('meta[name=viewport]');
viewport.setAttribute('content', 'width=1024');
return false;
});
$( '.mobile-site-link' ).click(function() {
viewport = document.querySelector('meta[name=viewport]');
viewport.setAttribute('content', 'width=device-width, initial-scale=1.0');
return false;
@sturobson
sturobson / gist:7845254
Last active December 30, 2015 14:59
Squeeler Setup
grunt Sass
https://github.com/gruntjs/grunt-contrib-sass
grunt Autoprefixer
https://github.com/nDmitry/grunt-autoprefixer
grunt imageoptim
@sturobson
sturobson / gist:8290169
Created January 6, 2014 21:31
Sassifaction .scss file 'header' comments design
/*
Mixin or similar title
//////////////////////
A Short two/three sentence description of what the file is and what it does
An example of how to use the code
An example of the compiled CSS
@sturobson
sturobson / SassMeister-input-HTML.html
Created January 7, 2014 21:44
Generated by SassMeister.com.
<header>
<h1>This is a heading</h1>
</header>