Radium: Add FAQ about ::-webkit-input-placeholder and friends

Created on 6 Jul 2015  路  9Comments  路  Source: FormidableLabs/radium

docs help wanted

Most helpful comment

    <Style scopeSelector='.myInputs' rules={{
        '::-webkit-input-placeholder': {
            color: placeholderColor
        },
        ':-moz-placeholder': {
            color: placeholderColor
        },
       '::-moz-placeholder': {
            color: placeholderColor
        },
        ':-ms-input-placeholder': {
            color: placeholderColor
        }
    }} />

It would be nice if the vendor prefices could be handled like those of transition.

All 9 comments

Is this a question? You can use the <Style> component to change placeholder colors.

I created the issue by mistake, sorry. Thanks anyway for the answer.

    <Style scopeSelector='.myInputs' rules={{
        '::-webkit-input-placeholder': {
            color: placeholderColor
        },
        ':-moz-placeholder': {
            color: placeholderColor
        },
       '::-moz-placeholder': {
            color: placeholderColor
        },
        ':-ms-input-placeholder': {
            color: placeholderColor
        }
    }} />

It would be nice if the vendor prefices could be handled like those of transition.

@ianobermiller is it possible that this is broken?

<Style scopeSelector='.myInputs' rules={{
        '::-webkit-input-placeholder': {
            color: placeholderColor
        },
        ':-moz-placeholder': {
            color: placeholderColor
        },
       '::-moz-placeholder': {
            color: placeholderColor
        },
        ':-ms-input-placeholder': {
            color: placeholderColor
        }
    }} />

produces

.myInputs ::-webkit-input-placeholder{color: green;}.myInputs :-moz-placeholder{color: green;}.myInputs ::-moz-placeholder{color: green;}.myInputs :-ms-input-placeholder{color: green;}

And it should be

.myInputs::-webkit-input-placeholder{color: green;}.myInputs:-moz-placeholder{color: green;}.myInputs::-moz-placeholder{color: green;}.myInputs:-ms-input-placeholder{color: green;}

@alexlande I wrote a hack for this at the moment:

<Style
    scopeSelector={`.${HEADER_INPUT}::-webkit-input-placeholder`}
     rules={STYLES.inputPlaceholderStyles}
/>

Is this considered a complete solution? What about handling auto-prefixing?

I got away with it using the * selector