• Resolved gabriela67

    (@gabriela67)


    I am trying to add my own custom gradients in the child theme but they don’t work.

    
    add_theme_support(
    'editor-gradient-presets',
    [
    	[
    	'name' => 'Light blue to green',
    	'gradient' => 'linear-gradient(120deg, rgba(236,242,251,1) 0%, rgba(236,242,251,1) 30%, rgba(239,250,225,1) 100%)',
    	'slug' => 'own-light-blue-to-green',
    	],
    ]
    );
    

    Is there a special filter like “blocksy:editor-color-palette” ?

    Thank you

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hello @gabriela67

    No, as far as I know we do not have a filter for gradients for now. Is this something that’s mission critical for you? I can try speaking with the developers about this to see if we can figure something out for you, but cannot promise anything.

    Thanks.

    Thread Starter gabriela67

    (@gabriela67)

    Hi Edward,

    It would be great if you can find out. I was planning to create about 6 custom gradients and I need to preset them otherwise the client will have a hard time reusing them.

    To be honest the theme preset list of gradients wouldn’t be useful in any of my projects. It would be useful if that would be dynamic and use the customized color pallet. But even in that case I would probably need to set a few custom ones.

    Thank you.

    Hey @gabriela67

    Just confirmed with our developers there’s no filter for this for the moment, but we have added this to our to-do list and hope to implement it for the next update, as time allows. ??

    We’ll be in touch.

    Thanks.

    Thread Starter gabriela67

    (@gabriela67)

    Thank you.

    Theme Author creativethemeshq

    (@creativethemeshq)

    Hey @gabriela67
    We have implemented a filter that lets you add custom gradients. Because the feature is still in our internal builds, and will be making its way into the full public release this week, we have the nightly build of Blocksy that enables you to do this.

    Simply install it as a theme and replace what you have right now. And when the full update releases, update as normal as it will also include this enhancement.

    Here’s an example on how to use the filter:

    add_filter(‘blocksy:editor-gradient-presets’, function ($gradients) {
    	$gradients[] = [
    		‘name’ => ‘Vivid cyan blue to vivid purple’,
    		‘gradient’ => ‘linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)’,
    		‘slug’ => ‘vivid-cyan-blue-to-vivid-purple’,
    	];
    	return $gradients;
    });

    Link to the nightly build – https://www.dropbox.com/s/c4l7l16ql2w3n31/1.8.21-beta7-production.theme.zip?dl=0

    Let us know if this helps.

    Thread Starter gabriela67

    (@gabriela67)

    Wow, this is great, thank you very much. Is there a way to remove the existing gradients so the only gradients available for the user are the custom ones?

    • This reply was modified 2 years, 8 months ago by gabriela67.
    Theme Author creativethemeshq

    (@creativethemeshq)

    Hi @gabriela67,
    No, unfortunately there is no way to remove existing gradients.

    Thread Starter gabriela67

    (@gabriela67)

    Thank you, I really appreciate your help.

    Theme Author creativethemeshq

    (@creativethemeshq)

    With pleasure @gabriela67 ??

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘How to add custom gradients’ is closed to new replies.