Improve viewport warning for `shrink-to-fit`
rviscomi opened this issue · comments
According to Stack Overflow and this blog post shrink-to-fit
is a non-standard directive briefly supported by older versions of Safari (9.0–9.2 circa 2018).
Capo will warn if it sees this directive, flagging it as invalid:
❌ Invalid viewport directive "shrink-to-fit".
Here's an example of it in the wild: https://rviscomi.github.io/capo.js/user/demo/?url=https%3A%2F%2Fwww.cnn.com%2F (cnn.com)
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
![image](https://private-user-images.githubusercontent.com/1120896/324305737-d51e6ee3-6dff-497f-8581-80d46075cadc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI3MjQ1MzUsIm5iZiI6MTcyMjcyNDIzNSwicGF0aCI6Ii8xMTIwODk2LzMyNDMwNTczNy1kNTFlNmVlMy02ZGZmLTQ5N2YtODU4MS04MGQ0NjA3NWNhZGMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgwMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MDNUMjIzMDM1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9N2NjMDQ4ODkwMWZjZmIxZGU2MjU1OTFhODRmMTZjOWZlYTQ4YWYyYzA1YzZjNjJkOTQ0OTkzM2M5ODliMGM5ZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.-09-uiyM5_Mg6-mhiOUVrsSsYESlJBtcI6SQ-ZmgCRo)
We could provide better messaging for developers who believe that this directive is valid and they still need it, similar to the IE-specific obsoletion warnings.