1.1.0 • Published 6 years ago

scrs v1.1.0

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

scrs

styled-components render static

npm i -g scrs

CLI

// App.js
import React from 'react'
import styled from 'styled-components'

const Heading = styled.h1`
  color: tomato;
`

export default props => (
  <React.Fragment>
    <head>
      {props.styles}
    </head>
    <Heading>
      Hello
    </Heading>
  </React.Fragment>
)
scrs App.js > index.html

Node API

const React = require('react')
const scrs = require('scrs')
const App = require('./App')

const html = scrs(props => (
  React.createElement(App, props)
))

Options

  • --svg (boolean) use SVG doctype instead of HTML

MIT License