I often use fields ACF groups for theme settings or special settings on specific pages.

Since I am tired of always create fieldgroups with lots of fields for each CSS setting and they also need plenty of space and are not straight clear, I have created a new ACF field that combines all the necessary settings into one field with a smooth visual design.

Most settings (except for the border width) will be shown after changing the settings. This allows the user to enter the values quick and easy and gives a feedback how the settings look like.

ACF - CSS Margin & Padding Settings

The field content is stored in an array. In this array you will get all values from the settings. For margin and padding you will also get the shorthand version for CSS. Note, that for the border width, there is no shorthand, so the "shorthand" will be only the top border value.

In your page template get the array with get_field("YOUR_FIELD_NAME") and grab the values you need from this array.

You can grab the plugin from GitHub

Get ACF-CSS Margin & Padding Settings