Remove browser notes noise
This commit is contained in:
parent
6505e24734
commit
75a24b4e71
@ -1514,7 +1514,6 @@ define( 'CONSTANT_NAME', value );
|
||||
| FICTIONEER_ENABLE_MENU_TRANSIENTS | boolean | Whether to cache nav menus as Transients. Default `true`.
|
||||
| FICTIONEER_ORDER_STORIES_BY_LATEST_CHAPTER | boolean | Whether to order updated stories based on the latest chapter added, excluding stories without chapters. Default `false`.
|
||||
| FICTIONEER_ENABLE_STORY_CHANGELOG | boolean | Whether changes to the story chapter list should be logged. Default `true`.
|
||||
| FICTIONEER_ENABLE_BROWSER_NOTES | boolean | Whether to inform visitors of missing browser features. Default `false`.
|
||||
| FICTIONEER_DEFER_SCRIPTS | boolean | Whether to defer scripts or load them in the footer. Default `true`.
|
||||
| FICTIONEER_ENABLE_ASYNC_ONLOAD_PATTERN | boolean | Whether the [onload pattern](https://www.filamentgroup.com/lab/load-css-simpler/) for asynchronous CSS loading is used. Default `true`.
|
||||
| FICTIONEER_EXAMPLE_CHAPTER_ICONS | array | Collection of example Font Awesome icon class strings.
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -376,11 +376,6 @@ if ( ! defined( 'FICTIONEER_ENABLE_STORY_CHANGELOG' ) ) {
|
||||
define( 'FICTIONEER_ENABLE_STORY_CHANGELOG', true );
|
||||
}
|
||||
|
||||
// Boolean: Enable showing of outdated browsers' missing features
|
||||
if ( ! defined( 'FICTIONEER_ENABLE_BROWSER_NOTES' ) ) {
|
||||
define( 'FICTIONEER_ENABLE_BROWSER_NOTES', false );
|
||||
}
|
||||
|
||||
// Boolean: Defer scripts
|
||||
if ( ! defined( 'FICTIONEER_DEFER_SCRIPTS' ) ) {
|
||||
define( 'FICTIONEER_DEFER_SCRIPTS', true );
|
||||
|
@ -207,60 +207,6 @@ function fictioneer_output_modals( $args ) {
|
||||
}
|
||||
add_action( 'fictioneer_footer', 'fictioneer_output_modals' );
|
||||
|
||||
// =============================================================================
|
||||
// OUTPUT BROWSER NOTES
|
||||
// =============================================================================
|
||||
|
||||
/**
|
||||
* Outputs the HTML for the browser notes
|
||||
*
|
||||
* @since 5.9.1
|
||||
*/
|
||||
|
||||
function fictioneer_browser_notes() {
|
||||
// Setup
|
||||
$notes = [];
|
||||
|
||||
// Catch IE and other garbage!
|
||||
$notes['garbage'] = __( 'Your browser is obsolete, you need to update or switch!', 'fictioneer' );
|
||||
|
||||
// Support for custom properties?
|
||||
$notes['var'] = __( 'Missing var() support!', 'fictioneer' );
|
||||
|
||||
// Support for grid?
|
||||
$notes['grid'] = __( 'Missing grid support!', 'fictioneer' );
|
||||
|
||||
// Support for gap?
|
||||
$notes['gap'] = __( 'Missing (flex-) gap support!', 'fictioneer' );
|
||||
|
||||
// Support for aspect-ratio?
|
||||
$notes['aspect-ratio'] = __( 'Missing aspect-ratio support!', 'fictioneer' );
|
||||
|
||||
// Support for container queries?
|
||||
$notes['container-queries'] = __( 'Missing container query support!', 'fictioneer' );
|
||||
|
||||
// Support for clamp?
|
||||
$notes['clamp'] = __( 'Missing clamp() support!', 'fictioneer' );
|
||||
|
||||
// Support for -webkit-line-clamp?
|
||||
$notes['line-clamp'] = __( 'Missing -webkit-line-clamp support!', 'fictioneer' );
|
||||
|
||||
// Format output
|
||||
array_walk( $notes, function( &$value, $key ) {
|
||||
$value = '<span class="browser-notes__note browser-notes__' . $key . '">' . $value . '</span>';
|
||||
});
|
||||
|
||||
// Start HTML ---> ?>
|
||||
<div id="browser-notes" class="browser-notes">
|
||||
<strong><?php _e( 'Please update your browser:', 'fictioneer' ); ?></strong>
|
||||
<?php echo implode( ' ', $notes ); ?></div>
|
||||
<?php // <--- End HTML
|
||||
}
|
||||
|
||||
if ( FICTIONEER_ENABLE_BROWSER_NOTES ) {
|
||||
add_action( 'fictioneer_site', 'fictioneer_browser_notes', 1 );
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
// OUTPUT NAVIGATION BAR
|
||||
// =============================================================================
|
||||
|
@ -861,76 +861,3 @@ html:not(.logged-in) body:not(.logged-in) {
|
||||
.widget {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.browser-notes {
|
||||
font-size: 10px;
|
||||
text-align: center;
|
||||
padding: .5rem;
|
||||
max-width: var(--site-width);
|
||||
width: 100%;
|
||||
|
||||
// Catch IE and other garbage
|
||||
@supports (display: block) {
|
||||
display: none;
|
||||
content-visibility: hidden;
|
||||
}
|
||||
|
||||
@supports (not (--example: 0)) or (not (width: 1cqw)) or (not (display: grid)) or (not (gap: 1px 1px)) or (not (aspect-ratio: 3 / 2)) or (not (width: clamp(10px, 50%, 100px))) or (not (-webkit-line-clamp: 1)) {
|
||||
display: block;
|
||||
content-visibility: visible;
|
||||
}
|
||||
|
||||
&__note {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&__garbage {
|
||||
display: inline-block;
|
||||
|
||||
@supports (display: block) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
&__var {
|
||||
@supports not (--example: 0) {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
&__grid {
|
||||
@supports not (display: grid) {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
&__gap {
|
||||
@supports not (gap: 1px 1px) {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
&__aspect-ratio {
|
||||
@supports not (aspect-ratio: 3 / 2) {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
&__container-queries {
|
||||
@supports not (width: 1cqw) {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
&__clamp {
|
||||
@supports not (width: clamp(10px, 50%, 100px)) {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
&__line-clamp {
|
||||
@supports not (-webkit-line-clamp: 1) {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user