• What is the best way to change the color scheme of Storefront?
    I can think of two ways:

    1. Change in storefront/assets/sass/utils/_variables.scss and compile the sass to css. This has to be made again on every update of the theme though. Any way to automate this in an easy way?

    2. Override all colors in css in a child theme. Sass code like “color: darken( $color_body, 20% );” will need some manual calculating though. And any new elements with color will need to be added to the css in the child theme so it could be hard to maintain.

    I haven’t used sass before so can somebody give me a clue on how this is supposed to work?

    Thanks!

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter Ben Andersen

    (@ben72)

    I found a way to set the default colors for the customizer, see below.
    Is this the best way to set the colors in code for Storefront?
    I have to go into the customizer and fake a change and save for my new defaults to be used.

    function storechild_default_settings( $args ) {
        $args['storefront_heading_color']               = '#484c51';
        $args['storefront_text_color']                  = '#43454b';
        $args['storefront_accent_color']                = '#96588a';
        $args['storefront_header_background_color']     = '#ffffff';
        $args['storefront_header_text_color']           = '#9aa0a7';
        $args['storefront_header_link_color']           = '#d5d9db';
        $args['storefront_footer_background_color']     = '#ffffff';
        $args['storefront_footer_heading_color']        = '#494c50';
        $args['storefront_footer_text_color']           = '#61656b';
        $args['storefront_footer_link_color']           = '#2c2d33';
        $args['storefront_button_background_color']     = '#ffffff';
        $args['storefront_button_text_color']           = '#ffffff';
        $args['storefront_button_alt_background_color'] = '#ffffff';
        $args['storefront_button_alt_text_color']       = '#ffffff';
        $args['storefront_layout']                      > 'right';
        $args['background_color']                       = '#ffffff';
        return apply_filters( 'storechild_customizer_defaults', $args );
    }
    add_filter( 'storefront_setting_default_values', 'storechild_default_settings' );
    

    Hi Ben,

    Are you aware of the customizer? You can change colours and more there?

    Annie

    Thread Starter Ben Andersen

    (@ben72)

    Hi Annie,

    Yes, I’m aware of the customizer. I want to change the colors in code. When using the Storefront theme on many different sites it’s not sustainable to have to go in and manually set all the colors in the customizer.

    Therefore I’d like to know which is the best practice of setting the colors of the Storefront theme.

    Thanks,

    Ben

    I see..I might miss something here, but going into every of those sites code to change colours does not seem to be good for workflow either?

    Thread Starter Ben Andersen

    (@ben72)

    Ideally I would like to just set the color in code in a plugin or a child theme for each new site. So the parent theme can be updated without loosing the color settings.

    I understand. This free plugin might be right for you: https://www.pootlepress.com/2017/03/how-we-built-storefront-pro-skins/

    You can create a skin ( color scheme etc ) and export/import it in another site.
    Me I have several basic setups ready to go. I create a backup with all in one migration and can use it for many clients as a starting point. I suppose you do not want every client to get the same result so..

    By the way if you set a color scheme in costumizer, that does not get lost when updating your parent theme.

    • This reply was modified 7 years, 6 months ago by LogoLogics.
    Thread Starter Ben Andersen

    (@ben72)

    Thanks! It’s interesting to hear how others work. The plugin needs a premium plugin to work though.
    For now I think I will use the code I posted above to set the colors of a new site. And as you say, they will stay the same even when updating the parent theme.

    Hi Ben,

    If you add the code in a child theme or custom css yes, otherwise your code will get overridden as soon as you update your theme.

    Annie

    Thread Starter Ben Andersen

    (@ben72)

    Hi Annie,

    Yes, I use a child theme. I also tried changing the colors in the scss code, built it and then deployed it. It works but all colors aren’t in the _variables.scss file anyway.

    Thanks!

    ??

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Change colors’ is closed to new replies.