My universal fix for all the «variable @modal-slide-header__padding-vertical is undefined» problems

Locate the line:
https://github.com/magento/magento2/blob/22629abe10f9c640fe47b6081d57fedccdea8e0f/app/design/frontend/Magento/luma/web/css/source/_theme.less#L13

It is empty.
Place here the code:

@import 'components/_modals.less';

It fixes the problems:

The frontend product page gallery is broken now, unable to compile the Less file lib/web/mage/gallery/gallery.less: variable @modal-slide-header__padding-vertical is undefined (and my fix)

https://github.com/magento/magento2/issues/2273

https://github.com/magento/magento2/issues/2286

https://github.com/magento/magento2/issues/2306

https://github.com/magento/magento2/issues/2327