added IE11 ponyfill

This commit is contained in:
Maggie Cabrera 2021-01-15 14:41:00 +01:00 committed by Ben Dwyer
parent aadbe38385
commit e55ac69b87
10 changed files with 60 additions and 0 deletions

View file

@ -120,6 +120,12 @@ $grid-configuration: map-extend($grid-configuration-default, $grid-configuration
* Add font-family using CSS variables.
* It also adds the proper fallback for browsers without support.
*/
body {
display: none;
/* Legacy */
display: var(--skip, block);
}
/**
* Global variables
*/

View file

@ -141,6 +141,12 @@ $grid-configuration: map-extend($grid-configuration-default, $grid-configuration
* Add font-family using CSS variables.
* It also adds the proper fallback for browsers without support.
*/
body {
display: none;
/* Legacy */
display: var(--skip, block);
}
/**
* Global variables
*/

View file

@ -141,6 +141,12 @@ $grid-configuration: map-extend($grid-configuration-default, $grid-configuration
* Add font-family using CSS variables.
* It also adds the proper fallback for browsers without support.
*/
body {
display: none;
/* Legacy */
display: var(--skip, block);
}
/**
* Global variables
*/

View file

@ -257,6 +257,19 @@ function varia_scripts() {
wp_enqueue_script( 'comment-reply' );
}
// Note, the is_IE global variable is defined by WordPress and is used
// to detect if the current browser is internet explorer.
global $is_IE;
if ( $is_IE ) {
// If IE 11 or below, use a ponyfill to add CSS Variable support
wp_register_script( 'css-vars-ponyfill', get_stylesheet_directory_uri() . '/assets/js/css-vars-ponyfill2.js' );
wp_enqueue_script( 'ie11-fix',
get_stylesheet_directory_uri() . '/assets/js/ie11-fix.js',
array( 'css-vars-ponyfill' ),
'1.0'
);
}
}
add_action( 'wp_enqueue_scripts', 'varia_scripts' );

File diff suppressed because one or more lines are too long

1
varia/js/ie11-fix.js Normal file
View file

@ -0,0 +1 @@
cssVars( {} );

View file

@ -0,0 +1,6 @@
// This is needed to avoid FOUC in IE11
// See https://github.com/jhildenbiddle/css-vars-ponyfill/issues/55
body {
display: none; /* Legacy */
display: var(--skip, block);
}

View file

@ -6,3 +6,4 @@
@import "functions";
@import "config-global";
@import "mixins";
@import "ie11-ponyfill";

View file

@ -140,6 +140,12 @@ $grid-configuration: map-extend($grid-configuration-default, $grid-configuration
* Add font-family using CSS variables.
* It also adds the proper fallback for browsers without support.
*/
body {
display: none;
/* Legacy */
display: var(--skip, block);
}
/**
* Extends
*/

View file

@ -140,6 +140,12 @@ $grid-configuration: map-extend($grid-configuration-default, $grid-configuration
* Add font-family using CSS variables.
* It also adds the proper fallback for browsers without support.
*/
body {
display: none;
/* Legacy */
display: var(--skip, block);
}
/**
* Extends
*/