(cssText: string)
| 432 | * .foo<scopeName> > .bar |
| 433 | */ |
| 434 | private _convertColonHost(cssText: string): string { |
| 435 | return cssText.replace(_cssColonHostRe, (_, hostSelectors: string, otherSelectors: string) => { |
| 436 | if (hostSelectors) { |
| 437 | const parts = [...this._splitOnTopLevelCommas(hostSelectors, true)]; |
| 438 | if (parts.length > 1) { |
| 439 | return ':host(' + hostSelectors + ')' + otherSelectors; |
| 440 | } |
| 441 | const trimmedHostSelector = parts[0].trim(); |
| 442 | if (trimmedHostSelector) { |
| 443 | return ( |
| 444 | _polyfillHostNoCombinator + |
| 445 | trimmedHostSelector.replace(_polyfillHost, '') + |
| 446 | otherSelectors |
| 447 | ); |
| 448 | } |
| 449 | } |
| 450 | return _polyfillHostNoCombinator + otherSelectors; |
| 451 | }); |
| 452 | } |
| 453 | |
| 454 | /** |
| 455 | * Generator function that splits a string on top-level commas (commas that are not inside parentheses). |
no test coverage detected