diff --git a/base/js/admin.js b/base/js/admin.js index 3bbb10109..7681cb40e 100644 --- a/base/js/admin.js +++ b/base/js/admin.js @@ -264,9 +264,18 @@ var sowbForms = window.sowbForms || {}; // For any repeater items currently in existence $el.find('.siteorigin-widget-field-repeater-item').sowSetupRepeaterItems(); - // Set up any color fields + var canSetupColorPicker = typeof jQuery.fn.wpColorPicker !== 'undefined'; + // Set up any color fields. $fields.find( '> .siteorigin-widget-input-color' ).each( function() { var $colorField = $( this ); + + if ( ! canSetupColorPicker ) { + // We can't load the color picker, so let's convert the field to a color input. + $colorField.attr( 'type' , 'color' ); + + return; + } + var colorResult = '' var alphaImage = ''; diff --git a/compat/beaver-builder/styles.less b/compat/beaver-builder/styles.less index 60afc1369..86aad1fcd 100644 --- a/compat/beaver-builder/styles.less +++ b/compat/beaver-builder/styles.less @@ -41,7 +41,20 @@ } input.siteorigin-widget-input-color { - height: inherit !important; + border: none; + height: 20px; + padding: 0; + width: 40px; + + &::-moz-color-swatch-wrapper, + &::-webkit-color-swatch-wrapper { + padding: 0; + } + + &::-moz-color-swatch, + &::-webkit-color-swatch { + border: none; + } } input.siteorigin-widget-input-measurement {