Skip to content

Instantly share code, notes, and snippets.

View hello.md

Hello

This is a gist on GitHub

View _backup.js
import React, { useContext } from 'react'
import { ThemeProvider } from 'emotion-theming'
import { MDXProvider } from '@mdx-js/tag'
import styled from '@emotion/styled'
import merge from 'lodash.merge'
// defaults
const baseTheme = {
colors: {
text: '#345',
@jxnblk
jxnblk / Pattern.js
Created Feb 26, 2019
generative svg pattern
View Pattern.js
import React from 'react'
// Generative SVG patterns
const rand = (max = 128, min = 0) => Math.floor(Math.random() * (max - min) + min)
const diamond = [
4, 0,
8, 4,
4, 8,
0, 4
View index.js
import React from 'react'
export default class ServerStyled extends React.Component {
constructor (props) {
super(props)
const isServer = typeof document === 'undefined'
if (!isServer) return
const { ServerStyleSheet } = require('styled-components')
const { renderToString } = require('react-dom/server')
View index.js
import React from 'react'
import styled, { ThemeProvider } from 'styled-components'
export const Base = ({
value,
children,
...props
}) =>
<React.Fragment>
{React.Children.toArray(children)
View index.js
// Demo for using styled-system variants for button styles
// and mapping props for size
import React from 'react'
import styled from 'styled-components'
import {
color,
space,
fontSize,
buttonStyle,
} from 'styled-system'
View index.js
import React from 'react'
import System from 'system-components/dist/System'
import styled from 'react-emotion'
const sys = new System({
createComponent: type => (...styles) => styled(type)(...styles)
})
const Heading = sys({
fontSize: 5,
View -
diff --git a/src/bunnies.examples.js b/src/bunnies.examples.js
index f8a9f55..992637a 100644
--- a/src/bunnies.examples.js
+++ b/src/bunnies.examples.js
@@ -1,3 +1,3 @@
import {bunnies} from './bunnies'
-export const capitalBunnies = bunnies.map(b => b.toUpperCase())
+export const capitalBunnies = bunnies.map(b => 'boop, ' + b.toUpperCase())
diff --git a/src/index.js b/src/index.js
View -
diff --git a/src/bunnies.examples.js b/src/bunnies.examples.js
index f8a9f55..e03c5b3 100644
--- a/src/bunnies.examples.js
+++ b/src/bunnies.examples.js
@@ -1,3 +1,3 @@
import {bunnies} from './bunnies'
-export const capitalBunnies = bunnies.map(b => b.toUpperCase())
+export const capitalBunnies = bunnies.map(b => 'hello, ' + b.toUpperCase())
diff --git a/src/index.js b/src/index.js
View plugin.js
const React = require('react')
const visit = require('unist-util-visit')
const toHAST = require('mdast-util-to-hast')
const toH = require('hast-to-hyperscript')
const babel = require('babel-core')
const frontmatter = require('remark-frontmatter')
const yaml = require('js-yaml')
const util = require('util')