You could attempt using CSS variables and the var() function.
By defining an --width variable in your .block selector then setting the width attribute of the .wider selector to be calc(var(--width) + 100px, you can achieve a class that makes the box wider. Note that in order for this to work properly you have to add an additional --width attribute to every css selector that changes the width.
div {
width: var(--width, 100%);
}
.block {
height: 100px;
--width: 100px;
background-color: red
}
.wideblock {
height: 100px;
--width: 200px;
background-color: blue
}
.wider {
width: calc(var(--width) + 100px);
}
<p>Div with just block:</p>
<div class="block"></div>
<p>Div with block and wider:</p>
<div class="block wider"></div>
<p>Div with wideblock:</p>
<div class="wideblock"></div>
<p>Div with wideblock and wider:</p>
<div class="wideblock wider"></div>
EDIT: added width: --width to all divs at the request of Temani Afif