javascript - CSS 不适用于自定义工具提示的箭头
问题描述
我正在使用ReactTooltip
零件
<ReactTooltip className={styles.customTheme} id={id} place={placement} effect="solid">
{children}
</ReactTooltip>
SCSS
.customTheme {
color: #ff6e00 !important;
background-color: orange !important;
&.place-top {
&::after {
border-top: 6px solid orange !important;
}
}
}
结果
问题
箭头颜色未按预期更改。
解决方案
你很近。你的 SCSS 只需要::before
伪选择器。
.customTheme {
background-color: #ff6e00 !important;
border: 1px solid;
&.place-top {
&::before, &::after {
border-top: 8px solid #ff6e00!important;
}
}
请注意,您应该只能在组件上使用backgroundColor
and/orarrowColor
道具,但它们不起作用:https ://github.com/wwayne/react-tooltip/issues/594
推荐阅读
- linux - 构建 docker:未找到 opt/conda/bin/conda
- javascript - 如何将我的值附加到谷歌电子表格 OAUTH/GAPI js
- amazon-web-services - AWS 中的密码格式的秘密
- python - KivyMD - MDRectangleFlatButton - 按钮阴影动画太慢
- css - 如何在不使用绝对定位的情况下使用内联伪元素将元素包裹在内联元素周围
- reactjs - 反应属性映射问题
- node.js - Azure 管道中的数据库迁移
- sql-server - 如何仅检索 SQL Server 数据库模型的用户定义属性
- angular - Angular 指令从 NgModel 或 FormControlName 获取值
- php - 如何获取数组的每个元素