kallookoo / wp-color-picker-alpha

Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker
GNU General Public License v2.0
132 stars 88 forks source link

Don't change input width using Javascript #2

Closed bfintal closed 8 years ago

bfintal commented 8 years ago

I'm adding wp-color-picker-alpha in Titan Framework to allow rgba values in our color options.

Can we remove this:

// Update width for input
if ( self._color._alpha < 1 || self._color.toString().indexOf('rgb') != 1 ) {
    el.width( parseInt( self.options.defaultWidth+100 ) );
}

Instead, people can just modify the width using CSS if they want:

.wp-color-picker[data-alpha="true"] {
    width: 165px;
}

Reason for request: adding +100 to the width makes the control wrap to the next line when used in the Customizer, and since JS is used, I can only get rid of the modified width is by using javascript also or by !important

kallookoo commented 8 years ago

I added an option to disable or change the size of the input, I personally prefer view everything, but it's true I did not think the Customizer

bfintal commented 8 years ago

I can work with data-custom-width. Titan Framework is now using wp-color-picker-alpha. Very awesome work @23r9i0

https://github.com/gambitph/Titan-Framework/commit/add432dcb198cd5063a501c6a14a0d088a830cb2