currently i'm develop a search input component. This component is ussed in multiple regions of my application.
Component has '@inputs' for define bgColor and color of input HTML element.
I usse placeholder for help message. For define placholder color and other CSS properties i need ::-webkit-input-placeholder property.
Problem goes here, when i try to define color of placeholder as same color of input (saved in '@input inputColor' property).
@Component({
selector: 'app-search-input-component',
templateUrl: './search-input.component.html',
styleUrls: ['./search-input.component.less'],
styles: [
'input::-webkit-input-placeholder{ color: ' + this.inputColor + ' }' //I try this but is undefined :(
],
host: {
'[style.display]' : "'flex'"
}
})
export class SearchInputComponent implements OnInit {
@Input()
public placeholder: string = "Search model or manufacturer ...";
@Input()
public inputColor: string = '#ffffff'; // I need apply to placeholder this color
@Input()
public inputBgColor: string = 'rgba(255, 255, 255, 0)';
@Input()
public inputPadding: string = '10px';
@Input()
public inputBorder: string = '1px solid #ffffff';
A lot of thank's to all for your time! Tarik Curto