admin管理员组文章数量:1290779
I'm using tippy.js for my browser and they'd been working fine until this morning. Suddenly, they won't respond to any CSS styling and just revert to the default dark grey background with a border radius. They respond to changes in the script though, like making them follow the cursor. Here's the script, I tried reinstalling a lot of it but I don't know what's happening.
<!-- Development -->
<script src="/@popperjs/core@2/dist/umd/popper.min.js"></script>
<script src=".js@6/dist/tippy-bundle.umd.js"></script>
<!-- Production -->
<script src="/@popperjs/core@2"></script>
<script src=".js@6"></script>
<script>
tippy('[title]', {
theme: 'custom',
arrow: false,
followCursor: true,
content(reference) {
const title = reference.getAttribute('title');
reference.removeAttribute('title');
return title;
},
});
</script>
Here's the CSS, the stuff that's not working.
.tippy-tooltip.custom-theme {
background-color: #f7f7f7;
color: black;
border:1px solid #ededed;
border-radius:0;
}
I'm using tippy.js for my browser and they'd been working fine until this morning. Suddenly, they won't respond to any CSS styling and just revert to the default dark grey background with a border radius. They respond to changes in the script though, like making them follow the cursor. Here's the script, I tried reinstalling a lot of it but I don't know what's happening.
<!-- Development -->
<script src="https://unpkg./@popperjs/core@2/dist/umd/popper.min.js"></script>
<script src="https://unpkg./tippy.js@6/dist/tippy-bundle.umd.js"></script>
<!-- Production -->
<script src="https://unpkg./@popperjs/core@2"></script>
<script src="https://unpkg./tippy.js@6"></script>
<script>
tippy('[title]', {
theme: 'custom',
arrow: false,
followCursor: true,
content(reference) {
const title = reference.getAttribute('title');
reference.removeAttribute('title');
return title;
},
});
</script>
Here's the CSS, the stuff that's not working.
.tippy-tooltip.custom-theme {
background-color: #f7f7f7;
color: black;
border:1px solid #ededed;
border-radius:0;
}
Share
Improve this question
asked Jan 13, 2021 at 13:32
user14727395user14727395
2
- a jsfiddle or a code snippet would be nice. and shouldn't the css selector be: .tippy-tooltip[data-theme~='custom']? – Ofir Baruch Commented Jan 13, 2021 at 13:37
- I told the other person in a ment where it is if you want to take a look as well – user14727395 Commented Jan 13, 2021 at 13:47
1 Answer
Reset to default 8Instead of this .tippy-tooltip.custom-theme
use .tippy-box[data-theme~="custom"]
Rest will be the same
.tippy-box[data-theme~="custom"] {
background-color: #f7f7f7;
color: black;
border: 1px solid #ededed;
border-radius: 0;
}
Codepen: https://codepen.io/manaskhandelwal1/pen/poExBZE
Documentation: https://atomiks.github.io/tippyjs/v6/themes/#creating-a-theme
本文标签: javascripttippyjs tooltips not responding to css stylingStack Overflow
版权声明:本文标题:javascript - tippy.js tooltips not responding to css styling - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741509085a2382499.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论