added IE11 ponyfill
This commit is contained in:
parent
aadbe38385
commit
e55ac69b87
10 changed files with 60 additions and 0 deletions
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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' );
|
||||
|
||||
|
|
9
varia/js/css-vars-ponyfill2.js
Normal file
9
varia/js/css-vars-ponyfill2.js
Normal file
File diff suppressed because one or more lines are too long
1
varia/js/ie11-fix.js
Normal file
1
varia/js/ie11-fix.js
Normal file
|
@ -0,0 +1 @@
|
|||
cssVars( {} );
|
6
varia/sass/abstracts/_ie11-ponyfill.scss
Normal file
6
varia/sass/abstracts/_ie11-ponyfill.scss
Normal 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);
|
||||
}
|
|
@ -6,3 +6,4 @@
|
|||
@import "functions";
|
||||
@import "config-global";
|
||||
@import "mixins";
|
||||
@import "ie11-ponyfill";
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue