mirror of
https://github.com/emotion-js/emotion.git
synced 2026-01-18 16:12:33 +00:00
* Update Preconstruct and use import conditions * remove is-development redundant conditions * is-browser condition * default is-browser to a runtime check * remove top-level browser fields * remove top-level browser entries from extra entrypoints * remove yet another top-level browser field from an entrypoint * remove yet another top-level browser field from an entrypoint * use modern moduleResolution * fixes site config * add paths to handle older ts versions in type tests * fix dtslint, hopefully * use development condiiton by default in tests * try to run without the browser condition * add prod tests * fix gate types * hijack insertedRules * changesets
29 lines
552 B
JavaScript
29 lines
552 B
JavaScript
import prettify from '@emotion/css-prettifier'
|
|
|
|
/*
|
|
type StyleSheet = {
|
|
tags: Array<HTMLStyleElement>
|
|
}
|
|
*/
|
|
|
|
export default {
|
|
test: val => val && val.tags !== undefined && Array.isArray(val.tags),
|
|
serialize(
|
|
val /* : StyleSheet */,
|
|
config,
|
|
indentation /* : string */,
|
|
depth /* : number */,
|
|
refs,
|
|
printer /* : Function */
|
|
) {
|
|
let styles = val.tags.map(tag => tag.textContent || '').join('')
|
|
return printer(
|
|
prettify(styles, config.indent),
|
|
config,
|
|
indentation,
|
|
depth,
|
|
refs
|
|
)
|
|
}
|
|
}
|