首页 > 代码库 > [TypeStyle] Load raw CSS in TypeStyle

[TypeStyle] Load raw CSS in TypeStyle

TypeStyle tries to be an all in one CSS in JS management solution so you can always fall back to raw CSS if you ever need to migrate old code quickly. This lesson will demonstrate how to use the cssRaw function along with the real world use case of CSS resets e.g. normalize.css.

 

import {cssRaw} from ‘typestyle‘;import * as React from ‘react‘;import * as ReactDOM from ‘react-dom‘;cssRaw(`    body {        font-size: 1.5em;        font-weight: bold;        background-color: black;        color: gold    }`);const App = () => (    <div>        Hello World!    </div>);ReactDOM.render(    <App />,    document.getElementById(‘root‘));

 

[TypeStyle] Load raw CSS in TypeStyle