Integrating HUD Element settings in a resource pack

First of all there's a template here, download it so you can start from default values and with the structure already defined.

You can edit all elements individually split in their own files.

Resource pack compatibility

Since this is a resource pack any missing files will be ignored, therefore files you wish not to change should be deleted so other resource packs that alter them can do so without having to rearrange the resource packs order.

In order to tweak it open the file you want to edit (let's assume it's the command menu so open cm.json). There you'll find a data structure with the following elements:

Get the data

In order to get the data needed to populate the .json file you can obtain it from the game, in the M menu > Config > Adjust HUD, then position the element you want and you'll see the information in the middle of the screen: adjust elements.png

Some elements like CM and HP can have extra options which once set to resource pack defaults will override your config values