Firefox extension to display inheritance from browser defaults? - html

There are times when looking at a computed style in Firebug, it's not evident how a value is computed or what its origins are. In some situations, the source is the browser's default. In web sites that are already constructed, it's not feasible to inject a css reset which will result in breaking all the pages.
Is there a way in Firebug, Web Developer or another extension to display an inheritance structure all the way to the browser's default including displaying the value of the default?

Click on the down arrow on the Style tab in the right panel of Firebug. Uncheck "Show Computed Style" and check "Show User Agent CSS".
The blue filename next to each selector is the CSS file where the selector is defined. The Firefox default CSS file is called html.css and its location (when you hover over it) is resource://gre/res/html.css, that's how you know it is the browser default.

Turn off Show Computed Style.
It then breaks it down by declarations and classes and Browser Defaults. It is that little arrow when you hover over Style.
Also, Turn on 'Show User Agent CSS'.

Related

How to inspect the CSS file in Angular 5 or line to change CSS if we want any CSS?

I am making project in Angular 5. When I inspect the CSS there is tag. If we want to change or find out that CSS is coming from which file basically or which line number of that file (like we do in normal html page). How can I find it?
With angular, the CSS is injected straight into the html page during compilation.
Therefor it's not possible to see where the CSS came from with the DevTools.
However, it is possible to see the CSS styles applied to an element, if you want to find out which file it came from, you will have to search the project.(ctrl+shift+f)
If you're using Google Chrome, you can use the developer console. Safari has a similar interface, but I'm not as familiar with that.
To access the developer console on Chrome, use keys Cmd-Option-I and you should see a console pop up on the right of your browser window. Next, if it isn't already selected, select the Elements tab at the top. You should now see the html that your browser rendered into the site.
Next, you'll want to select the element you want to inspect. You can either do this by accessing the nested HTML structure directly, or if you select the mouse icon at the top left of the window, you can select an element on the webpage and it will be expanded in the developer console.
Once you've selected an element (it should be grey/blue highlighted), you can see its styling at the bottom of your tab. The styling is in decreasing hierarchy order: the top elements override the bottom ones. You can see the styling is grouped based off of the id/class that it is applied to and at the top of each section is the file line of from which the styling came. Click that link to see the file!

What is making Radio button blue vs grey

When I visit many webpages I noticed that the standard radio button is blue when selected like this:
As far as I can tell there is no css changing the look of the radio button to be blue. However When I make a very standard html page it looks like this:
What am I missing exactly? Is it an external library causing the buttons to show blue?
this is the standard radio button code:
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<input type="radio" name="color"> Grey
</body>
</html>
I am using chrome version 65 to check
Styling for these elements is is primarily controlled by the OS/browser, and overrides are not universal across all browsers. From MDN:
By default, radio buttons (and checkboxes) are styled with the operating system's native styles for those controls. By specifying appearance: none, you can remove the native styling altogether, and create your own styles for them.
The rest of this article gives an example of how to style a radio element using the appearance: none CSS rule.
I have the same problem,and I found this from google and solved this problem:
Starting in M81, the standard form control elements (e.g. , , ) were given a refreshed look and feel, with improved accessibility and better platform uniformity. This policy restores the old "legacy" form control elements until M84.
If this policy is set to True, the "legacy" form control elements will be used for all sites.
If this policy is set to False or not set, the form control elements will be enabled as they are launched in M81, M82, and M83.
This policy will be removed after Chrome 84.
from:
https://cloud.google.com/docs/chrome-enterprise/policies/?policy=UseLegacyFormControls
We use UiPath for UI automation and ran into this same problem in Chrome after recent browser updates. It seems Google changed the default CSS for these inputs in Chrome v83.x plus.
If you would like to change the Chrome browser back to the default gray CSS you can change this new setting in the chrome://flags menu. We had to do this since we rely on some image-based selectors for our UI automation. It would be nice if Google did not force defaults like this.
Here is the answer I used from the link above:
David Boland 5131 6/16/20
If you must go back to the old (pre v83.x Chrome styling) disable
chrome://flags/#form-controls-refresh (Also called "Web Platform
Controls updated UI").
I wasn't sure what was wrong with my pages just something didn't seem
right. I'm going to have to take pictures of the websites I go to
along with the dates. For me it was an internal LAN gateway config
page that I knew wouldn't be updated with some weird blue color in CSS
because it's a really old box.
It changes checkboxes back to the old grey background with black
checkboxes and gets rid of that weird light blue color everywhere (it
seems even the hyperlinks got a bit lighter with v83).
I found the flag from a reddit thread. Thanks
Here is a screenshot of that setting:

Transition not being captured by subtree & attribute breakpoints Chrome developer tools

I have a webpage on which if a tab key is pressed when in the last textbox a side pane from the right slides(like a side menu).
In chrome development tools I can see it is an aside tag with classes control-sidebar control-sidebar-dark but setting DOM break points(subtree & attribute) on the aside tag is not capturing anything.
On looking into DOM it seems like it is not being manipulated at all(which I expected sliding in should be doing) as I do not see the color blink on HTML tags that chrome developer tool shows for the affected elements.
I was expecting the javascript to be handling the sliding in of the aside tag but how could it be determined in this scenario? Could this be due to CSS only animation or something if yes than how to debug that?
I also tried to record in the animation tab of developer tools but it also stays blank.
This is happening on a privileged section of the site so I m sorry for not being able to put code sample or URL.
PS: The template is some modified version of http://www.ampleadmin.wrappixel.com/ampleadmin-html/ampleadmin-rtl/index.html(the navigation panel on right) but it is getting recorded in dev tool animation panel while mine doesnt.
I found out the cause. There are anchor tags inside the panel which get focused on when the tab is pressed from last textbox. There was no animation,CSS or JS involved.
Anchor(A) tags are focus able by default and the panel dont slide in when they are removed.

Hover and focus in browser inspection

I want to know if there is the possibility, by browser inspection of write a new class containing new hover/focus. For example
.CanIDo {
/*something css
(ex.)*/
width: 100;
}
/*my question (BY BROWSER ISPECTOR, i don't want to type it directly in my css using a text editor)*/
.CanIdo a:hover{
opacity: 0.7;
}
I think this is impossible because browser ispector don't admit to change a class directly, but only the containing of that class (right?), but maybe there are browser that have impove that, I think it can be helpful developing a web site.
Thanks!
If I understand your question, you are asking if you can write CSS "on the fly" in a browser Dev Tool and see the effects immediately on your page?
The short answer is yes. The Dev Tools in Chrome, FireFox, and even the latest IE/Edge browsers have that ability. You can tweak applied styles one by one using a DOM inspector or even wholesale update a CSS file in a Sources tab (the name varies slightly between browsers).
And yes, you can write pseudo-class rules like hover and they'll take effect. You can develop or tweak your code and see the results immediately.
Most browsers have inspect tools that allow you to add any class on the fly.
For instance on Chrome if you open Developer Tools you can add any class to your css, be that a :hover variant or any other normal class, pseudo-class.
What you have to do is open the inspector Cmd + Shift + I on OSx and you'll see this on the Elements tab:
You can see that on the Filter you have a "+" button, clicking that you'd be able to stuff like this:
Those two classes a:hvoer and other-class are added via the inspector as you can see on the right is written: inspector-stylesheet

Inspect HTML5 date picker shadow DOM

I'm trying to inspect the shadow DOM for certain HTML5 controls, like the date picker for the input type="date" and the actual suggestion dropdown list for inputs bound to a datalist. Preferably in Chrome, but other browsers will do too.
I've found that by enabling the Shadow DOM setting in Chrome's inspector options allows me to inspect the shadow DOM for the actual input (which includes the ::-webkit-calendar-picker-indicator arrow to show the datepicker) but not the datepicker itself:
The same goes for the datalist. It appears as these controls are not part of the input, but I also can't find them anywhere else in the elements panel.
Is it possible to inspect such elements?
Small edit for clarification: I'm actually looking for which pseudo-classes apply to which controls. There's plenty of sites that list some of them, but I have yet to find a source that manages to list ::-webkit-calendar-picker-indicator for the datalist element, which does get applied. I'm looking for more of those sneaky bastards, and the best source for that of course is the horse's mouth.
Looks like the actual picker is loaded in an entirely different layer (basically a different window without the titlebar). So I guess the answer is: no, you can't.
I agree it would be great to be able to customize it. And similar popups too. Mozilla in XUL has display:popup which is used by context menus, flyout and similar things. Would be definitely great being able to use that in userland content too.
The calendar popup of Google Chrome is not in Shadow DOM.
It's in a separated page mapped to a popup window. See WebPagePopupImpl.cpp
And the popup content is written by HTML/JavaScript.