Inspect and Debug CSS Flexbox and Grid Layouts by using the Layouts Tab in Dev Tools
In Chrome DevTools in the Layouts tab you have handy options to debug CSS Flexbox and Grid. Including:
- Display size and lines along with labels
- Changing their attributes
- Change how overlay is colored and fastly switch nested elements in the Elements panel
This guide will only cover some example gif recordings on how to use with Grid, since it's basically straight forward to apply this for Flexbox by yourself afterwards.
For this purpose a the link to documentation and a simple code pen have been added for both use cases.
You can use this
Read to check for full details.
You can toggle the grid badge for every elements that has
display: grid or
display: inline-grid applied to it. Now the Layout Pane will have several options on how to display this element.
You can set different properties on on how the grid elements are aligned etc. directly and track their sizes with the layout display.
When nesting several grid, you can directly grep them in the layouts tab and change the color by which they are represented.
The functions for flexbox basically work the same way as for grid. For this reason I will only link thisand encourage you to play around by yourself.
For full detail check.