I'm in the process of updating a client's site from BD 1.20 to 1.22. When I applied the new core, the result was that custom colors defined in the theme's CSS were changed to either #ffffff or #000000 (white or black). So far I haven't found what is causing this and hope someone here can point me in the right direction.
To see the changes, the two sites are at:
- https://www.pd-forum.net (the live site currently on BD 1.20
- https://pd-forum.tfpkiii.com (the test site updated to 1.22)
The sites use a custom theme based on basis which includes some references to the W3CSS Framework in the front end. All of the color definitions that got filtered are defined in the theme's CSS file - pdf_style.css - which is managed with SASS. I checked the pdf_style.css in the theme directory, it looks fine. But when BD is building the css color cache file, it is changing the custom definitions - i.e., looking at the CSS reference in with Firefox Webtools points to the cache file in the "files" directory.
Has anyone else had this problem? I couldn't find a reference to it in the forums or the GitHub issues queue (could be my search, not that it isn't there).
Thanks - Tom K
Comments
Do you have the Color module enabled on that site? If you didn't explicitly remove it, it's probably in use (even if you didn't actively use it), since Basis uses it by default. If so, you might need force the CSS files to be rebuilt.
You do that by going to Appearance and then clicking on the Settings link for the currently enabled theme, then click the Save Theme Settings.
If that doesn't do it, try changing one of the colors in some way, saving the theme settings, then restore the color and save the settings again.
Thanks for the quick reply.
With some testing, it certainly looks like the Color module is doing something. Trying to reset it with changing some of the colors in the theme settings was one of the first things I thought of, but that didn't do anything. After your post, I tried disabling the Color module and, voila, the custom backgrounds were back (though those set in the theme color setting were gone).
I can probably live with this by disabling the Color module and styling the affected blocks/layout sections. Is this something that should be raised as an issue on the GitHub tracker? I did check there earlier and didn't see anything there. This seems to have been the result of a change between 1.20 and 1.22.
Thanks again for your quick reply. - Tom K
I see other issues with the test site. Some of the css files are not loading at all - Chrome is throwing a number of console errors such as:
Refused to apply style from 'https://pd-forum.tfpkiii.com/files/color/pdf_basis-4b81ac30/base.css?rd4f57' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled. pd-forum.tfpkiii.com/:1
And the site looks like this at first load:
A quick search comes up with:
https://stackoverflow.com/questions/48248832/stylesheet-not-loaded-becau...
And the comment that seems to work best for many people:
It happens when you set an incorrect URL to the file or when your server isn't configured properly. In the result, the browser DOESN'T get the stylesheet, but it gets some HTML with 404 status and with the "Content-Type" header. Since the browser gets something from the server, it doesn't tell you there is no reply, but it tells you the MIME type of the file is incorrect. The fastest way to check it is just to try to open the file directly
http://localhost:3000/assets/styles/custom-style.css
in a new tabSo, it looks like the css files are not being found.
Thanks for the quick reply.
I think that the CSS is being found - most of the styling defined in the css does seem right (Chrome is not always the best tool - I'm convinced Google makes it conform to their standard rather than what passes for standards :-). Early on I did plug in the direct link to the CSS file into my browser and it resolved the CSS file that BD builds for the cache, but with the custom color codes changed to #000000 or #ffffff.
Based on a previous reply, I disabled the Color module and the defined background colors were back. I'm now going to fill in the styling for any of the sections this may affect and live with that.
Thanks again - Tom K