stevenbenner / jquery-powertip

:speech_balloon: A jQuery plugin that creates hover tooltips.
https://stevenbenner.github.io/jquery-powertip/
MIT License
821 stars 137 forks source link

Add a parameter to choose the coloration style of the tooltip #182

Closed p4535992 closed 2 years ago

p4535992 commented 2 years ago

Add a parameter to choose the color of the tooltip. In practice, a parameter like 'placement' that allows the specific tooltip to use the css file 'jquery.powertip-light.css' instead of the default style. As a solution for now I use the 'popupClass' parameter and manage by editing the css files with some custom class.

stevenbenner commented 2 years ago

I can understand why this could be helpful, but I think it is probably not something that the plugin should handle.

The CSS files that are included with the package are meant as drop-in files needing no configuration, or as templates for developers to adapt to their needs. They all target the same #powerTip ID so you cannot use more than one of those files at the same time without modifications.

I think that they way you're handling this is the best way. Basically modify a theme file to target a specific ID, say #powerTipRed or update the CSS rules to be a class override. Then when setting up the themed plugins set the popupId or popupClass options as needed.

For example:

$('.tips').powerTip({
    popupId: 'powerTipRed'
});
p4535992 commented 2 years ago

K no problem, ty for the hard work and this project