更改占位符和离子搜索栏的清除图标颜色不是全局的吗? [英] change placeholder and clear-icon color for ion-search bar not globally?

查看:107
本文介绍了更改占位符和离子搜索栏的清除图标颜色不是全局的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个离子搜索栏,我需要更改占位符并清除其中一个的图标颜色。

I have two ion-search bar, I need to change the placeholder and clear icon color for one of them only .

<ion-searchbar class="search-bar"
                placeholder="search"></ion-searchbar>

我需要更改占位符并清除特定于此离子搜索栏的图标颜色不是全局的另一个离子 - 搜索栏仍然会有默认颜色...
任何人都有任何想法。
提前感谢。

i need to change the placeholder and clear icon color specific for this ion-searchbar not globally so another ion-search bar will still have the default colors... anyone have any idea. thanks in advance.

推荐答案

我发现只有css的解决方案:

i found a solution only css:

 .searchbar-input-container{
          .searchbar-input{
            &::-webkit-input-placeholder { /* Chrome/Opera/Safari */
              color: white;
            }
            &::-moz-placeholder { /* Firefox 19+ */
              color: white;
            }
            &:-ms-input-placeholder { /* IE 10+ */
              color: white;
            }
            &:-moz-placeholder { /* Firefox 18- */
              color: white;
            }
          }
          .searchbar-clear-icon{
            filter: invert(100);
          }

将占位符颜色更改为白色
并过滤反转(100 )反映黑色到白色(不是最佳解决方案,而是改变你可以做到的img网址)

change the place holder color to white and filter invert(100) reflect the black to white (not the optimal solution but instead of changing the img url you can do that)

这篇关于更改占位符和离子搜索栏的清除图标颜色不是全局的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆