Skip to content

Conversation

@dg
Copy link
Member

@dg dg commented Jan 13, 2017

All Tracy CSS rules are !important, so they cannot be rewriten by styles css of website.

@JanTvrdik
Copy link
Contributor

I'm afraid that this is going to break a lot of stuff.

@dg
Copy link
Member Author

dg commented Jan 13, 2017

It should not… Anyway it is targeted to the next bigger release.

@vlastavesely
Copy link
Contributor

With panels I use, it seems to be OK. But also I think that many panels that use a lot of CSS would have serious problems after this change. For example, for the guy who commented my last PR it could be very problematic. But, as I said in my PR, I think this is not primarily problem of Tracy but the third-party libraries integrated into it.

Please consider to reset text-transform also. I it is not uncommon that H1 are set to text-transform: uppercase; and it was first thing that I tried to test with your proposed changes.

@dg
Copy link
Member Author

dg commented Jan 13, 2017

It automatically appends !important to every included CSS, so the most of panels should work. Some will have to be modified, it is BC break.

Yes, it completely breaks injection of web styles to Tracy, but it's purpose.

@dg
Copy link
Member Author

dg commented Jan 13, 2017

@vlastavesely done ec3380b

@dg dg force-pushed the master branch 3 times, most recently from a6e9626 to 6d9d48a Compare January 15, 2017 02:59
@dg dg force-pushed the important branch 2 times, most recently from c23b071 to 28b7018 Compare January 15, 2017 13:34
@adrianbj
Copy link
Contributor

For example, for the guy who commented my last PR it could be very problematic.

Being that guy :) I can say that I agree that this is very problematic.

I have been playing around with this PR and it looks like it makes it impossible to style any custom panels using an external stylesheet. This is something I do with many of my panels. Now the only way to override the !important is to use inline styles also with an important.

I know I keep harping on it, but changing #tracy-debug * { to #tracy-debug-bar * { makes a huge difference. With the current master of Tracy with this change I can do as much manipulation of panels as I need. While there is still the possibility of styles from the site overriding those in Tracy, I have managed to get around these by re-defining the styles for everything within Tracy (my own stylesheet that I inject) and making them !important. It's taken a while to get everything taken care of, but I am pretty happy now that the Tracy debug bar will look the same on all sites.

@dg
Copy link
Member Author

dg commented Jan 18, 2017

The problem is that Tracy (panels and bar) must not be accidentally affected by website CSS style.

The only way to prevent that (until browsers will support revert) is to reset all important CSS properites. For bar, for panels. This PR resets them in very hard way.

On the other side, there is need to create custom styles for custom panels. It is absolutely easy. You just need to add #tracy-debug before all selectors (or even better #tracy-debug .your-panel-class). It can be easily done for 3rd party styles with CSS preprocessor, for example with LESS:

#tracy-debug {
	@import (less) 'library.css';
}

This PR would make custom styles only slightly harder, it requires in addition to add !important for every properties. It can be done with regexp preg_replace('#(?<!!important);#', '!important;', $css).

@dg dg force-pushed the master branch 4 times, most recently from 8d1f977 to 2f4a70d Compare February 10, 2017 13:39
@dg dg force-pushed the master branch 3 times, most recently from 2ec5e86 to 52b29ea Compare April 4, 2017 13:19
@dg dg force-pushed the master branch 3 times, most recently from af1e9ce to 66c5d00 Compare June 22, 2017 10:35
@dg dg force-pushed the master branch 10 times, most recently from 342ef20 to 6d06dc1 Compare May 24, 2020 23:32
@dg dg force-pushed the master branch 8 times, most recently from 55360f2 to 867c2b6 Compare October 13, 2020 21:03
@dg dg force-pushed the master branch 7 times, most recently from a2951f1 to 1116024 Compare October 14, 2020 18:45
@dg dg closed this Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants