• Resolved OsakaWebbie

    (@osakawebbie)


    I have a website that uses a child theme of ColorMag, with a fair amount of customization in the child theme’s style.css file. After much neglect, today I upgraded both WordPress core (from 6.0.6 to 6.3.2) and the parent ColorMag theme (from 2.1.8 to 3.0.7). I don’t know which of those upgrades caused this, but now when I select Appearance->Customize, the preview shown doesn’t incorporate my CSS code, even though the frontend website does. If I put the CSS in the “Additional CSS” spot in the Customizer, most (but not all) of the changes appear in the preview. But I’d rather keep it in a file, so I can use an editor of my choice instead of a small textbox. Is there a way to get the Customizer preview to read the child theme CSS like it used to?

Viewing 6 replies - 1 through 6 (of 6 total)
  • You can get specific support for this theme here:

    https://wordpress.org/support/theme/colormag/

    However, the CSS under the Appearance –> Customizer –> Additional CSS is not the same as the CSS you have inserted into your child theme under /wp-content/themes/colormag-child/style.css

    2.1.8 to 3.0.7 is a huge upgrade. You may way to rollback to and make sure you get everything you need:

    https://themes.trac.wordpress.org/log/colormag/

    Thread Starter OsakaWebbie

    (@osakawebbie)

    I already went through the shock of the huge upgrade – I made a clone of my site in a subdirectory with the theme rolled back to 2.1.8 so I can compare and adjust my CSS. My question isn’t about that, but about why my child theme’s CSS is no longer used in the Customizer’s preview. Is that caused by a change in WordPress or the parent theme? That kind of thing seems more like fundamentally WordPress functionality, so my first guess is WordPress itself. I upgraded WordPress to 6.3.2 on the main site running ColorMag 3.0.7, while the clone with the theme rolled back is still running WP 6.0.6, which is why I can’t verify for sure which is the cause (unless I upgrade the clone to 6.3.2 also, which I’m hesitant to do, because the site design comparison is more fair if I’m looking at my old site with nothing changed).

    • This reply was modified 8 months, 3 weeks ago by OsakaWebbie.

     why my child theme’s CSS is no longer used in the Customizer’s preview.

    Tbh, I’ve never see this before. Perhaps you had a theme customization to accommodate for this?

    Normally you wold edit your child theme style.css using the Theme Editor (not the Customizer):

    https://wpastra.com/docs/how-to-edit-style-css-in-child-theme/

    Here is some background:

    https://www.kadencewp.com/blog/custom-css-should-you-use-a-wordpress-child-theme-or-the-customizer/

    If you do not have access to the style.css file using Appearance –> Theme Editor –> child theme –> style.css, then check your permissions, or check to see if you have a security plugin installed that is preventing you from editing theme files.

    Thread Starter OsakaWebbie

    (@osakawebbie)

    It seems that my question is still being misunderstood. I have no trouble editing my style.css – I have been doing that for years. But things I can set easily in Customizer, I set there – examples would be sidebar layout, logo/title/tagline, basic colors when available, etc. I’m pretty sure that’s a normal workflow. My issue is that when I’m doing things in Customizer and a preview of the site is shown to the right of where the settings are, that preview no longer looks like the frontend site – the preview ignores the detailed CSS I put in style.css.

    Here is an imgur post with two screenshots, showing what the Customizer looks like in the old versions of WordPress and ColorMag vs. the new versions: https://imgur.com/a/fWB774g The live site is at https://l4jp.com – as you can see, the live site uses styles.css as it should (I have finished fixing the CSS selectors to match the ColorMag upgrade), but the Customizer doesn’t.

    Thread Starter OsakaWebbie

    (@osakawebbie)

    UPDATE: Hmm, it looks different today for some mysterious reason. The first two screenshots were taken in preparation for posting my initial question, but in the end I decided not to bother including them in the question. After I took those screenshots, I did two things, neither of which I would have expected to change the situation:

    • I tested copying my CSS into the little Additional CSS box (I mentioned that in my initial post). But I did not save, nor did I restore the auto-save when the Customizer offered it.
    • I did a few more tweaks to styles.css yesterday to clean up some final details. I didn’t use the WP admin area at all for that, but FTP and a local editor.

    Weirdly, just now I looked at Customizer again, and most of my CSS is now applied to the preview! I’ve now added a third image to the imgur post so you can see. The most obvious thing still not applied is the background color of the header (a subtle gradient), but in Customizer I can set a basic color, so that will be close enough for preview purposes. I’ll mark this as resolved, as it’s way better than it was, and it seems that no one has any insights about why it’s not simply using all of my CSS.

    • This reply was modified 8 months, 3 weeks ago by OsakaWebbie.
    Thread Starter OsakaWebbie

    (@osakawebbie)

    Ack! I set a color for the header background, and that overrode my gradient on the live site! I changed it back to “default” but that didn’t solve it – apparently the structure of the elements was changed permanently by that action. I had to put my gradient on a different selector to solve it (but it still doesn’t apply to the Customizer preview – oh well…).

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Child theme CSS not used in Customizer’ is closed to new replies.