/// /// import * as React from "react"; import { StyleSheet, css, StyleSheetServer, StyleSheetTestUtils } from "aphrodite"; const styles = StyleSheet.create({ red: { backgroundColor: 'red' }, blue: { backgroundColor: 'blue' }, hover: { ':hover': { backgroundColor: 'red' } }, small: { '@media (max-width: 600px)': { backgroundColor: 'red', } } }); const coolFont = { fontFamily: "CoolFont", fontStyle: "normal", fontWeight: "normal", src: "url('coolfont.woff2') format('woff2')" }; const withFont = StyleSheet.create({ headingText: { fontFamily: coolFont, fontSize: 20 }, bodyText: { fontFamily: [coolFont, "sans-serif"], fontSize: 12 } }); class App extends React.Component<{}, {}> { render() { return
This is red. This turns red on hover. This turns red when the browser is less than 600px width. This is blue. This is blue and turns red when the browser is less than 600px width. With font
; } } const output = StyleSheetServer.renderStatic(() => { return "test"; }); output.css.content; output.css.renderedClassNames; output.html; StyleSheet.rehydrate(output.css.renderedClassNames); StyleSheetTestUtils.suppressStyleInjection(); StyleSheetTestUtils.clearBufferAndResumeStyleInjection();