Help me understand CSS please

Started by SulevFan, February 01, 2023, 12:15:34 PM

Previous topic - Next topic

SulevFan

Most work we undertake on SMF is of the most rudimentary kind. We don't often work with CSS and in the last 10 years I probably lost of lot of what I knew, and SMF probably moved on substantially. So I'd characterize our efforts to customize SMF as "hammer and wire"- type activities - leading us to have a list of "changes" or "fixes" we have to review when we upgrade. Which in turn is an activity we undertake reluctantly and only whe3n it becomes absolutely necessary.

Late last year we upgraded to SMF 2.1.1 and I suspect we'll stay there a while.

/preamble :)

We needed a Dark theme and was not very happy with the theme (which also did not have a 2.1.1 version). That led to us reworking Curve2 into a similar Dark theme. Works well, for the most part.

We have a mod that aids in adjusting some of the CSS colors (Curve2 Color Changer).

We also have a Spoiler mod, Quick Spoiler.

This is where my ignorance bit me a bit.

The text inside the spoiler mod was designed for a light theme, I think, since the background is selectable and is lightly shaded, but the text is white.   This means the text was largely illegible due to poor visibility.

We decided to hack it in the spoiler CSS, by just adding a color tag.  THis didn't work, until we found out that "somehow" SMF does "something" to CSS to create CSS files of this type:

default/css/minified_ad2f6d95330b7f09604c2e577c712bca.css:

Scratching around, we found several of these "minified" css "packages" around, one for the CSS for the spoiler mod.

Could not figure out how to have SMF rebuild these. Using the "Empty SMF cache" routine didn't do it.

Eventually we brute-force removed them, they somehow got rebuild and we were off to the races.

So finally, if anyone is still reading this, I have a question:

How do those minified CSS files get created and how should we have gone about to introduce our changes to CSS markup without having to log in and delete the existing minified files?

Aleksi "Lex" Kilpinen

There's a setting in Features and Options, "Minimize CSS and JavaScript files". When making changes, turn it off until you are happy with what you have, and then turn it on again. This should work, both at making changes immediately available, and regenerating the minimized file when ready.
Slava
Ukraini!


"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

SulevFan

Simple, yet good answer! Thanks

Advertisement: