import * as React from 'react'; import * as css from 'styled-jsx/css'; import flushToReact, { flushToHTML } from 'styled-jsx/server'; const styled = (
); const styledGlobal = (
); const buttonColor = 'red'; const separatedCSS = css`button { color: ${buttonColor}; }`; const withSeparatedCSS = (
); const globalCSS = css.global`body { margin: 0; }`; const withGlobalCSS = (
); const resolvedCSS = css.resolve`a { color: green; }`; const withResolvedCSS = (
{resolvedCSS.styles}
); const dynamicResolvedCSS = css.resolve`a { color: ${buttonColor}; }`; const withDynamicResolvedCSS = (
{dynamicResolvedCSS.styles}
); const stylesChildren = flushToReact(); const jsxToRender = ( { stylesChildren } ); const stylesAsString: string = flushToHTML(); const html = ` ${stylesAsString} `;