Skip to content

Instantly share code, notes, and snippets.

View wfendler's full-sized avatar

William wfendler

  • 07:09 (UTC -05:00)
View GitHub Profile
@wfendler
wfendler / gist:5498975
Last active December 16, 2015 21:20
Contextual Nesting vs. OOCSS
/*------------------------------------*\
3M Homepage Feed Nav Bar Styles
\*------------------------------------*/
.feed {
.nav {
.h4 {
}
ul {
li {
a {
class TrackAnalytics
constructor: (@el) ->
@bindEvents()
bindEvents: ->
@el.on 'click', (e) =>
e.preventDefault()
@setEventProps()
class TrackAnalytics
constructor: (@el) ->
@bindEvents()
bindEvents: ->
$('body').on 'click', '.track', (e) =>
e.preventDefault()
@setEventProps()
.crazy-css3 {
css3prop: crazy-value;
.lt-ie9 & {
ie-fallback: awesome;
}
}
// compiles to:
.crazy-css3 {
css3prop: crazy-value;
// ***************************************************************************
// in _vars.scss
// ***************************************************************************
// Breakpoints
$hand-start: 481px;
$lap-start: 768px;
$desk-start: 1024px;
$wall-start: 1200px;
/**
* Backgrounds
*/
.bg--radial {
background: url('/public/images/bg-radial.png') transparent no-repeat center bottom;
}
@include media-query(1035px){
.bg--radial {
background: url('/public/images/bg-grate--alt.png') transparent no-repeat center bottom;
}
@wfendler
wfendler / ExploreMap.js
Last active December 15, 2015 17:39
Don't know how to add the data I get inside of the $list.find('li').each() and add it to the ExploreMap.locations object
/**
* Explore Map
*/
define([
'jquery'
], function(
$
) {
'use strict';
// Le Sass
// This goes through media queries and puts value in pseudo element as a js-hook
$_query-list: palm-and-down hand-and-up lap-and-up desk-and-up;
@each $mq in $_query-list {
@include media-query($mq) {
body:before { content: "#{$mq}"; display: none; }
}
}
// Le JavaScript