chameleon icon indicating copy to clipboard operation
chameleon copied to clipboard

Themes not working? Or Im doing something wrong here

Open ScottLync opened this issue 3 years ago • 12 comments

Using latest https://github.com/ProfessionalWiki/chameleon/archive/refs/heads/master.zip

$egChameleonThemeFile = __DIR__ . '/themes/united.scss';
$egChameleonExternalStyleModules = [
	__DIR__ . '/themes/united_bootswatch.scss' => 'afterMain',
];

2 files from https://bootswatch.com/4/united/ to /var/www/html/themes/: _variables.scss renamed to -> united.scss _bootswatch.css renamed to -> united_bootswatch.scss

I tried clearing cookies, using other browsers. Theme is as default - white. Not getting any errors

ScottLync avatar Aug 08 '21 14:08 ScottLync

What happens when you clear the MediaWiki SCSS cache as per these steps? https://github.com/ProfessionalWiki/chameleon/blob/master/docs/customization.md#triggering-a-cache-update

malberts avatar Aug 08 '21 18:08 malberts

What happens when you clear the MediaWiki SCSS cache as per these steps? https://github.com/ProfessionalWiki/chameleon/blob/master/docs/customization.md#triggering-a-cache-update

LocalSettings.php at the end:

$egChameleonThemeFile = __DIR__ . '/themes/united/_variables.scss';

$egChameleonExternalStyleModules = [

__DIR__ . '/themes/united/_variables.scss' => 'afterFunctions',

__DIR__ . '/themes/united/bootstrap.min.css' => 'afterFunctions',

__DIR__ . '/themes/united/_bootswatch.scss' => 'afterMain',

];

\Bootstrap\BootstrapManager::getInstance()->addCacheTriggerFile( __DIR__ . '/united/_variables.scss' );

This should work? Nothing happens. Maybe im doing something wrong? I get no errors

ScottLync avatar Aug 09 '21 10:08 ScottLync

Does anyone has this problem also?

ScottLync avatar Aug 18 '21 21:08 ScottLync

There is not enough information here to debug anything.

Which version of MediaWiki are you using? Did you install with or without Composer? Can you confirm if you have the Bootstrap extension and the mediawiki/scss library? What is "Theme is as default - white."? Is that the default white Chameleon theme, or is that white as in no/broken styling? Did you try all 3 methods to clear the cache?

If you open your URL with ?debug=true while looking at your browser's developer tools, does it show any errors in the Chameleon CSS? If there is a SCSS compilation issue it will show an error when it tries to fetch the debug CSS: image

malberts avatar Aug 19 '21 13:08 malberts

I think its a mistake making just warnings instead of errors, on first setup page. I installed all its libraries, and it worked. If you call that \Bootstrap function to clear cache, you have to uncomment it.

That should be the problem for this.

..... Still dont know how to change nav bar and other components values. Need more tutorials for it

ScottLync avatar Aug 24 '21 17:08 ScottLync

I am having the same problem. The themes only partly work. If I change from united to flatly, for example, the fonts and link colours change, but the navigation background does not change.

Software Version
MediaWiki 1.35.5
PHP 7.4.27 (litespeed)
MariaDB 10.3.32-MariaDB
ICU 63.1
Lua 5.1.5
Chameleon 3.4.1 (6d731d0) 21:27, 16. Sep. 2021

krabina avatar Jan 05 '22 18:01 krabina

This can probably do with better documentation. It's not that the theme is not working, it's rather because Chameleon has its own SCSS variables on top of the standard Bootstrap variables. Switching only the (non-Chameleon) theme won't affect those variables. In some cases you can try to override the Chameleon variables, in other cases you need to add additional Bootstrap classes.

For the NavbarHorizontal component, these are the Chameleon-specific colors (=light): https://github.com/ProfessionalWiki/chameleon/blob/f3f4358be03e4291131c485cb9e31be57424f7db/resources/styles/_variables.scss#L64-L66

Depending on what you want to do, e.g. if you wanted a dark navbar you can these 2 classes in the layout XML instead:

<component type="NavbarHorizontal" class="bg-dark navbar-dark">
    <component type="NavMenu"/>
    <component type="Menu" message="secondary-menu"/>
</component>

Some more info from the Bootstrap documentation: https://getbootstrap.com/docs/4.6/components/navbar/#color-schemes

malberts avatar Jan 09 '22 07:01 malberts

While this works for the NavbarHorizontal, it does not work for the Pagetools, SearchBar and PersonalTools, and adding

<component type="PageTools" class="navbar-dark bg-primary flex-row" position="right" hideSelectedNameSpace="yes"/>

instead of just <component type="PageTools" class="flex-row" position="right" hideSelectedNameSpace="yes"/> does not change anything.

krabina avatar Feb 16 '22 07:02 krabina

@krabina navbar-dark is a Bootstrap class that applies only to the navbar itself. Can you show a screenshot of what's happening and what you want to happen? Based on the above I assume some navbar components are still appearing as if they are supposed to be on a light navbar.

malberts avatar Feb 16 '22 08:02 malberts

yes, exactly: grafik

The main menu and footer are correct, Personal Tools, Page Tools menus are not and neither ist the search button.

krabina avatar Feb 16 '22 09:02 krabina

I managed the search field and dropdown-menus, but can't get the font aweseome icons to change their color: grafik

krabina avatar Feb 18 '22 15:02 krabina

I finally managed. I think the trick was to set 'navbar-light-color' => "#f0f0f0"

krabina avatar Feb 19 '22 16:02 krabina