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 preact from 'preact' | |
| import connect from 'refunk' | |
| // pass only select props to child | |
| function pear (mapProps) { | |
| return Component => props => ( | |
| <Component {...mapProps(props)} /> | |
| ) | |
| } |
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
| export default types => (ctx = document) => { | |
| return { | |
| init () { | |
| for (let type in types) { | |
| const attr = 'data-' + type | |
| const nodes = [].slice.call(ctx.querySelectorAll(`[${attr}]`)) | |
| for (let i = 0; i < nodes.length; i++) { | |
| try { | |
| require(types[type] + nodes[i].getAttribute(attr) + '.js').default(nodes[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
| // imports... | |
| if (module.hot) { | |
| module.hot.accept() | |
| } | |
| import style from '../styles/main.css' | |
| // app code... |
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 { Stepper, Step } from 'react-stepper' // need a new name, this is taken | |
| render( | |
| <div> | |
| <Stepper active={0}> | |
| <Step> | |
| {({ next, prev, clear }) => (...component1...)} | |
| </Step> | |
| <Step> | |
| {({ next, prev, clear }) => (...component2...)} |
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 triage = obj => Object.keys(obj).reduce((res, key) => { | |
| res += !!(obj[key]) ? ` ${key}` : '' | |
| return res | |
| }, ' ') | |
| const cx = (...args) => args.reduce((res, arg) => { | |
| res += typeof arg === 'string' ? ` ${arg}` : triage(arg) | |
| return res | |
| }, ' ').trim().replace(/\s\s/, ' ') |
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 { createStore, combineReducers } from 'redux' | |
| import action from 'action-helper' | |
| const TOGGLE_PLAYING_STATE = 'TOGGLE_PLAYING_STATE' | |
| const SET_CURRENT_TIME = 'SET_CURRENT_TIME' | |
| const SET_DURATION = 'SET_DURATION' | |
| const SET_VOLUME = 'SET_VOLUME' | |
| const initialState = { | |
| playing: false, |
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
| {% assign account_page_title = 'Addresses' %} | |
| {% include 'account-titles' %} | |
| {% paginate customer.addresses by 10 %} | |
| <section class="outer mv2 pt1"> | |
| <div class="container--s mha"> | |
| <div class="relative mv1 mb2"> | |
| <button class="new-address button" onclick="barrel.toggleNewForm()">New Address +</button> |
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 { renderToString } from 'react-dom/server' | |
| import parser from './shortcode-parser' | |
| export const add = parser.add | |
| const Aside = ({ children, config }) => { | |
| /** | |
| * config = { | |
| * foo: true, |
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
| input[type="checkbox"], | |
| input[type="radio"] { | |
| border: 1px solid var(--cb); | |
| vertical-align: middle; | |
| &:checked{ | |
| background-color: var(--c1); | |
| border-color: var(--c1); | |
| } | |
| &:focus{ |
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
| .select-wrapper { | |
| position: relative; | |
| display: inline-block; | |
| &:after { | |
| position: absolute; | |
| content: '\25bc'; | |
| top: calc(50% - 0.7em); | |
| right: 1em; | |
| font-size: 0.6em; |