mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-01-31 22:17:30 +00:00
Update styled-jsx/css typings, add tests for methods css.global and css.resolve
This commit is contained in:
parent
87e310cfca
commit
1a092b0b22
@ -26,6 +26,29 @@ const withSeparatedCSS = (
|
||||
</div>
|
||||
);
|
||||
|
||||
const globalCSS = css.global`body { margin: 0; }`;
|
||||
const withGlobalCSS = (
|
||||
<div>
|
||||
<style jsx global>{globalCSS}</style>
|
||||
</div>
|
||||
);
|
||||
|
||||
const resolvedCSS = css.resolve`a { color: green; }`;
|
||||
const withResolvedCSS = (
|
||||
<div>
|
||||
<button className={resolvedCSS.className}>About</button>
|
||||
{resolvedCSS.styles}
|
||||
</div>
|
||||
);
|
||||
|
||||
const dynamicResolvedCSS = css.resolve`a { color: ${buttonColor}; }`;
|
||||
const withDynamicResolvedCSS = (
|
||||
<div>
|
||||
<button className={dynamicResolvedCSS.className}>About</button>
|
||||
{dynamicResolvedCSS.styles}
|
||||
</div>
|
||||
);
|
||||
|
||||
const stylesChildren = flushToReact();
|
||||
const jsxToRender = (
|
||||
<head>{ stylesChildren }</head>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user