• Resolved stevebrett

    (@stevebrett)


    Im having an issue where rules in ie.css randomly and seemingly unpredictably change the way pages on thiis site render. And i dont understand its role. Presumable ie is for internet explorere but im reviewing the site in fire fox and chrome.

    Here the specific current issue on the page referenced above

    H2.entry titles are dark grey (they should be #fff) when i inspect them i see the color is triggered by this rule in line 11259 of ie.css
    `.entry-title {
    color: #28303d;
    font-size: 2.25rem;
    letter-spacing: normal;
    line-height: 1.3;
    overflow-wrap: break-word;
    }

    Ive made a exact copy of the site and this page at

    https://walkercreekmedia.com/dev/category/short-docs/

    If you look on this page the h2.entry-titles are #fff as expected and the color set by line 4054 in style.css as expected

    .entry-title {
    color: var(–entry-header–color);

    I’m pulling my hair out trying to figure out why ie.css overrides (only occasionally) style.css. I could write a rule in the customizer and that would take care of this particular issue and the site will look ok for a week or so and then this issue will appear on another element someplace else.

    Its vexing. Any thoughts

    The page I need help with: [log in to see the link]

Viewing 13 replies - 1 through 13 (of 13 total)
  • Hello,

    ie.css is only loaded when the $is_IE WordPress Global Variable is true

    global $is_IE, $wp_scripts;
    	if ( $is_IE ) {
    		// If IE 11 or below, use a flattened stylesheet with static values replacing CSS Variables.
    		wp_enqueue_style( 'twenty-twenty-one-style', get_template_directory_uri() . '/assets/css/ie.css', array(), wp_get_theme()->get( 'Version' ) );
    	} else {
    		// If not IE, use the standard stylesheet.
    		wp_enqueue_style( 'twenty-twenty-one-style', get_template_directory_uri() . '/style.css', array(), wp_get_theme()->get( 'Version' ) );
    	}

    This variable is set in vars.php of WordPress core as follows …

            if ( ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) !== false || strpos( $_SERVER['HTTP_USER_AGENT'], 'Trident' ) !== false ) && strpos( $_SERVER['HTTP_USER_AGENT'], 'Win' ) !== false ) {
    		$is_winIE = true;
    	} elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) !== false && strpos( $_SERVER['HTTP_USER_AGENT'], 'Mac' ) !== false ) {
    		$is_macIE = true;
            }

    As you can see above, because the variable is only set to true when the user’s browser agent contains MSIE, it’s highly unlikely that using Firefox would allow this to happen.

    ie.css is used to make sure that the theme is compatible (to a fashion) with Internet Explorer which isn’t compatible with the var() CSS function used throughout the theme’s CSS.

    So … it’s more likely that something is messing with the $is_IE global variable on your site. Perhaps another plugin?

    Or perhaps you’ve changed the Twenty Twenty-One theme … ? Have you tried with a fresh copy of Twenty Twenty-One?

    Oliver

    Thread Starter stevebrett

    (@stevebrett)

    Thanks for that explanation. We haven’t edited the theme. None the less i’ve installed a fresh copy and we’ll see how that goes. Given the irregularity of it all it might be a week before we see it happen

    I notice
    function twentytwentyone_add_ie_class()

    in functions.php on a page i was looking at before i freshened up the theme that had loaded styles from ie.css i didnt see the is_IE body class.

    Also could you hazzard a guess as to what type of plugin might do this. I just looked at this list and nothing jumped out at me

    Thanks so much Oliver

    I notice function twentytwentyone_add_ie_class() in functions.php

    That just injects the class is-IE into the body element of the HTML if the JavaScript recognises the user-agent of the browser as containing MSIE.

    Just looked at your site though and not seeing ie.css being loaded anymore so looks like you sorted it.

    Oliver

    Thread Starter stevebrett

    (@stevebrett)

    Thanks again Oliver well keep an eye onit but that’s the frustrating thing it just seems to randomly load- But perhaps reinstalling the theme sorted it

    Thread Starter stevebrett

    (@stevebrett)

    Oliver could you take another peek. right now the primary menu has the ie styles but not on every page

    Most are ok, but not here for example

    https://www.walkercreekmedia.com/gloucesterprints/

    Hello,

    I can confirm that your site is loading ie.css on Safari.

    Very odd indeed.

    All I can suggest is that you disable all plugins and see which one is causing this issue by turning them back on one-by-one. Obviously make sure you run a full backup before doing this.

    I can think of no reason why an unmodified WordPress core or parent theme would cause this behaviour.

    Sorry.

    Oliver

    Moderator James Huff

    (@macmanx)

    Are you using any sort of caching plugin, or do you see a “Clear/Purge Cache” button in your Dashboard or admin bar? If so, would you please try clearing the cache?

    Note: You do not need to install a caching plugin at this point just to clear a cache you don’t have. If you don’t have a caching plugin or a way to clear a server-level cache, just say so. šŸ™‚

    Thread Starter stevebrett

    (@stevebrett)

    Yes we are James and if I clear the cache it will and did fix this issue- but it or perhaps another one related to ie.css will reappear eventually

    Moderator James Huff

    (@macmanx)

    Ok, that sounds right then. So, someone with IE visits the site, and that gets cached.

    Your caching system shouldn’t be caching variables like that though.

    What caching plugin are you using?

    Thread Starter stevebrett

    (@stevebrett)

    James thanks- were using the lightspeed cache

    Moderator James Huff

    (@macmanx)

    In that case, I recommend reporting the problem at https://wordpress.org/support/plugin/litespeed-cache/ so the plugin’s developers and support community can help you with this.

    Thread Starter stevebrett

    (@stevebrett)

    Thanks James will do

    Moderator James Huff

    (@macmanx)

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘ie.css’ is closed to new replies.