@@ -64,10 +64,10 @@ protected static function registerDefaultStyles(ConsoleOutput $output): void
6464 $ f = $ output ->getFormatter ();
6565
6666 $ styles = [
67- // existing
68- 'success ' => ['bright-green ' , null , [' bold ' ]],
69- 'error ' => ['bright- red ' , null , ['bold ' ]],
70- 'info ' => ['bright-cyan ' , null , [' bold ' ]],
67+ // existing (headers use white text on colored background)
68+ 'success ' => ['white ' , ' green ' , []],
69+ 'error ' => ['red ' , ' red ' , ['bold ' ]],
70+ 'info ' => ['white ' , ' cyan ' , []],
7171
7272 // extras
7373 'yellow ' => ['yellow ' , null , ['bold ' ]],
@@ -85,7 +85,10 @@ protected static function registerDefaultStyles(ConsoleOutput $output): void
8585 ];
8686
8787 foreach ($ styles as $ name => [$ fg , $ bg , $ opts ]) {
88- if (!$ f ->hasStyle ($ name )) {
88+ // Force override for listed headers use white text on background.
89+ // Keep existing built-in styles (e.g., <error>) unless we need to change them.
90+ $ shouldSet = in_array ($ name , ['info ' , 'success ' , 'error ' ], true ) ? true : !$ f ->hasStyle ($ name );
91+ if ($ shouldSet ) {
8992 $ f ->setStyle ($ name , new OutputFormatterStyle ($ fg , $ bg , $ opts ));
9093 }
9194 }
0 commit comments