Advertisement:

Navigation

SMF Mod Site

Mod Name:
Curve2 Color Changer
Created By:
SMF Customization Team
Type:
Theme Enhancements
First Created:
April 15, 2019, 02:06:21 PM
Last Modified:
April 17, 2019, 06:26:49 PM
Latest Version:
1.0
Compatible With:
2.1 RC2
Total Downloads:
346

Download this mod

curve2-color-changer_v1.0.zip (9kB) [342]
Manual Install Instructions for SMF


Below are some preview images of what the mod looks like when being used

Description:

Curve2 Color Changer


Supported Languages: English
Link To Mod | Mod Discussion | Other SMF Customization Team Mods


Compatibility
For SMF 2.1.x

Introduction
Adds color settings for the the SMF 2.1 default theme

Installation
Any previous versions of this mod MUST be uninstalled BEFORE installing this version.
This mod is mainly for the default theme, custom themes might be compatible depending on the author of the custom theme.

Usage in custom themes (for theme authors)
If you wish to make use of the mod and allow admins to change colors in your theme, add an array with the following format to template_init()

Code: [Select]
<?php
$settings
['color_changes'] = array(
'COLOR_TYPE' => array(
array(
'elements' => '.ELEMENT, #ANOTHER_ELEMENT',
'properties' => array('PROPERTY_NAME''ANOTHER_PROPERTY' => '{color}')
)
array(...)
),
...
);

You can use one of the already declared color types :

'background', 'foreground', 'primary_color', 'secondary_color', 'top_section', 'footer', 'links', 'gradient_end', 'gradient_start', 'blocks_color', 'blocks_alternate_color', 'borders_color', 'buttons_text_color', 'buttons_bg', 'buttons_border', 'special_titles_color'

or you can use a new color type, but you'll have to give it a text string in this format
Code: [Select]
$txt['cc_COLOR_TYPE'] = 'STRING';Properties will be given the value of the color, and you can also use {color} and it will be replaced with the color's value.

example from the default theme:
Code: [Select]
<?php
$settings
['color_changes'] = array(
'background' => array(
array(
'elements' => 'body',
'properties' => array('background')
)
),
'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')
)
),
'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, .quickbuttons li:hover, .navigate_section ul, .popup_content, .up_contain,
.button:hover, #search_form .button:hover, .quickbuttons li:hover'
,
'properties' => array('background-image' => 'linear-gradient(to bottom, transparent 0%, {color} 70%)')
)
),
);

Support
Please use the modification thread for support with this modification.

Changelog
Version 1.0 - April 2019
  Initial Release



Copyright (c) 2019, Simple Machines, under BSD 3-Clause License.
All rights reserved.