DEV Community

Steven Lei
Steven Lei

Posted on

A JavaScript Utility for Measuring Spacing

Hello, I am Steven. I just wrote a JavaScript utility named SpacingJS.

As a frontend web developer, it is important to grasp the spacing between elements on a webpage. The DevTool can check the dimension, padding, margin, styles and more of an element, but it seems like it cannot measure the distance between elements like Sketch/Figma. So I have written this utility:


You can experience on the website:

Besides including the script with a <script> tag to your website, a Chrome Extension is available on the Chrome Web Store.

The project is open-source and available here: Would you please star it if you like it?:)

Thank you!

Top comments (3)

puka_tchou profile image
Puka Tchou

Nice work, it would be super useful as a browser extension too!

stevenlei profile image
Steven Lei

Thank you very much!

okrohan profile image
Rohan Salunke

Awesome job Steven. Thanks for making this an extension! Its been very helpful!