mirror of
https://github.com/unraid/api.git
synced 2026-01-25 18:08:43 -06:00
@@ -35,8 +35,7 @@ const DEFAULT_INCLUDE_ROOT = true;
|
||||
|
||||
const KEYFRAME_AT_RULES = new Set(['keyframes']);
|
||||
const NON_SCOPED_AT_RULES = new Set(['font-face', 'page']);
|
||||
const MERGE_WITH_SCOPE_PATTERNS: RegExp[] = [/^\.theme-/, /^\.has-custom-/, /^\.dark\b/, /^\.light\b/];
|
||||
const ROOT_ELEMENT_PATTERN = /^(html|body)(?=$|[.#[:\s>+~])/;
|
||||
const MERGE_WITH_SCOPE_PATTERNS: RegExp[] = [/^\.theme-/, /^\.has-custom-/, /^\.dark\b/];
|
||||
|
||||
function shouldScopeRule(rule: Rule, targetLayers: Set<string>, includeRootRules: boolean): boolean {
|
||||
const hasSelectorString = typeof rule.selector === 'string' && rule.selector.length > 0;
|
||||
@@ -105,12 +104,6 @@ function prefixSelector(selector: string, scope: string): string {
|
||||
return trimmed;
|
||||
}
|
||||
|
||||
const rootElementMatch = trimmed.match(ROOT_ELEMENT_PATTERN);
|
||||
if (rootElementMatch) {
|
||||
const suffix = trimmed.slice(rootElementMatch[0].length);
|
||||
return suffix ? `${scope}${suffix}` : scope;
|
||||
}
|
||||
|
||||
if (trimmed === ':root') {
|
||||
return scope;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user