Comments betterts started the conversationJuly 26, 2020 at 7:58pmHi there,I'm trying to override the default Iris palette to match my theme's colors, since salient palette only extends to certain parts of the theme. However, this is creating a visual issue. Could you help shed light on why?What I'm adding:function new_iris_palette() {?> <script> jQuery(document).ready(function($){ $.wp.wpColorPicker.prototype.options = { palettes: ['#ffffff', '#000000','#ff0', '#0ff', '#f0f', '#0f0', '#00f', '#f00'] }; }); </script><?php}add_action('admin_print_footer_scripts', 'new_iris_palette');add_action('customize_controls_print_footer_scripts', 'new_iris_palette');AttachedBefore.png: Salient DefaultAfter.png: New custom paletteCode-before.png: The salient default palette htmlCode-after.png: The modified palette htmlI'm assuming that I'm overriding some Salient styling somewhere. Could you help me modify my function so that the styling matches? Thank you! 1,085ThemeNectar repliedJuly 27, 2020 at 7:14pmHey betterts, Try to change the snippet to the following: function new_iris_palette() { ?> <script> jQuery(document).ready(function($){ $.wp.wpColorPicker.prototype.options.palettes = ['#ffc1c1', '#000000','#ff0', '#0ff', '#f0f', '#0f0', '#00f', '#f00']; }); </script> <?php } add_action('admin_print_footer_scripts', 'new_iris_palette'); add_action('customize_controls_print_footer_scripts', 'new_iris_palette');--> Cheersbetterts repliedJuly 27, 2020 at 7:21pmWorked perfectly, thank you! Sign in to reply ...
Hi there,
I'm trying to override the default Iris palette to match my theme's colors, since salient palette only extends to certain parts of the theme. However, this is creating a visual issue. Could you help shed light on why?
What I'm adding:
function new_iris_palette() {
?>
<script>
jQuery(document).ready(function($){
$.wp.wpColorPicker.prototype.options = {
palettes: ['#ffffff', '#000000','#ff0', '#0ff', '#f0f', '#0f0', '#00f', '#f00']
};
});
</script>
<?php
}
add_action('admin_print_footer_scripts', 'new_iris_palette');
add_action('customize_controls_print_footer_scripts', 'new_iris_palette');
Attached
I'm assuming that I'm overriding some Salient styling somewhere. Could you help me modify my function so that the styling matches? Thank you!
Hey betterts,
Try to change the snippet to the following:
Cheers
Worked perfectly, thank you!