Make WordPress Core


Ignore:
Timestamp:
08/23/2024 10:45:54 PM (2 years ago)
Author:
peterwilsoncc
Message:

Administration: Modernize Site Icon UI in settings, customizer.

Updates the UI for previewing a site icon in general settings and the customizer to account for changes to browser designs over the past years.

Props joedolson, joen, kebbet, nhrrob, swissspidy, mukesh27, afercia, jorbin.
Fixes #60625.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media-template.php

    r58774 r58927  
    15431543
    15441544        <?php // Template for the Site Icon preview, used for example in the Customizer. ?>
    1545         <script type="text/html" id="tmpl-site-icon-preview">
    1546                 <h2><?php _e( 'Preview' ); ?></h2>
    1547                 <strong aria-hidden="true"><?php _e( 'As a browser icon' ); ?></strong>
    1548                 <div class="favicon-preview">
    1549                         <img src="<?php echo esc_url( admin_url( 'images/' . ( is_rtl() ? 'browser-rtl.png' : 'browser.png' ) ) ); ?>" class="browser-preview" width="182" height="" alt="" />
    1550 
    1551                         <div class="favicon">
    1552                                 <img id="preview-favicon" src="{{ data.url }}" alt="<?php esc_attr_e( 'Preview as a browser icon' ); ?>" />
    1553                         </div>
    1554                         <span class="browser-title" aria-hidden="true"><# print( '<?php echo esc_js( get_bloginfo( 'name' ) ); ?>' ) #></span>
    1555                 </div>
    1556 
    1557                 <strong aria-hidden="true"><?php _e( 'As an app icon' ); ?></strong>
    1558                 <div class="app-icon-preview">
    1559                         <img id="preview-app-icon" src="{{ data.url }}" alt="<?php esc_attr_e( 'Preview as an app icon' ); ?>" />
     1545        <script type="text/html" id="tmpl-site-icon-preview-crop">
     1546                <style>
     1547                        :root{
     1548                                --site-icon-url: url( "{{ data.url }}" );
     1549                        }
     1550                </style>
     1551                <h2><?php _ex( 'Site Icon Preview', 'noun' ); ?></h2>
     1552                <p><?php _e( 'As an app icon and a browser icon.' ); ?></p>
     1553                <div class="site-icon-preview crop">
     1554                        <div class="image-preview-wrap app-icon-preview">
     1555                                <img id="preview-app-icon" src="{{ data.url }}" class="app-icon-preview" alt="<?php esc_attr_e( 'Preview as an app icon' ); ?>" />
     1556                        </div>
     1557                        <div class="site-icon-preview-browser">
     1558                                <svg role="img" aria-hidden="true" fill="none" xmlns="http://www.w3.org/2000/svg" class="browser-buttons"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 20a6 6 0 1 1 12 0 6 6 0 0 1-12 0Zm18 0a6 6 0 1 1 12 0 6 6 0 0 1-12 0Zm24-6a6 6 0 1 0 0 12 6 6 0 0 0 0-12Z" /></svg>
     1559                                <div class="site-icon-preview-tab">
     1560                                        <div class="image-preview-wrap browser">
     1561                                                <img id="preview-favicon" src="{{ data.url }}" class="browser-icon-preview" alt="<?php esc_attr_e( 'Preview as a browser icon' ); ?>" />
     1562                                        </div>
     1563                                        <div class="site-icon-preview-site-title" aria-hidden="true"><# print( '<?php echo esc_js( get_bloginfo( 'name' ) ); ?>' ) #></div>
     1564                                                <svg role="img" aria-hidden="true" fill="none" xmlns="http://www.w3.org/2000/svg" class="close-button">
     1565                                                        <path d="M12 13.0607L15.7123 16.773L16.773 15.7123L13.0607 12L16.773 8.28772L15.7123 7.22706L12 10.9394L8.28771 7.22705L7.22705 8.28771L10.9394 12L7.22706 15.7123L8.28772 16.773L12 13.0607Z" />
     1566                                                </svg>
     1567                                        </div>
     1568                                </div>
     1569                        </div>
    15601570                </div>
    15611571        </script>
Note: See TracChangeset for help on using the changeset viewer.