mirror of
https://github.com/zhigang1992/nativewind.git
synced 2026-06-15 10:17:54 +08:00
fix: remove regex negative lookbehind for safari compatibility (#72)
* fix: remove regex negative lookbehind for safari compatibility * fix: remove regex negative lookbehind for safari compatibility Co-authored-by: Mark Lawlor <mwlawlor@gmail.com>
This commit is contained in:
@@ -76,9 +76,9 @@ function getStyles(
|
||||
// We cannot just test for `:active` as it will match hover\\:active-foobar:hover
|
||||
// Due to how classNames are escaped, we can just check for :active and ensure
|
||||
// it doesn't have an escape character before it.
|
||||
if (/(?<!\\):active/.test(cssRule.selectorText)) states.push(active);
|
||||
if (/(?<!\\):focus/.test(cssRule.selectorText)) states.push(focus);
|
||||
if (/(?<!\\):hover/.test(cssRule.selectorText)) states.push(hover);
|
||||
if (/[^\\]:active/.test(cssRule.selectorText)) states.push(active);
|
||||
if (/[^\\]:focus/.test(cssRule.selectorText)) states.push(focus);
|
||||
if (/[^\\]:hover/.test(cssRule.selectorText)) states.push(hover);
|
||||
|
||||
return states.every(Boolean);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user