Ionic modifies the built-in class style of the control

background

使用ionic中控件,有时候他的样式不能满足实际开发需求,需要改改一些样式。

ion-datetime

Time control, I want to modify the default white background
insert image description here
After modification:
insert image description here
Code:
Add attributes to the root pseudo-class in the variables.scss file

:root {
    //修改时间控件的背景颜色
    ion-picker .picker-wrapper{
      background-color: #3880ff;
    }
  }

Summarize

F12 analyzes the element, finds the corresponding control and class, and then writes the attribute to the root class in variables.scss. Other styles are changed in the same way. If you change it now, the global style has been changed, and you can change it in a certain datetime control alone. I don’t know how to change it yet. If anyone knows, please let me know, thank you.
insert image description here

Guess you like

Origin blog.csdn.net/qwe1314225/article/details/109156468