To add custom field only for variant on web, please follow below mentioned steps:
Step 1: Go to the Document Settings.
Step 2: Click on Add Custom Feilds.
Step 3: Click on “+New Custom Field”, enter the necessary details, and select “Variant” in the “Applicable For” field and click on Save.