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:

SpacingJS

You can experience on the website:
https://spacingjs.com

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: https://github.com/stevenlei/spacingjs. Would you please star it if you like it?:)

Thank you!

Top comments (3)

Collapse
 
puka_tchou profile image
Puka Tchou •

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

Collapse
 
stevenlei profile image
Steven Lei •

Thank you very much!

Collapse
 
okrohan profile image
Rohan Salunke •

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