Fix Themes v3 not working on Safari

This commit is contained in:
tusooa 2024-05-31 14:33:44 -04:00
commit dc37c7b28b
No known key found for this signature in database
GPG key ID: ED5657F8FEDDA66C
5 changed files with 62 additions and 20 deletions

View file

@ -1,6 +1,6 @@
import { convert, brightness } from 'chromatism'
import sum from 'hash-sum'
import { flattenDeep } from 'lodash'
import { flattenDeep, sortBy } from 'lodash'
import {
alphaBlend,
getTextColor,
@ -226,7 +226,7 @@ export const init = (extraRuleset, ultimateBackgroundColor) => {
combination.variant === 'normal'
? ''
: combination.variant[0].toUpperCase() + combination.variant.slice(1).toLowerCase(),
...combination.state.filter(x => x !== 'normal').toSorted().map(state => state[0].toUpperCase() + state.slice(1).toLowerCase())
...sortBy(combination.state.filter(x => x !== 'normal')).map(state => state[0].toUpperCase() + state.slice(1).toLowerCase())
].join('')
let inheritedTextColor = computedDirectives.textColor