Fix Themes v3 not working on Safari
This commit is contained in:
parent
e33734b474
commit
dc37c7b28b
5 changed files with 62 additions and 20 deletions
|
|
@ -1,3 +1,5 @@
|
|||
import { sortBy } from 'lodash'
|
||||
|
||||
// "Unrolls" a tree structure of item: { parent: { ...item2, parent: { ...item3, parent: {...} } }}
|
||||
// into an array [item2, item3] for iterating
|
||||
export const unroll = (item) => {
|
||||
|
|
@ -24,7 +26,7 @@ export const getAllPossibleCombinations = (array) => {
|
|||
})
|
||||
const flatCombos = newCombos.reduce((acc, x) => [...acc, ...x], [])
|
||||
const uniqueComboStrings = new Set()
|
||||
const uniqueCombos = flatCombos.map(x => x.toSorted()).filter(x => {
|
||||
const uniqueCombos = flatCombos.map(sortBy).filter(x => {
|
||||
if (uniqueComboStrings.has(x.join())) {
|
||||
return false
|
||||
} else {
|
||||
|
|
@ -64,7 +66,7 @@ export const genericRuleToSelector = components => (rule, ignoreOutOfTreeSelecto
|
|||
}
|
||||
|
||||
const selectors = [realSelector, applicableVariant, ...applicableStates]
|
||||
.toSorted((a, b) => {
|
||||
.sort((a, b) => {
|
||||
if (a.startsWith(':')) return 1
|
||||
if (/^[a-z]/.exec(a)) return -1
|
||||
else return 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue