diff --git a/pkg/twmerge/modifier-utils.go b/pkg/twmerge/modifier-utils.go index 315eabf..884799b 100644 --- a/pkg/twmerge/modifier-utils.go +++ b/pkg/twmerge/modifier-utils.go @@ -46,6 +46,11 @@ func MakeSplitModifiers(conf *TwMergeConfig) SplitModifiersFn { baseClass = baseClassWithImportant } + // fix case where there is modifier & maybePostfix which causes maybePostfix to be beyond size of baseClass + if maybePostfixModPosition != -1 && maybePostfixModPosition > modifierStart { + maybePostfixModPosition -= modifierStart + } + return baseClass, modifiers, hasImportant, maybePostfixModPosition }