This repository has been archived by the owner on Jul 4, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
697 additions
and
124 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from 'react' | ||
import Container from './Container' | ||
import Subhead from './Subhead' | ||
import Lead from './Lead' | ||
|
||
const About = props => ( | ||
<section> | ||
<Container py4> | ||
<Subhead my3>About</Subhead> | ||
<Lead children={copy} /> | ||
</Container> | ||
</section> | ||
) | ||
|
||
const copy = `Superstyle is an experimental CSS-in-JS utility | ||
library that uses CSSOM to patch updates to styles after injection. | ||
Using plain JavaScript objects to author styles, superstyle | ||
helps promote style encapsulation while making use of native | ||
browser CSS APIs. | ||
` | ||
|
||
export default About |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import superstyle from 'superstyle/react' | ||
|
||
const Banner = superstyle({ | ||
minHeight: '70vh', | ||
color: 'white', | ||
backgroundColor: 'var(--beta)', | ||
backgroundSize: 'cover', | ||
backgroundPosition: 'center center', | ||
// backgroundPosition: '20vw center', | ||
backgroundBlendMode: 'screen', | ||
transitionProperty: 'background-color, background-image', | ||
transitionDuration: '.5s', | ||
transitionTimingFunction: 'ease-out', | ||
})('header') | ||
|
||
export default Banner |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
import superstyle from 'superstyle/react' | ||
import hoc from './style-hoc' | ||
|
||
const Box = superstyle()('div') | ||
export default Box | ||
|
||
export default hoc(Box) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,42 @@ | ||
import superstyle from 'superstyle/react' | ||
import hoc from './style-hoc' | ||
import { darken } from './colors' | ||
|
||
const darken = n => `rgba(0,0,0,${n})` | ||
const Button = superstyle({ | ||
display: 'inline-flex', | ||
fontFamily: 'inherit', | ||
fontSize: 14, | ||
fontWeight: 'bold', | ||
textDecoration: 'none', | ||
textTransform: 'uppercase', | ||
letterSpacing: '0.3em', | ||
margin: 0, | ||
padding: 16, | ||
paddingTop: 12, | ||
paddingBottom: 12, | ||
paddingLeft: 24, | ||
paddingRight: 24, | ||
color: 'white', | ||
// backgroundColor: darken(3/8), | ||
backgroundColor: 'var(--color-b)', | ||
backgroundColor: 'var(--beta)', | ||
border: 0, | ||
borderRadius: 4, | ||
backgroundBlendMode: 'multiply', | ||
borderRadius: 2, | ||
backgroundBlendMode: 'overlay', | ||
opacity: 7/8, | ||
boxShadow: `0 0 64px ${darken(1/4)}`, | ||
|
||
':hover': { | ||
// backgroundColor: darken(5/8) | ||
opacity: 1, | ||
boxShadow: `0 0 64px ${darken(1/2)}` // , inset 0 0 0 999px ${darken(1/4)}` | ||
}, | ||
|
||
':focus': { | ||
outline: 'none', | ||
boxShadow: `inset 0 0 2px 0px var(--alpha), 0 0 0 2px var(--beta)`, | ||
opacity: 1, | ||
}, | ||
|
||
':active': { | ||
boxShadow: `inset 0 0 0 999px ${darken(1/2)}` | ||
} | ||
})('button') | ||
})('a') | ||
|
||
export default Button | ||
export default hoc(Button) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,28 @@ | ||
import React from 'react' | ||
import sx, { sheet } from 'superstyle' | ||
import superstyle from 'superstyle/react' | ||
import { css as beautify } from 'js-beautify' | ||
import Container from './Container' | ||
import Subhead from './Subhead' | ||
import Code from './Code' | ||
import Pre from './Pre' | ||
|
||
const Pre = superstyle({ | ||
whiteSpace: 'pre-wrap' | ||
})('pre') | ||
const CSS = props => { | ||
const css = sheet.css | ||
|
||
const CSS = props => ( | ||
<div> | ||
<Pre>{sheet.css}</Pre> | ||
</div> | ||
) | ||
return ( | ||
<Container py4> | ||
<Subhead>CSS for this page</Subhead> | ||
<Code>{css.length} bytes</Code> | ||
<Pre | ||
css={{ | ||
maxHeight: 512, | ||
overflow: 'auto', | ||
}} | ||
children={beautify(css)} | ||
/> | ||
</Container> | ||
) | ||
} | ||
|
||
export default CSS |
Oops, something went wrong.