Okay
  Public Ticket #1366467
Theme color
Closed

Comments

  •  3
    khansen started the conversation

    I need to change the base color of the theme - as documentet here:
    http://www.magesolution.com/themes/claue/docs/m2/index.html#st-color-default

    However, changes doesn't affect anything and I can see, that the color
    #56cfe1 is hardcoded many places in the LESS-files. Eg. here: 
    app/design/frontend/Mgs/claue/web/css/menu.less

    Line 1: @base-color : #56cfe1;

    I have tried changing the general color to #CC0000 and searching for this value in the contents of all files in the installation, and it is not compiled in any css or other files. I also checked the source and it is not outputted as inline CSS either.

    The site is in developer mode, I have flushed cache, removed statics and preprossesed and deployed again. The color doesn't change.

  • [deleted] replied

    Hi,

    Please make sure that you selected store view before setting color or if you changed in file, so I am sure that it wil be applied, please try on a dev site, I will check for you because I have tested on my local machine and it is working!

  •  3
    khansen replied

    I would expect that it should work even if set it as the "Default configuration", but it doesn't work with neither "Default configuration" nor by slecting the indivdual store view. And the reason is pretty obvious – the base color is hardcoded in the less file as 

    @base-color : #56cfe1;

    See attached from the file "app/design/frontend/Mgs/claue/web/css"

  • jbutkowski replied

    I'm experiencing the same issue as khansen.

  • [deleted] replied

    Hi there

    We have checked on local machine and the setting default color is working fine, I think that you are not using newest theme version, please try to check if this file is exist or no "app\code\MGS\Mpanel\data\themes\claue\theme_style.xml", if it was exist, so you updated to new version but if no, please download newest theme version and update them. Note if you update theme, please sequence update, you mean, you are using theme version 1.4.0 and want to update to version 1.4.2, you will need to update to 1.4.1 first then to 1.4.2.

  •  3
    khansen replied

    Hi

    I'm using 1.4.5 and the file "theme_style.xml" is there already.

    In the LESS-file the @base_color variable is hardcoded. Can you tell how and where the custom color should be outputted? 

    I can't see how it should be possible in the current code.

    Is it supposed to output as inline CSS in the header?

  • [deleted] replied

    Hi,

    Of course our theme has to hardcode color in the code because not all of customers need to change color setting and if they doesn't setting color, the defaul color will be used. If you setup the custom color, that color will be added to an custom_config.css file and called after theme.less, so the default color will be overrided with custom color. Also please try on an other browser, maybe your browser is currently cached.

  •  3
    khansen replied

    The color could have been a default variable - however, no color changes are compiled in custom_config.css either

    Attached you can see my custom_config.css after several cache cleans, removed  pub- and static-folders, multiple deployments and every other purging possibility available. Browser cache cleaned, tried private browsing as well as completely other browsers. No difference.

    Attached is a screen-dump of my theme color settings and the custom_config.css of my site.

    I don't expect working in a child theme makes any difference regarding this, but please take this into consideration when you debug – as I in fact am woking with a child theme.

  •  3
    khansen replied

    And just to make sure. With the theme color settings as the screen dump attached here – the custom_config.css  is identical to previously. New custom_config.css  attached as well. Also, I checked which custom_config.css is loaded adn verified that I'm checking the correct folder. Attached screen (source.png) shows reference in the source

  •  3
    khansen replied

    After having done my own debugging I can tell you that this apparently is related to using child themes

    This file: app/code/MGS/Mpanel/Helper/Data.php

    Generates custom_config.css

    Line 1673 gets theme color settings by theme-name:

                $themeColorSetting = $this->getThemecolorSetting($storeId, $themeName);

    When the variable is the child theme name nothing is returned for colors, but when I change it in the code to hardcoded 'claue' the colors are returned.

    So, this is the error. Please fix accordingly and release a patch.

  • [deleted] replied

    Hi

    I am woring on your site and will inform you when any updates

  •  3
    khansen replied

    Great - thanks.

  • [deleted] replied

    Hi

    Please try to copy app\code\MGS\Mpanel\data\themes\{parent_theme}\theme_style.xml file to app\code\MGS\Mpanel\data\themes\{child_theme}\

    With { child_theme } is child theme name, if it didn't exist, please create a new folder.

  •  3
    khansen replied

    Sorry - doesn't work.

    I cleaered statics, cleaned cache and deployed. Colors still don't output to custom_config.css

  • [deleted] replied

    Hi

    Please backup app\code\MGS\Mpanel\Helper\Data.php file then upload this file ( attached ) to app\code\MGS\Mpanel\Helper then try again. If it still doen't helps, please install on a dev site and I will check for you because we have checked on the local machine and the color still changed when we use a child theme.

  • jbutkowski replied

    Although it took a few minutes to show, the Data.php fix worked for me. 

  •  3
    khansen replied

    It seems to be working with the replacement Data.php.

    I will di further testing and continue this ticket if related problem occor.

    Thanks.