So not long ago i made a small library using Jquery for spacing (margin and padding).
and what i'm trying to do now is switch this library to pure js with your help :)
here's js code link : click here
and here's they code i'm trying to figure out how to switch it to pure js:
let dataAttr = "[data-m], [data-mt], [data-mr], [data-mb], [data-ml], [data-my], [data-mx], [data-p], [data-pt], [data-pr], [data-pb], [data-pl], [data-py], [data-px]";
let dataSpacing = $("[data-spacing]").find(dataAttr);
dataSpacing.each(function () {
$(this).css({
'margin': $(this).attr("data-m") + p,
'margin-top': $(this).attr("data-mt") + p,
'margin-right': $(this).attr("data-mr") + p,
'margin-bottom': $(this).attr("data-mb") + p,
'margin-left': $(this).attr("data-ml") + p,
});