JSFiddle - React, Tailwind, and code Playground

by godfrzero

HTML

<input type="radio" id="radio1" name="radios" >
<input type="radio" id="radio2" name="radios" >
<div id="textInputWrapper">
    <input type="text" id="textInput">
</div>

CSS

#textInputWrapper:not(.gradient) {
  width:100%;
  background: #17a2dc;
}

/* Move the gradient style declaration after the #textInputWrapper declaration */
.gradient {
  background: -moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(188,188,188,1) 52%,     rgba(126,126,126,1) 100%); /* FF3.6+ */
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0)), color-stop(52%,rgba(188,188,188,1)), color-stop(100%,rgba(126,126,126,1))); /* Chrome,Safari4+ */
  background: -webkit-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(188,188,188,1) 52%,rgba(126,126,126,1) 100%); /* Chrome10+,Safari5.1+ */
  background: -o-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(188,188,188,1) 52%,rgba(126,126,126,1) 100%); /* Opera 11.10+ */
  background: -ms-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(188,188,188,1) 52%,rgba(126,126,126,1) 100%); /* IE10+ */
  background: linear-gradient(to bottom, rgba(255,255,255,0) 0%,rgba(188,188,188,1) 52%,rgba(126,126,126,1) 100%); /* W3C */
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#7e7e7e',GradientType=0 ); /* IE6-9 */
  border:7px white solid;
}

JavaScript

$('input[type=radio]').click(function () {
    // $('#textInputWrapper').css('background', ' #17a2dc');
    $('#textInputWrapper label').css('color', 'white');
    $('#textInputWrapper').removeClass('gradient');
});
$('#textInput').click(function () {
    $('#textInputWrapper label').css('color', '#606060');
    $('#textInputWrapper').addClass('gradient');
});