Skip to content

Commit

Permalink
fix: now rule name gets updates when a default rule is replaced
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenny1291 committed Feb 5, 2024
1 parent 4f97904 commit de8ee21
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion utils/defaultRulesUpdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ function composeNewCSSRulesArray(currentCSSRules, oldRulesIndexAndNewRulesUUID,
*/
export function replaceRules(oldRulesIndexAndNewRulesUUID, currentCSSRule, newDefaultRules) {
for (const oldRuleIndexAndNewRuleUUID of oldRulesIndexAndNewRulesUUID) {
currentCSSRule[oldRuleIndexAndNewRuleUUID.oldRuleIndex].rule = newDefaultRules[oldRuleIndexAndNewRuleUUID.newRuleUUID]
const newRule = newDefaultRules[oldRuleIndexAndNewRuleUUID.newRuleUUID]
currentCSSRule[oldRuleIndexAndNewRuleUUID.oldRuleIndex].rule = newRule
const newName = getRuleName(newRule)
currentCSSRule[oldRuleIndexAndNewRuleUUID.oldRuleIndex].name = newName
}
}

Expand Down

0 comments on commit de8ee21

Please sign in to comment.