Customization > Themes and Graphics

custom Block styling in one theme only

(1/3) > >>

ncoded:
I made a custom .windowbg4 that I am using with a block in a custom theme that I am working on. All good, except when I switch back to the SMF Default Curve theme, this custom class is applied instead of the native .windowbg3.

This is true whether I place my custom class in portal.css or index.css within mycustom theme, while when switching to the SMF Default there is no styling (as expected, since this class is not defined there).

Is there a way to make the custom class apply only in a particular theme?

One idea I had was to modify the index or portal css in the SMF Default theme so that no matter which one is applied, the native .windowbg3 is applied. Anyone with a better idea?

emanuele:
As far as I know windowbg4 is not used anywhere in SMF/SP, so it's not declared in any css at least in the default theme.
As such, if your block outputs something like:

--- Code: ---<div class="windowbg4">something</div>
--- End code ---
then that "something" will basically have no style applied (except for those inherited from the parent tags).

Are you by any chance expecting that on the default theme instead of:

--- Code: ---<div class="windowbg4">something</div>
--- End code ---
a

--- Code: ---<div class="windowbg3">something</div>
--- End code ---
is created?

ncoded:
Thank you for your reply.

I apologize for the misunderstanding; let me try to rephrase my story.

I know that .windowbg3 is defined and used in the default (Curve) theme and from there it is also picked up by SP. But I am designing a custom theme based on Curve and I want to use a different Default Body Class for certain custom HTML blocks. For these blocks I can define my own body class, which I call .windowbg4

All is good so far, my blocks have the customization that I desireas long as I show my custom theme. The problem is, these customizations  will also be applied to the blocks if I switch to Curve (because SP uses the same blocks in both themes).

So my question would be: is there a way to use .windowbg3 for these blocks in Curve, and my own .windowbg4 in my custom theme (and only there)?

Chen Zhen:
ncoded,

You can have it check which theme and use that condition to edit the custom class accordingly.
Another idea is that you can create a windowbg4 class in the default css file & duplicate the windowbg3 class attributes into it.

♦ Ninja ZX-10RR ♦:

--- Quote from: Chen Zhen on December 09, 2015, 10:34:41 PM ---Another idea is that you can create a windowbg4 class in the default css file & duplicate the windowbg3 class attributes into it.

--- End quote ---
Ugh, simply add .windowbg4 next to .windowbg3, much shorter and less confusing.

Navigation

[0] Message Index

[#] Next page

Go to full version