nette / tracy

😎 Tracy: the addictive tool to ease debugging PHP code for cool developers. Friendly design, logging, profiler, advanced features like debugging AJAX calls or CLI support. You will love it.
https://tracy.nette.org
Other
1.75k stars 218 forks source link

CSS styles in Tracy #534

Open darkWolf-PR opened 2 years ago

darkWolf-PR commented 2 years ago

Version: 2.9.1

Bug Description

Hi, after upgrade from 2.8.9 to 2.9.1, Tracy´s CSS is getting overriden by CSS from my web app. Not sure, what actually happened, but with 2.8.9, everything was OK, now, I´m getting white texts (and other stuff like active elements) in every panel but System info. It´s taking white text color from my dark admin theme.

Steps To Reproduce

I can make screenshots, but these overrides Tracy´s text color in Router or variable names in dump panel:

.mod-skin-dark:not(.mod-skin-light) code { background: rgba(0, 0, 0, 0.3); color: #ffffff; } .mod-skin-dark:not(.mod-skin-light) pre { color: #ffffff; }

...

Css is normally linked in header(). It´s from large admin design template, it has color switcher for light/dark version.

Expected Behavior

Previous behaviour I guess. It should not be possible to override Tracy´s css from web´s css.

dg commented 2 years ago

The specificity of CSS styles has changed in Tracy 2.9. It used to actively turn off and overwrite other styles, but it is not doing it as strong now. So the intention is to give user styles the chance to "infiltrate" Tracy (see issue #533)

Unwanted styles can affect Tracy, when is class added to <html> or <body> elements (System info panel should be placed in html > body > tracy-div > div > div.tracy-panel). Which is probably the case here.

I'll try to think of a solution.