meta_viewport
The
viewport
meta tag should not useuser-scalable=no
, andmaximum-scale
should be 2 or above, so end users can zoomUser impact: Critical
This rule supports the following configuration:
- TOML
- Shell
# `user-scalable=no` must not be used, and `maximum-scale` should be 2 or above.meta_viewport = true
# `user-scalable=no` must not be used, and `maximum-scale` should be 2 or above.curlylint --rule 'meta_viewport: true' .
#
Success- TOML
- Shell
<!-- Good: Does not use user-scalable=no --><!-- meta_viewport = true --><meta name="viewport" content="width=device-width"><!-- Good: maximum-scale less than 2 on unrelated meta --><!-- meta_viewport = true --><meta name="potato" content="width=device-width, maximum-scale=1">
<!-- Good: Does not use user-scalable=no --><!-- curlylint --rule 'meta_viewport: true' . --><meta name="viewport" content="width=device-width"><!-- Good: maximum-scale less than 2 on unrelated meta --><!-- curlylint --rule 'meta_viewport: true' . --><meta name="potato" content="width=device-width, maximum-scale=1">
#
Fail- TOML
- Shell
<!-- Bad: user-calable=no is not allowed --><!-- meta_viewport = true --><meta name="viewport" content="width=device-width, user-scalable=no"><!-- Bad: maximum-scale less than 2 is not allowed --><!-- meta_viewport = true --><meta name="viewport" content="width=device-width, maximum-scale=1">
<!-- Bad: user-calable=no is not allowed --><!-- curlylint --rule 'meta_viewport: true' . --><meta name="viewport" content="width=device-width, user-scalable=no"><!-- Bad: maximum-scale less than 2 is not allowed --><!-- curlylint --rule 'meta_viewport: true' . --><meta name="viewport" content="width=device-width, maximum-scale=1">