Interesting. Yes indeed i forced switched to darkmode. I had this problem with rendering the code view for light mode but i thought i fixed it.
Ok yes found it. So in the code_panel i check for darkmode but in the main theme i force swichtched to darkmode. Unfortunately in material3 you can not detect anymore if the current theme is in darkmode or not.