themeum / qubely

Qubely Blocks – Full-fledged Gutenberg Toolkit
GNU General Public License v3.0
84 stars 36 forks source link

Filter to use add_theme_support( 'editor-color-palette',array()) #9

Closed nicmare closed 4 years ago

nicmare commented 4 years ago

I defined my own theme colors with

add_theme_support( 'editor-color-palette', array(
        array(
            'name'  => __( 'Violet', 'bootstrap' ),
            'slug'  => 'primary',
            'color' => '#AB1957',
        )
);

Would be nice if you load this as default for your color palettes! i know there a global settings for this but i rather would prefer to skip this step when you simple load the default wp filter.

also would be nice to use the first item from the array as default color for all blocks. and at the moment default color seems to be blue which i have to change every time which is annoying!

anik commented 4 years ago

Thanks for your suggestion. Qubely color palette filter added within version 1.2.2

Here is example-

add_theme_support('qubely-color-palette', array(
    '#571845',
    '#900b3e',
    '#c70039',
    '#ff5733',
    '#ffc300',
    '#4F5B93',
));
nicmare commented 4 years ago

good. please also consider to use the first entry of the array as default color! although i changed the colors in the global settings, new block elements appear in qubely blue. i have to change that color each time again and again…

nicmare commented 4 years ago

and why don't you just merge both arrays? the editor-color-palette function is wordpress gutenberg default variable! even stackable plugin uses this:

Screenshot 2019-11-08 15 01 35

just providing the hex code is not enough. the user needs the color code name!

nicmare commented 4 years ago

unfortunately its limited to 5 colors only. but we need more please! simple use the default color theme options support from wordpress please:

        $theme_colors = array(
            array(
                'name'  => __( 'Dunkel', 'bootstrap' ),
                'slug'  => 'dark',
                'color' => '#263f4a',
            ),
            array(
                'name'  => __( 'Grün', 'bootstrap' ),
                'slug'  => 'green',
                'color' => '#aabe28',
            ),
            array(
                'name'  => __( 'Pink', 'bootstrap' ),
                'slug'  => 'pink',
                'color' => '#de3c8d',
            ),
            array(
                'name'  => __( 'Blue', 'bootstrap' ),
                'slug'  => 'blue',
                'color' => '#19aad7',
            ),
            array(
                'name'  => __( 'Schwarz', 'bootstrap' ),
                'slug'  => 'black',
                'color' => '#000000',
            ),
            array(
                'name'  => __( 'Grau', 'bootstrap' ),
                'slug'  => 'gray',
                'color' => '#c7c7c7',
            ),
            array(
                'name'  => __( 'White', 'bootstrap' ),
                'slug'  => 'white',
                'color' => '#ffffff',
            )
        );
        $theme_colors_qubely = array();
        foreach($theme_colors as $color){
            $theme_colors_qubely[] = $color["color"];
        }

        add_theme_support( 'editor-color-palette', $theme_colors );
        add_theme_support( 'qubely-color-palette', $theme_colors_qubely );
nicmare commented 4 years ago

custom (global) qubely colors missing in image blurb overlay:

Bildschirmfoto 2019-11-13 um 13 43 28
anik commented 4 years ago

Issue 1: More than items is not possible, it breaks the design of popup.

Issue 2: Overwrite in default color is also a problem. Because you need not use default block only qubely block is enough to do all the task. Most of the block plugins use default color panel to do their job. We we overwrite the color palette then they will face a problem.

Issue 3: custom (global) qubely colors missing in image blurb overlay issue fixed. https://github.com/themeum/qubely/commit/d786d5d012df6d6b486f5174e90d130acb4c4a83

will be live in next update. Thanks.