packages/ui-themeable/src/scopeStylesToNode.js
function scopeCssText (cssText, scope) {
  return transformCss(cssText, (rule) => {
    const transformed = {...rule}
    if (!rule.isScoped) {
      transformed.selector = scopeRule(rule, scope)
      transformed.isScoped = true
    }
    return transformed
  })
}
function scopeCssText (cssText, scope) {
  return transformCss(cssText, (rule) => {
    const transformed = {...rule}
    if (!rule.isScoped) {
      transformed.selector = scopeRule(rule, scope)
      transformed.isScoped = true
    }
    return transformed
  })
}
function scopeCssText ( cssText , scope ) { return transformCss ( cssText , ( rule ) => { const transformed = { ... rule } if ( ! rule . isScoped ) { transformed . selector = scopeRule ( rule , scope ) transformed . isScoped = true } return transformed } ) }
Transforms a CSS string to add a scoping selector to each rule
@param {String} cssText
@param {String} scope a unique identifier to use to scope the styles
Transforms a CSS string to add a scoping selector to each rule