@@ -43,6 +43,7 @@ protected function generatePrimaryVariables(string $colorMainBackground, string
4343 $ colorPrimaryElement = $ this ->util ->elementColor ($ this ->primaryColor , $ isBrightColor , $ colorMainBackground );
4444 $ colorPrimaryLight = $ this ->util ->mix ($ colorPrimaryElement , $ colorMainBackground , -80 );
4545 $ colorPrimaryElementLight = $ this ->util ->mix ($ colorPrimaryElement , $ colorMainBackground , -80 );
46+ $ invertPrimaryTextColor = $ this ->util ->invertTextColor ($ colorPrimaryElement );
4647
4748 // primary related colours
4849 return [
@@ -66,10 +67,10 @@ protected function generatePrimaryVariables(string $colorMainBackground, string
6667
6768 // used for buttons, inputs...
6869 '--color-primary-element ' => $ colorPrimaryElement ,
69- '--color-primary-element-hover ' => $ this ->util ->mix ($ colorPrimaryElement , $ colorMainBackground , 87 ),
70- '--color-primary-element-text ' => $ this -> util -> invertTextColor ( $ colorPrimaryElement ) ? '#000000 ' : '#ffffff ' ,
70+ '--color-primary-element-hover ' => $ invertPrimaryTextColor ? $ this ->util ->lighten ($ colorPrimaryElement , 4 ) : $ this -> util -> darken ( $ colorPrimaryElement , 4 ),
71+ '--color-primary-element-text ' => $ invertPrimaryTextColor ? '#000000 ' : '#ffffff ' ,
7172 // mostly used for disabled states
72- '--color-primary-element-text-dark ' => $ this ->util ->darken ( $ this ->util ->invertTextColor ( $ colorPrimaryElement ) ? ' #000000 ' : ' # ffffff ' , 6 ),
73+ '--color-primary-element-text-dark ' => $ invertPrimaryTextColor ? $ this ->util ->lighten ( ' #000000 ' , 4 ) : $ this ->util ->darken ( ' # ffffff ' , 4 ),
7374
7475 // used for hover/focus states
7576 '--color-primary-element-light ' => $ colorPrimaryElementLight ,
0 commit comments