Change CSS style with Javascript
That huge if/else conditional could be converted to for loop with break statement.Assuming 1200 and 2000 as range's lower/upper boundaries.

Padding bottom-left value has the most variation depending on width.That fixed variation can be declared as predefined array:

const paddingSteps = [5.5, 8.5, 11.5, 14, 16, 18, 19, 21];




The final concise implementation:

const paddingSteps = [5.5, 8.5, 11.5, 14, 16, 18, 19, 21];

function navPadding() {
    let width = window.innerWidth;

    if (width &lt; 1200) {
        navDesktop.style.padding = "unset";
        return;
    }
    for (i = 1200; i &lt;= 2000; i += 100) {
        if (width &gt;= i &amp;&amp; width &lt;= i + 100) {
            padRight = (width &gt;= 1900) ? 20 : 19;
            navDesktop.style.padding = `0 ${padRight}% 0 ${paddingSteps[i % 1200 / 100]}%`;
            break;
        }
    }
}

navPadding();