What is the current behaviour?
When running preact build (but not preact watch), padding or margin selectors with vh fallback units are removed from CSS module styles. Oddly enough, they are preserved for height selectors (e.g. min-height).
Steps to Reproduce
- Create a new Preact CLI project and add the following CSS to the Home route:
/* style.css */
.home {
width: 100%;
border: 10px solid red;
padding: 50px;
padding-bottom: 20vh; /* <- will be removed */
padding-bottom: 20dvh;
margin-bottom: 20vh; /* <- will be removed */
margin-bottom: 20dvh;
min-height: 20vh; /* <- will be preserved */
min-height: 20dvh;
}
- Run
npm run dev and see the CSS styles correctly rendered in Chrome. The dvh units are ignored (only for iOS) and the vh fallback units are rendered instead.

- Run
npm run build && npm run serve and refresh the page in Chrome. The dvh units are ignored and the vh fallback units are missing for the padding and margin styles, but preserved for min-height.

What is the expected behaviour?
vh units should not be removed from the CSS. It appears that some style de-duplication or minification is happening that doesn't understand that dvh and vh units can be used for padding and margins.
Thanks for your help with this!
What is the current behaviour?
When running
preact build(but notpreact watch),paddingormarginselectors withvhfallback units are removed from CSS module styles. Oddly enough, they are preserved for height selectors (e.g.min-height).Steps to Reproduce
npm run devand see the CSS styles correctly rendered in Chrome. Thedvhunits are ignored (only for iOS) and thevhfallback units are rendered instead.npm run build && npm run serveand refresh the page in Chrome. Thedvhunits are ignored and thevhfallback units are missing for thepaddingandmarginstyles, but preserved formin-height.What is the expected behaviour?
vhunits should not be removed from the CSS. It appears that some style de-duplication or minification is happening that doesn't understand thatdvhandvhunits can be used for padding and margins.Thanks for your help with this!