Can't change background image 2.1 RC4

Started by Shades., July 16, 2021, 07:44:02 AM

Previous topic - Next topic

Shades.

The code below worked fine for 2.1 RC3 but since I upgraded the test board to 2.1 RC4 it will not show the background.gif image or change the background color:

Index.css
Quotehtml {
   background: #000000;
}
body {
   background-image: url("htxxx://xxxxx.com/xxxxx/images/background.gif");
   background-attachment: fixed;
   font: 83.33%/150% "Segoe UI", "Helvetica Neue", "Nimbus Sans L", Arial, "Liberation Sans", sans-serif;
   color: #4d4d4d;
   display: flex;
   flex-direction: column;
   min-height: 100vh;
}
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Aleksi "Lex" Kilpinen

Have you tried a hard refresh? CSS changes can be tricky to trigger.
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

Shades.

Oops I just realized I posted this already in another thread the other day. 8)
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Aleksi "Lex" Kilpinen

No worries, opening your own topic is the better way to go usually.
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

Shades.

#4
Quote from: Aleksi "Lex" Kilpinen on July 16, 2021, 07:48:47 AM
Have you tried a hard refresh? CSS changes can be tricky to trigger.

Yes I have tried this several times and tried in other browsers.

I don't think it's the color change mod now cause I just tested it on another (Fresh Install) test board with the color changer mod installed and it worked perfectly so maybe another mod is causing the problem.

I take that back, it has something to do with the color changer mod cause after doing a hard refresh, changing the background in the fresh install with the mod installed does not work. :o
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Aleksi "Lex" Kilpinen

Clear the forum's cache? I'm gonna be honest and say I'm just guessing here, as I haven't tried to do what you are doing here.
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

Shades.

Quote from: Aleksi "Lex" Kilpinen on July 16, 2021, 08:01:37 AM
Clear the forum's cache? I'm gonna be honest and say I'm just guessing here, as I haven't tried to do what you are doing here.
Tried that, no changes either.

Inspect element shows as it should:
Quotebody {
    background-image: url(htxx://xxxxx.com/xxxx/images/background.gif);
    background-attachment: fixed;
    font: 83.33%/150% "Segoe UI","Helvetica Neue","Nimbus Sans L",Arial,"Liberation Sans",sans-serif;
    color: #4d4d4d;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Bigguy

Do you have this on:

Minimize CSS and JavaScript files

Speed King

Curve2 color changer mod uses its own settings.
I would suggest to uninstall this mod and make changes by directly editing of index.css theme file.

Shades.

Quote from: Speed King on July 16, 2021, 01:21:34 PM
Curve2 color changer mod uses its own settings.
I would suggest to uninstall this mod and make changes by directly editing of index.css theme file.
I will probably have to but it worked fine in RC3 and I was able to change the background to an image thru index.css.
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Shades.

Quote from: Bigguy on July 16, 2021, 01:07:51 PM
Do you have this on:

Minimize CSS and JavaScript files
Yes this was checked, I unchecked it and cleared cache and still didn't work.
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Shades.

I believe I discovered a work around!

In Sources/Class-ColorChanger.php I found and deleted:
'background' => array(
array(
'elements' => 'body',
'properties' => array('background')
)
),


Now I can manually change the background in index.css.

Marking this solved!
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Aleksi "Lex" Kilpinen

Cool :) Glad you found a way to do what you wanted.
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

Antechinus

If you want another way of doing it, without hacking the mod, using !important on your CSS declarations will make them override any inline styles set by the mod.

Code (index.css) Select
html {
   background: #000 !important;
}
body {
   background-image: url("htxxx://xxxxx.com/xxxxx/images/background.gif") !important;
   background-attachment: fixed;
   font: 83.33%/150% "Segoe UI", "Helvetica Neue", "Nimbus Sans L", Arial, "Liberation Sans", sans-serif;
   color: #4d4d4d;
   display: flex;
   flex-direction: column;
   min-height: 100vh;
}

Shades.

Ok cool thanks Antechinus! I'll try that out! 8)
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Advertisement: