-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Not wanted Web Profiler Toolbar link color css override #27658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Well, you final selector is the WDT being in your page, CSS rules will indeed impact them. I don't know of a way to isolate the WDT from your page (using an iframe to render the toolbar is likely to break things entirely) |
I'm not a CSS expert, but inline css on the bar would do the tric 8000 k, would not do? 🤔 Or maybe some Maybe my sass code could be better too, but I don't know how to do otherwise. |
But we would also have to reset all styles coming from your CSS (and there are thousands of CSS properties). So inline styles would become huge (and unmaintainable). Thus, inline CSS styles are as ugly as
First step to reduce the specificity would be to use another idea could be to apply |
Could https://www.w3schools.com/cssref/css3_pr_all.asp help? |
no, because the more specific rule would still allow setting the color on the button over WDT styles resetting with |
@stof I will try your two suggestion and give a feedback, thanks.
Nah, I'm perturbed with that. 😜 |
could it be related to the fact WDT styling is applied on class level, opposed to id. The latter seems to have higher precedence. |
Good catch @ro0NL! It seems to be indeed better to rely on an id. |
For my case, using Links under boxes are blue again, but the underline effect on hover is still present on link under the I made things simpler by adding an id on my first layout div: I let the issue open. I think the @ro0NL's case is interesting to give a try. 👍 Feel free to close if you think nothing more have to be done here. |
The thing we could try is to apply |
TLDR: Do you think it is worth using a css reset for the debug profiler bar? I already used the But it also reset a lot of css default rules, like // Full reset styles
& {
all: initial;
* {
all: unset;
}
}
// Normalize
*, ::before, ::after {
box-sizing: content-box;
}
h1, h2, h3, h4, h5, h6, div, header, footer {
display: block;
}
input[type="button"], button {
box-sizing: border-box;
}
input[type="radio"] {
appearance: radio;
-moz-appearance: radio;
-webkit-appearance: radio;
display: inline-block;
}
footer {
padding: 0;
}
a {
cursor: pointer;
} This code is actually used in a website with a lot of visits. I use this to fully isolate css of a plugin that displays popins on many websites, and prevent websites which are displaying popins "break" popins style with their css rules. It works well but IMHO, it is a big thing for something that impacts someting in dev environment only. For your use case, you could avoid adding a class on <body>
<main class="logon">
</main>
</body> With the css rule Do you think it is worth using a css reset for the debug profiler bar? |
Assuming that links color can be too easily overriden by application css, this PR set a stronger precedence for links css only. #27758 |
…y css (alcalyn) This PR was merged into the 2.8 branch. Discussion ---------- [WebProfilerBundle] Prevent toolbar links color override by css | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #27658 | License | MIT | Doc PR | Fixes this issue: #27658 (comment) Links color in toolbar can be easily override by application css. As this could happens sometimes, this PR set links color with a stronger CSS precedence. Commits ------- e12e217 Prevent toolbar links color override by css
I'm sorry, but I still have the issue with a:not(.btn):not(.close):not([data-dt-idx]):not(.page-link), button:not(.btn):not(.close) {
color: #2f333d;
-webkit-text-decoration: underline dotted #e14a4b;
text-decoration: underline dotted #e14a4b;
transition: all 0.3s ease-in-out;
} The color is also overriding the link on sub-content like ajax list. |
Symfony version(s) affected: v4.0.11
Description
If I put some CSS rules with a body classes, it will apply on the web profiler toolbar.
How to reproduce
And create a template with
<body class="logon">
You will have something like this:
I'm pretty sure it's related to the body class case, because I have another global color definition for
a
links and it does not affect the toolbar.The text was updated successfully, but these errors were encountered: