
Smarter JavaScript inspection & debugging Also, we’re going to make it even easier for you to extract your changes from the Changes panel. We’re currently prototyping layout tools for debugging unwanted scrollbars, z-indexes that don’t work, and more tools like the Flexbox Inspector but for other types of layouts. You’ve been telling us exactly what your biggest CSS challenges are, and we’ve been listening. We’re really excited for you to try these two new features and let us know what you think. Once you’re happy, open the Changes tab and see everything you did. It keeps track of all the CSS changes you’ve made within the inspector, so you can keep working as you normally would. In Firefox 65, we’ve also introduced a new Changes panel to do just that. That’s when you’re usually faced with a problem we’ve all had: “What did I actually change to make it work?”. To do so, you’ve made a few edits to various CSS rules and elements. Let’s suppose you have fixed a flexbox bug thanks to the Flexbox Inspector. Look for the Flex Container panel in the sidebar, and click on the 2 items to see how their sizes are computed by the browser.

Open the Inspector on this page, and select the element. If you are reading this on Firefox 65, you can take this for a spin right now! It shows your item’s base size (either its minimum content size or its flex-basis size), the amount of flexible space that was added ( flex-grow) or removed ( flex-shrink) from it, and any minimum or maximum defined sizes that restricted the item from becoming any shorter or longer. The diagram at the top of the flexbox section shows a quick overview of the steps the browser took to give the item its size. The layout sidebar now contains a Flex Container section that lists all the flex items, in addition to providing information about the container itself.Ĭlicking any of these flex items opens the Flex Item section that displays exactly how the browser calculated the item size. The Flexbox Inspector comes with functionality to show how the browser distributed the sizing for a given item.

How much should an element stretch, or should an element wrap to a new line?īut when you give up control, how do you know what the browser is actually doing? The beauty of Flexbox is that you can leave the browser in charge of making the right layout decisions for you. Understanding how flex items got their size Additionally, you can turn on the highlighter from the flex icon in the CSS rules panel, as well as from the toggle in the new Flexbox section of the layout sidebar. This is an easy way to find flex containers while you’re scanning elements in the DOM. One way to toggle the highlighter for a flexbox container is by clicking its “flex” badge in the inspector.
FIREFOX DEVELOPER EDITION COMMAND LINE FREE
A background pattern that represents the free space between items.Solid lines that show where the flex items are.A dotted outline that highlights the flex container itself.


Once toggled, the highlighter shows three main parts: Highlighting containers, lines, and itemsįirst and foremost, the Flexbox Inspector highlights the elements that make up your flexbox layout: the container, lines and items.īeing able to see where these start and end - and how far apart they are - will go a long way to helping you understand what’s going on. That’s exactly what the Flexbox Inspector is focused on. But when problems appear in your layout it may feel frustrating, and you may really need to understand why elements behave a certain way. When everything works like a charm, you don’t have to worry about this. To achieve this, the layout engine of the browser does a lot of things under the hood. Introducing the Flexbox Inspectorįlexbox is a powerful way to organize and distribute elements on a page, in a flexible way. We want you to go from “trying things until they work” to really understanding how your browser lays out a page. The Firefox DevTools team is on a mission to help you master CSS layout. We hope you’ll love using these tools just as much as we and our community loved creating them.
