This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
React.if = function(cond, trueCallback, falseCallback) { | |
if(cond && typeof trueCallback === 'function') { | |
return trueCallback(); | |
} | |
else if(!cond && typeof falseCallback === 'function') { | |
return falseCallback(); | |
} | |
}; | |
// Example usage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>App</title> | |
<style> | |
*, *:before, *:after { margin: 0; padding: 0; box-sizing: border-box; } | |
</style> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form name="useTheFormNameAttributeAsAnObject" ng-submit="useTheFormNameAttributeAsAnObject.$valid && myCtrl.whatevs(whereDidThisValueComeFrom)"> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.module { | |
some: stuff; | |
&__child { | |
blah: blah; | |
} | |
&--modifier { | |
modify: me; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var React = require('react'); | |
var Router = require('react-nested-router'); | |
var Route = Router.Route; | |
var Sub = React.createClass({ | |
render: function() { | |
console.log(this.props.myData); | |
return React.DOM.span(null, 'Should this.props.myData be changing?'); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @jsx React.DOM | |
*/ | |
var React = require('react'); | |
var App = require('components/App/App.jsx'); | |
var Layout = React.createClass({ | |
render: function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Improved on react/lib/cx.js | |
// by supporting nested arrays to allow for dynamic keys | |
function cx(classNames) { | |
if(classNames instanceof Array) { | |
var filteredClasses = []; | |
classNames.forEach(function(className, i) { | |
if(typeof className === 'string') { | |
filteredClasses.push(className); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin overflow-touch() { | |
overflow-y: auto; | |
-webkit-overflow-scrolling: touch; | |
} | |
@mixin stretch($top:0, $right:0, $bottom:0, $left:0, $fixed: false, $centered: false) { | |
@if $fixed { | |
position: fixed; | |
} @else { | |
position: absolute; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="content"> | |
<h1>This is a test</h1> | |
</div> | |
<div class="grid"> | |
<div class="grid-line"></div> | |
<div class="grid-line"></div> | |
<div class="grid-line"></div> | |
<div class="grid-line"></div> | |
<div class="grid-line"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="content"> | |
<h1>This is a test</h1> | |
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum suscipit semper libero, maximus ultrices risus gravida ac. Praesent aliquam, tortor sit amet lacinia tristique, justo nisi luctus enim, in lacinia elit neque eget enim. Nam id malesuada sapien, id laoreet nulla. Donec pretium metus id maximus faucibus. Duis quis purus et ante rutrum tincidunt ut sed nibh. Morbi bibendum ipsum et sem porttitor semper eu sed mi. Ut consequat posuere sem, quis commodo metus suscipit in.</p> | |
<p>Integer interdum vulputate lectus quis molestie. Donec dui massa, efficitur eu vestibulum pretium, luctus non magna. Nullam nec volutpat tortor. Morbi eget urna ac nunc aliquam semper in id ante. Donec elementum vel nisl id vestibulum. Sed lacinia vel est ut sollicitudin. Aliquam dapibus arcu gravida varius maximus. Proin diam purus, viverra sed ante in, fringilla imperdiet neque. Ut pellentesque lectus in mollis tincidunt. Pellentesque tempor tristique sapien, eget so |
OlderNewer