可使用样式属性来实现以下部分样式。在条件允许时,建议使用样式属性,而非 CSS。 |
CSS | 说明 | 预览 |
---|---|---|
@supports (ptcs-style-unit: "PTCS-BUTTON.primary") { :host { background-color: red !important; border-color: blue; border-width: 2px; } } | 将按钮的背景颜色设置为红色,并应用蓝色边界。 | |
@supports (ptcs-style-unit: "PTCS-BUTTON.danger") { [part=label] { color: Blue; font-style: Italic; } } | 将按钮危险变型的标签颜色设置为蓝色,将字型设置为斜体。 | |
@supports (ptcs-style-unit: "PTCS-BUTTON.primary") { :host(:not([disabled]):hover) { border-color: red; border-width: 2px; } } | 悬停状态激活后,按钮周围将显示红色边界。 |
CSS | 说明 | 预览 |
---|---|---|
@supports (ptcs-style-unit: "PTCS-TEXTFIELD") { [part=clear-button] { color: red; } } | 将清除按钮的颜色设置为红色。 | |
@supports (ptcs-style-unit: "PTCS-TEXTFIELD") { [part=text-box] { border-color: red; } } | 将文本框边界的颜色设置为红色。 | |
@supports (ptcs-style-unit: "PTCS-TEXTFIELD") { [part=counter] { color: red; } } | 将字符计数器的颜色设置为红色。 |
CSS | 说明 | 预览 |
---|---|---|
@supports (ptcs-style-unit: "PTCS-DROPDOWN") { [part=label] { color: red; } } | ||
@supports (ptcs-style-unit: "PTCS-DROPDOWN") { [part=icon] { color: red; } } | ||
@supports (ptcs-style-unit: "PTCS-DROPDOWN") { [part~=selected-item-value] { color: red; } } | 将选定项的值的颜色设置为红色。 | |
@supports (ptcs-style-unit: "PTCS-DROPDOWN") { [part=select-box] { background-color: red; border-color: blue; border-width: 2px; } } | 将下拉列表的背景颜色设置为红色,将边界设置为蓝色。 |
CSS | 说明 | 预览 |
---|---|---|
@supports (ptcs-style-unit: "PTCS-CHART-AXIS") { [part=label] { color: red; } } | 将图表轴的颜色设置为红色。 | |
@supports (ptcs-style-unit: "PTCS-CHART-CORE-BAR") { [part=bar] { border-top-left-radius:15px; border-top-right-radius:15px; } } | 圆角化列的右上角和左上角。 | |
@supports (ptcs-style-unit: "PTCS-CHART-CORE-BAR") { [part=value] { color: red; font-style:bold; font-size:16px; } } | 设置列数据标签的颜色和字型。 |