News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Curve2 Color Changer

Started by SMF Customization Team, April 16, 2019, 06:00:27 PM

Previous topic - Next topic

Shades.

In index.css

Find:
h3.catbg, h3.catbg a, h3.catbg a:hover {
color: #fff;
}

Change to:
h3.catbg, h3.catbg a, h3.catbg a:hover {
color: #fff !important;
}

Change the #fff to your color of choice and make sure to leave the "!important;" text so it will override the color changer mod! ;)
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

@rjen

Quote from: davo88 on April 25, 2022, 03:48:10 PMThanks very much for your reply @rjen.

I tried the change in two test forums
  • One with Curve2 Color Changer installed and in use
  • One a fresh install of 2.1.1 - no modifications at all

In #1, there was no change. I don't understand where or how Curve2 Color Changer stores the changes it makes. Do edits to the index.css have to be made in another file when this mod is installed?

In #2, the change worked, but it changed the Forum title (red) rather than the Category title.

I misread your request. Shades posted the correct solution... just a warning: that bit of css will affect h3.catbg elements in other places in the forum as well. Not so easy to just target the category titles...
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

IamTheBoy

Looks to be just the mod I need, thanks!

However, getting an error that hints it may be due to this mod...


/var/www/html/forum/Sources/Class-ColorChanger.php (Line 264)
Type of error: Cron
Error messageSelect
8: Undefined index: theme_id


Is this from this mod, or do I need to post this in 2.1 Support?


Cheers

davo88

Shades
Thank you for the code. It worked fine.
Could you tell me what is the source of the !important tag? Was it implemented by SMF or Curve2 Color Changer?

@rjen
Quote from: @rjenI misread your request.
No problem. You showed me how to modify the forum titles, another small change I would like to make.
Quote from: @rjen...that bit of css will affect h3.catbg elements in other places in the forum as well.
I see it changes the color of other similar headings that use a full width blue band - samples below. Are these the sort of elements you are referring to?
You cannot view this attachment.

You cannot view this attachment.

IamTheBoy
I haven't seen the error you mention on either of the two test sites I am using - an unmodified site and a site using Curve2 Color Changer.
Could you tell me when the error occurs please?

Arantor

!important is standard CSS, it means 'use this rule in preference to other rules'.

Diego Andrés

Yes, it's not needed for this specific situation. Not sure where Shades got that change from, it will not affect anything having it or dropping it since the mod (or any other I've seen) doesn't change it as it's been pointed out.

SMF Tricks - Free & Premium Responsive Themes for SMF.

IamTheBoy

Quote from: IamTheBoy on April 26, 2022, 10:03:15 AMLooks to be just the mod I need, thanks!

However, getting an error that hints it may be due to this mod...


/var/www/html/forum/Sources/Class-ColorChanger.php (Line 264)
Type of error: Cron
Error messageSelect
8: Undefined index: theme_id


Is this from this mod, or do I need to post this in 2.1 Support?


Cheers
I've narrowed it down to when a user does an export of their profile.

If the option to include posts or PMs is not checked, it seems to just do it once. If they tick either of those options, it seems to do it repeatedly (maybe once per message?)

Shades.

#107
Quote from: Diego Andrés on April 26, 2022, 03:47:10 PMYes, it's not needed for this specific situation. Not sure where Shades got that change from, it will not affect anything having it or dropping it since the mod (or any other I've seen) doesn't change it as it's been pointed out.
Sorry I haven't used this mod since RC4... but it was a solution that worked for me that was shared with me(can't find or remember where) but it worked! I wasn't sure if that part of the code needed the !important part or not or even if the color changer mod affected that area or not! Was just a mere suggestion! If it worked, cool! 8) Otherwise  listen to @Diego Andrés he know his stuff! 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

davo88

This subject may have already been discussed starting back here at post #80. But no matter how many times I read it, I don't really understand it and am not sure of the conclusion.
So my apologies to everyone if I am asking a question that has already been answered.

Having worked up a nice set of colors using Curve2 Color Changer (thank you Diego), is there a way I can copy that set of colors from one installation of SMF 2.1.1 to another separate stock standard installation of SMF 2.1.1 which has no modifications to the default theme?

Loshmi

Did anyone tested it on 2.1.2? Is it working?
Thanks in advance for the reply!

Diego Andrés


SMF Tricks - Free & Premium Responsive Themes for SMF.

shawnb61

Quote from: IamTheBoy on April 27, 2022, 04:47:12 AM
Quote from: IamTheBoy on April 26, 2022, 10:03:15 AM/var/www/html/forum/Sources/Class-ColorChanger.php (Line 264)
Type of error: Cron
Error messageSelect
8: Undefined index: theme_id
I've narrowed it down to when a user does an export of their profile.

If the option to include posts or PMs is not checked, it seems to just do it once. If they tick either of those options, it seems to do it repeatedly (maybe once per message?)

That's a bug.  I see it also.  Logged internally.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

shawnb61

I have been playing around with this mod also - working on a dark theme for our site. 

I see folks have asked how to use this in multiple copies of curve2.  I've been able to do this by following these 2 steps:

  • Make a copy of curve2 in the acp via "Install a new theme", "Create a copy of Default ".
  • Add the following code to the bottom of template_init() in index.template.php in your new copy:

// No palettes...
addJavaScriptVar('txt_cc_palettes', false);

// Copy settings template over from color changer mod...
$settings['color_changes'] = array(
'background' => array(
array(
'elements' => 'body',
'properties' => array('background')
)
),
'foreground' => array(
array(
'elements' => 'body, strong, .strong, h1, h2, h3, h4, h5, h6, h3.titlebg, h4.titlebg, .titlebg, h3.subbg, h4.subbg, .subbg,
#detailedinfo dt, #tracking dt, .approvebg',
'properties' => array('color')
)
),
'primary_color' => array(
array(
'elements' => 'div.cat_bar, .amt, .dropmenu li a:hover, .dropmenu li:hover a, .dropmenu li a:focus,
#top_info > li > a:hover, #top_info > li:hover > a, #top_info > li > a.open, .button.active, .button.active:hover',
'properties' => array('background', 'border-color')
),
array(
'elements' => '#footer',
'properties' => array('background')
),
array(
'elements' => '.button.active, .button.active:hover',
'properties' => array('color' => '#fff')
)
),
'secondary_color' => array(
array(
'elements' => '.title_bar',
'properties' => array('border-top-color', 'border-bottom-color')
),
array(
'elements' => '.dropmenu li a.active, #top_info li a.active, .dropmenu li a.active:hover, .dropmenu li:hover a.active, a.moderation_link,
a.moderation_link:visited, .new_posts, .generic_bar .bar, .progress_bar .bar',
'properties' => array('background', 'border-color')
)
),
'links' => array(
array(
'elements' => 'a, a:visited, .dropmenu li:hover li a, .dropmenu li li a, .button, .quickbuttons li, .quickbuttons li a,
.quickbuttons li:hover a, .titlebg a, .subbg a, .quickbuttons li ul li a:hover',
'properties' => array('color')
)
),
'gradient_end' => array(
array(
'elements' => '#wrapper, .dropmenu li ul, .top_menu, .dropmenu li li:hover, .button, .dropmenu li li:hover > a, .dropmenu li li a:focus,
.dropmenu li li a:hover, #top_section, #search_form .button, .quickbuttons li, .quickbuttons li ul, .quickbuttons li ul li:hover,
.quickbuttons ul li a:focus, .popup_window, #inner_section, .button:hover, .quickbuttons li:hover, .navigate_section ul, .popup_content, .up_contain,
.button:focus, #search_form .button:hover, .quickbuttons li:hover',
'properties' => array('background')
)
),
'gradient_start' => array(
array(
'elements' => '.dropmenu li ul, .top_menu, .dropmenu li li:hover, .button, .dropmenu li li:hover > a, .dropmenu li li a:focus,
.dropmenu li li a:hover, #top_section, #search_form .button, .quickbuttons li, .quickbuttons li ul, .quickbuttons li ul li:hover,
.quickbuttons ul li a:focus, .popup_window, #inner_section',
'properties' => array('background-image' => 'linear-gradient(to bottom, {color} 0%, transparent 70%)')
),
array(
'elements' => '.button:hover, .button:focus, .quickbuttons li:hover, .navigate_section ul, .popup_content, .up_contain,
#search_form .button:hover, .quickbuttons li:hover',
'properties' => array('background-image' => 'linear-gradient(to bottom, transparent 0%, {color} 70%)')
)
),
'blocks_color' => array(
array(
'elements' => '.windowbg:nth-of-type(even), .bg.even, .information, .roundframe, .generic_list_wrapper, .approvebg,
.windowbg:nth-of-type(odd) blockquote, .windowbg:nth-of-type(even) .bbc_alternate_quote',
'properties' => array('background')
)
),
'blocks_alternate_color' => array(
array(
'elements' => '.windowbg:nth-of-type(odd), .bg.odd, .unread_notify:hover, .title_bar, tr.windowbg:hover,
.windowbg:nth-of-type(even) blockquote, .windowbg:nth-of-type(odd) .bbc_alternate_quote, .bbc_code',
'properties' => array('background')
)
),
'content_target_bg' => array(
array(
'elements' => '.windowbg:target',
'properties' => array('background')
),
),
'borders_color' => array(
array(
'elements' => '#wrapper, .button, .button:hover, .button:focus, .windowbg, .roundframe, .information, #top_section, .navigate_section ul, .dropmenu li ul, .top_menu,
.unread_notify, .pm_unread, .alerts_unread, .dropmenu li li:hover > a, .dropmenu li li a:focus, .dropmenu li li a:hover, .up_contain,
.boardindex_table .board_stats p, .children, #ic_recentposts td, .sub_bar, #info_center .sub_bar, .generic_bar, .progress_bar,
#detailedinfo dl, #tracking dl, .inner, .signature, .attachments, .under_message, .custom_fields_above_signature, .custom_fields_below_signature,
.quickbuttons li, .quickbuttons li:hover, .quickbuttons li ul, .quickbuttons li ul li:hover, .action_admin .table_grid td, .generic_list_wrapper,
#topic_container .windowbg, #topic_icons .information, #messageindex .information, .approvebg, .popup_content, fieldset, #alerts tr.windowbg td,
blockquote, #manage_boards li.windowbg, #manage_boards li.windowbg:last-child, #footer, .bbc_code, #inner_wrap',
'properties' => array('border-color')
),
array(
'elements' => '.title_bar',
'properties' => array('border-left-color', 'border-right-color')
),
array(
'elements' => 'hr',
'properties' => array('background', 'border-color')
)
),
'top_section' => array(
array(
'elements' => '#top_section',
'properties' => array('background')
)
),
'footer' => array(
array(
'elements' => '#footer',
'properties' => array('background')
)
),
'buttons_text_color' => array(
array(
'elements' => 'a.button, .button, .quickbuttons li a, .button:hover, .button:focus, .quickbuttons li:hover>a, .quickbuttons li:hover li a',
'properties' => array('color')
),
),
'buttons_bg' => array(
array(
'elements' => '.button, .quickbuttons li, .button:hover, .button:focus, .quickbuttons li:hover, #search_form .button, #search_form .button:hover',
'properties' => array('background')
)
),
'buttons_border' => array(
array(
'elements' => '.button, .quickbuttons li, .button:hover, .button:focus, .quickbuttons li:hover, #search_form .button, #search_form .button:hover',
'properties' => array('border-color')
)
),
'special_titles_color' => array(
array(
'elements' => '.info .subject, h1.forumtitle a, .poster h4, .poster h4 a, .poster li:hover h4 a, .poster h4 a:hover .poster li h4 a,
.poster h4 a:focus, #smfAnnouncements dt a, .keyinfo h5 a, .keyinfo h5 a strong, .current_page',
'properties' => array('color')
),
array(
'elements' => '#smfAnnouncements dt',
'properties' => array('border-color')
)
),
'sticky_topic' => array(
array(
'elements' => '.windowbg.sticky',
'properties' => array('background')
),
),
'sticky_locked_topic' => array(
array(
'elements' => '.windowbg.sticky.locked',
'properties' => array('background')
)
),
'unapproved_topic' => array(
array(
'elements' => '.windowbg.approvetopic, .windowbg.approvepost, .approvebg',
'properties' => array('background')
)
),
'locked_topic' => array(
array(
'elements' => '.windowbg.locked',
'properties' => array('background')
)
),
'remove_shadows' => array(
array(
'elements' => '*',
'properties' => array('box-shadow' => 'none !important', 'text-shadow' => 'none !important')
)
)
);

This is basically creating a custom theme with the same controls as this mod.  The code above is a slightly modified version of code in buildCss(), following the instructions provided in the mod description.  If buildCss ever changes, what is copied here would need to change, too. 

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

shawnb61

It would be nice to adjust text backgrounds, too, especially for working on a dark mode color set.  There are a lot of #FFF values throughout the .css.  Bright hot white... They hit you like a searchlight coming out of your smartphone in the dark...
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

shawnb61

#114
I now have a dark mode theme for my site.  This was accomplished almost exclusively with this mod, plus a couple minor .css tweaks and a change to the main template (mainly to support the full width banner).

*** EDIT: ...using a highly modified version of the $settings['color_changes'] array, shown in the above post.  Every time I found some rando color I wanted under control of the color changer, I added the corresponding element to the 'elements' list of my intended color in $settings['color_changes']. 

https://www.vguitarforums.com/smf/index.php?theme=2

You cannot view this attachment.

You cannot view this attachment.

You cannot view this attachment. 
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Steve

DO NOT pm me for support!

davo88

Quote from: shawnb61....how to use this in multiple copies of curve2...
Thank you shawnb61 for posting the above guide.

Recursos

After installing the mod, error log shows 44 similar errors:

44 8: Undefined index: cc_remove_shadows
43 8: Undefined index: cc_locked_topic
....
 1 8: Undefined index: cc_background

is this serious?

Diego Andrés

Are you using the default theme?

SMF Tricks - Free & Premium Responsive Themes for SMF.

Diego Andrés

Version 1.4.2 - 15 October 2022
- Fixed undefined errors when no settings are saved

SMF Tricks - Free & Premium Responsive Themes for SMF.

Advertisement: