A Pen by Miguel Palau on CodePen.
This file contains hidden or 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
import React from 'react' | |
import { BrowserRouter as Router, Switch } from 'react-router-dom' | |
import routes from './routes' | |
import FancyRoute from './components/tools/FancyRoute' | |
const App = props => | |
<Router> | |
<Switch> | |
{routes.map((route, i) => | |
<FancyRoute key={i} {...route} /> |
This file contains hidden or 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
const webpack = require('webpack') | |
const UglifyJSPlugin = require('uglifyjs-webpack-plugin') | |
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin | |
const {cwd} = require('process') | |
const production = process.env.NODE_ENV === 'production' | |
const debug = process.env.NODE_ENV === 'debug' | |
// When you really want to make the relationship work... | |
const ENTRY_PATH = cwd() + '/src/index.js' |
This file contains hidden or 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
{ | |
... | |
"standard": { | |
"globals": [ | |
"afterAll", | |
"afterEach", | |
"beforeAll", | |
"beforeEach", | |
"describe", | |
"test", |
This file contains hidden or 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
/** | |
* Make a document.querySelectorAll loopable | |
* @author Todd Motto | |
* @tutorial https://toddmotto.com/ditch-the-array-foreach-call-nodelist-hack | |
* @param {NodeList} elements | |
* @param {Function} callback function that takes element and index | |
* @param {this} scope what this refers to | |
*/ | |
const loopQuery = (elements, callback, scope) => { | |
for (let i = 0; i < elements.length; i++) { |
This file contains hidden or 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
// Require and use modules via data attributes | |
// your modules need to take an element as a param | |
// the modules live in this same folder to work | |
const moduleElements = document.querySelectorAll('[data-module]') | |
Array.prototype.forEach.call(moduleElements, el => { | |
const name = el.getAttribute('data-module') | |
const Module = require(`./${name}`) | |
Module(el) | |
}) |
This file contains hidden or 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
<head> | |
<script> | |
if (window.localStorage && window.localStorage._tk_cache) { | |
document.documentElement.classList.add('wf-active'); | |
var script = document.createElement('script'); | |
script.innerHTML = localStorage._tk_cache + ";(function () {var timeout = setTimeout(function () {document.documentElement.classList.remove('wf-active');}, 300); Typekit.load({ async: false, active: function () { clearTimeout(timeout); }});})();"; | |
document.head.appendChild(script); | |
} | |
window._tk_onload = function () { | |
var req = new XMLHttpRequest() |
This file contains hidden or 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
/* | |
Streamlined Shopify theme development. | |
npm install --save-dev yargs gulp gulp-sass gulp-changed gulp-sourcemaps gulp-autoprefixer gulp-uglify gulp-concat gulp-replace gulp-plumber gulp-babel browser-sync gulp-if del gulp-add-src gulp-rename gulp-yaml gulp-shopify-theme | |
Highlights: | |
- https proxying via BrowserSync | |
- autoreload | |
- sourcemaps support |
This file contains hidden or 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
.slick-slider { | |
margin-bottom: 40px; | |
} | |
// Custom Dots | |
.slick-dots { | |
text-align: center; | |
font-size: 0; | |
line-height: 0; | |
position: absolute; | |
width: 100%; |
This file contains hidden or 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
$caret: url(BASE_64_PNG); | |
.custom-select { | |
appearance: none; | |
border-radius: 0; // Safari Mac/iOS | |
border: none; // Safari Mac/iOS/Firefox | |
display: block; | |
width: 100%; | |
background: { | |
size: 12px; // Size of your caret |