Skip to content

Instantly share code, notes, and snippets.

View astrotim's full-sized avatar

Tim Holt astrotim

View GitHub Profile
@astrotim
astrotim / SassMeister-input.scss
Created April 30, 2015 00:18
Generated by SassMeister.com.
// ----
// Sass (v3.4.13)
// Compass (v1.0.3)
// Toolkit (v2.9.0)
// ----
@import "toolkit";
$Placeholder-Selectors: ();
// Copyright 2012 Google Inc.
/**
* @author Chris Broadfoot (Google)
* @fileoverview
* An info panel, which complements the map view of the Store Locator.
* Provides a list of stores, location search, feature filter, and directions.
*/
/**
var stores = [],
store,
latLng,
features = null,
i, s;
for (i = 0; i < crtStores.stores.length; i++) {
s = crtStores.stores[i];
@astrotim
astrotim / webpack2.css-modules.config.js
Created March 7, 2017 10:55
Working CSS Modules Webpack config
const path = require('path');
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: [
path.resolve(__dirname, 'src')
],
@astrotim
astrotim / webpack.dev.config.js
Created July 25, 2017 04:16
Builds site as client side app and runs with Webpack dev server
const path = require('path');
const webpack = require('webpack');
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
entry: {
bundle: path.resolve(__dirname, 'src', 'client.js'),
scripts: path.resolve(__dirname, 'src', 'scripts.js')
},
@astrotim
astrotim / webpack.prod.config.js
Created July 25, 2017 04:17
Builds site as static files using StaticSiteGeneratorPlugin
const path = require('path');
const webpack = require('webpack');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const StaticSiteGeneratorPlugin = require('static-site-generator-webpack-plugin');
module.exports = {
entry: [path.resolve(__dirname, 'src')],
output: {
@astrotim
astrotim / index.js
Created July 25, 2017 04:20
The application file used by the Webpack production build
import React from 'react';
import ReactDOMServer from 'react-dom/server';
import { StaticRouter as Router } from 'react-router-dom';
import App from './App';
import HTML from './HTML';
// static site generator
export default function render(locals, callback) {
const context = {};
@astrotim
astrotim / client.js
Created July 25, 2017 04:21
The application file used by the development Webpack build
import React from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter } from 'react-router-dom';
import App from './App';
const root = document.getElementById('root');
ReactDOM.render(<BrowserRouter><App /></BrowserRouter>, root);
@astrotim
astrotim / grid-not-supported.sass
Last active August 23, 2017 06:25
CSS Grid feature detection
@mixin grid-not-supported {
// fallback with native feature detection
@supports not (display: grid) {
@content;
}
// fallback with Modernizr feature detection (IE)
.no-supports & {
@content;
}
@astrotim
astrotim / display-grid.sass
Created August 23, 2017 06:27
CSS Grid Mixin
@mixin display-grid {
// single column by default at XS size
@include screen-from($bp-sm-min) {
display: grid;
@include grid-not-supported {
display: flex;
flex-wrap: wrap;
};