-
Notifications
You must be signed in to change notification settings - Fork 474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🚀 - Customizable Tooltips #1258
Comments
@waterplea if we could use a directive, would that be useful? <div class="my-custom-class" tuiTooltip>
Please don't touch this
<div>
<div class="my-custom-class" [tuiTooltip]="template"><div>
<ng-template #template>Please don't touch this</ng-template> |
I have 2 solutions in my mind. One is to simply add a property Another is to move the styling away from the This approach will allow for overriding default styles. then a cssClass property can switch between the desired class rules. View initial developement here: WynieCronje@34a8634 |
We have some similar problems, but not regarding the tooltip. This pattern (restriction) is also used in other components. Another option would be to add some CSS variables to the styles like: :host {
--tui-component-color: var(--tui-text-03);
--tui-component-bg: transparent;
.transition(color);
position: relative;
display: inline-block;
width: 1.5rem;
height: 1.5rem;
vertical-align: middle;
font-size: 0;
line-height: 0;
cursor: pointer;
color: var(--tui-component-color);
background: var(--tui-component-bg);
...
} Then you can apply something like: .my-namespace tui-tooltip {
--tui-component-color: var(--my-color-var);
--tui-component-bg: pink;
}
tui-tooltip.special {
--tui-component-color: var(--my-other-color-var);
--tui-component-bg: yellow;
} |
So I've been stewing on this for some time and I don't like the idea of passing on the CSS class. Can't really tell why, just a gut feeling. I think I would move P.S. CSS variables won't help here because of portal pattern where DI tree and DOM tree don't match. I really need to make myself write an article on this subject, I've been meaning to for a while now 😀 |
So I have refactored tooltips for 3.0 to be very flexible. However I realize that sometimes one just needs to change a little bit of CSS on the bubble (even we need it with error mode for red bubbles). So I've changed |
Fixed in 3.0 |
Which @taiga-ui/* package(s) are relevant/releated to the feature request?
core
Description
Allow css classes to be added to individual tooltips.
This will allow color changes as well as changing the styles of tooltips as needed.
The text was updated successfully, but these errors were encountered: