Skip to content

Commit

Permalink
Bundled Themes: Add missing initial-scale value in viewport meta tag.
Browse files Browse the repository at this point in the history
The viewport meta should include `initial-scale=1.0` to ensure that high DPI/mobile display works as expected.

Includes standardizing on `1.0` vs. `1` for consistency.

References:
* [https://css-tricks.com/probably-use-initial-scale1/ CSS-Tricks: Probably Use initial-scale=1]
* [https://www.sitepoint.com/community/t/is-it-necessary-to-include-initial-scale-1-0-in-the-meta-viewport-tag/455119 SitePoint Forums: Is it necessary to include initial-scale=1.0 in the meta viewport tag?]

Props dhruvang21, sabernhardt, kkmuffme, mukesh27, swissspidy, SergeyBiryukov.
See #61988.

git-svn-id: https://develop.svn.wordpress.org/trunk@59026 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Sep 16, 2024
1 parent ca64c85 commit 8b8fb62
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentyeleven/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<!--<![endif]-->
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>
<?php
// Print the <title> tag based on what is being viewed.
Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentyfifteen/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<html <?php language_attributes(); ?> class="no-js">
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="profile" href="https://gmpg.org/xfn/11">
<link rel="pingback" href="<?php echo esc_url( get_bloginfo( 'pingback_url' ) ); ?>">
<?php wp_head(); ?>
Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentyfourteen/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<!--<![endif]-->
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php wp_title( '|', true, 'right' ); ?></title>
<link rel="profile" href="https://gmpg.org/xfn/11">
<link rel="pingback" href="<?php echo esc_url( get_bloginfo( 'pingback_url' ) ); ?>">
Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentynineteen/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="profile" href="https://gmpg.org/xfn/11" />
<?php wp_head(); ?>
</head>
Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentyseventeen/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<html <?php language_attributes(); ?> class="no-js no-svg">
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="profile" href="https://gmpg.org/xfn/11">

<?php wp_head(); ?>
Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentysixteen/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<html <?php language_attributes(); ?> class="no-js">
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="profile" href="https://gmpg.org/xfn/11">
<?php if ( is_singular() && pings_open( get_queried_object() ) ) : ?>
<link rel="pingback" href="<?php echo esc_url( get_bloginfo( 'pingback_url' ) ); ?>">
Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentythirteen/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php wp_title( '|', true, 'right' ); ?></title>
<link rel="profile" href="https://gmpg.org/xfn/11">
<link rel="pingback" href="<?php echo esc_url( get_bloginfo( 'pingback_url' ) ); ?>">
Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentytwelve/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<!--<![endif]-->
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title><?php wp_title( '|', true, 'right' ); ?></title>
<link rel="profile" href="https://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php echo esc_url( get_bloginfo( 'pingback_url' ) ); ?>">
Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentytwenty/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<head>

<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1.0" >
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link rel="profile" href="https://gmpg.org/xfn/11">

Expand Down
2 changes: 1 addition & 1 deletion src/wp-content/themes/twentytwentyone/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<html <?php language_attributes(); ?> <?php twentytwentyone_the_html_classes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<?php wp_head(); ?>
</head>

Expand Down

0 comments on commit 8b8fb62

Please sign in to comment.