Skip to content

Commit

Permalink
fix: improve :where supports check
Browse files Browse the repository at this point in the history
Newer Firefox's have :where support but the specific check used returns
false. Changing the check to be `CSS.supports('selector(:where(div))')`
makes it return `true` in Firefox and makes the polyfill work there
without needing the :where fallback.

Fixes GoogleChromeLabs#64
  • Loading branch information
gkatsev committed Oct 25, 2022
1 parent 113108c commit c235969
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const CUSTOM_UNIT_MAP: Record<string, string> = {
cqb: CUSTOM_UNIT_VARIABLE_CQB,
};

const SUPPORTS_WHERE_PSEUDO_CLASS = CSS.supports('selector(:where())');
const SUPPORTS_WHERE_PSEUDO_CLASS = CSS.supports('selector(:where(div))');
const NO_WHERE_SELECTOR = ':not(.container-query-polyfill)';
const NO_WHERE_SELECTOR_TOKENS = parseComponentValue(
Array.from(tokenize(NO_WHERE_SELECTOR))
Expand Down

0 comments on commit c235969

Please sign in to comment.