function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Akash v 6Akash v 6 

How to know the what is the px or rem size for the slds element

Hi All

How do I know what is the px or rem siez for slds element. For example if I am using <div class="slds-p-around_medium"/> and I know if will add some paddig around the div but I would like to know the exact size for top/left/right/bottom.

Thanks,
AK
jprichterjprichter

You can get the clientHeight (https://developer.mozilla.org/en-US/docs/Web/API/Element/clientHeight)or offsetHeight (https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetHeight)with javascript, same as with any element.

 

 

Deepali KulshresthaDeepali Kulshrestha
Hi Akash,

Greetings to you!

You must inspect the preview output. Here, you can apply class and style. after that, you can reflect it in your code.
you can follow below link to learn more
https://lightningdesignsystem.com/utilities/margin/

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Deepali Kulshrestha
www.kdeepali.com