[Support request] child theme style.css vss. customizer->additional CSS

Home Forums Support [Support request] child theme style.css vss. customizer->additional CSS

Home Forums Support child theme style.css vss. customizer->additional CSS

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2272675
    Matthias

    Hi,

    i am nearly done with a website and now wanted to move almost all css from the customizer to the style.css of my child theme.
    For some reason this breaks some parts – buttons i had vertical on the right+left side of the page now are no longer alignet – and i cant figure out why. If i copy+paste the code back from style css into customizer->additional css it works again.

    Isn’t it possible to add some css-Types/phrases into the style.css? As it works when i copy the broken parts back it probably shouldnt be caused by a paste error. Really weird. Do you have a clue why?
    I read in a topic here that its better to keep most css in the child themes style.css so thats why.

    #2272855
    David
    Staff
    Customer Support
    #2272879
    Matthias

    thx that worked – at least on my hosters page.
    For some reason it does not work in the sandbox on my local machine. Do you know if there are any php packages or similar needed (i have wordpress running locally on a ubuntu server virtual machine and sync to my hoster via wordmove)?

    #2272888
    David
    Staff
    Customer Support

    No, that code i provided is using the core wp_enqueue_scripts hook, thats built into WP.
    The only other issues could be:

    a. the directory structure ie. where the child theme style.css is located, but if that were different it wouldn’t load at all.

    b. Page Caching ? do you have that on your VM ? As it may just need a refresh

    #2273444
    Matthias

    thx – i will look into it – i actually have quite a basic installation on my vm – not many php-modules. I have to look which one is missing – not really familiar with all there is. php8.1-opcache is installed + enabled.

    But i am happy as long as it works on the live server.

    btw – what is a weird coincidence: i get the same behaviour on the live server when i activate autoptimize settings
    (Aggregate all linked CSS-files? If this option is off, the individual CSS-files will remain in place but will be minified.) If deactivated its fine – but i get the same gap / misplaced button (between menu and page content). This error also still is viewable as soon as i open the customizer – even when the setting is deactivated. I asked this already in another topic.

    #2273554
    David
    Staff
    Customer Support

    When you aggregate all linked files, autoptimize scrapes all those links, grabs their CSS and combines them into one file.
    This can sometimes lead to breakages, due to the files being combined a different order, or a minor error in one CSS file breaking the subsequent styles.

    There isn’t much we can do about that. Frank over at Autoptimize might provide some advice on it.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.