-
Notifications
You must be signed in to change notification settings - Fork 12
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
Default direction and border customization #41
Comments
Hi Serge, thank you for raising an issue. This is not currently implemented, but this is definitely something I can build into the next minor version (v1.7.0) as it will have no breaking changes to existing projects using Cooltipz.css. |
Great! Looking forward to it! Another helpful feature would be to customize the "border" (and its color) of the tooltip. |
Can definitely look at the border customisation. Unfortunately, due to it being CSS-only and being styled on the |
Any idea why in the link I sent above, which also uses the "::after" approach, the tooltip works on the "input" tags and cooltipz doesn't? |
This is interesting. It looks like Chrome has started implementing support for pseudo-elements on self-closing elements. But it doesn't appear to work in Firefox (can't test Safari as I don't own an Apple device). Why it doesn't work on Chrome for Cooltipz.css, I do not know at a glance but I will take a look for the next version. My prediction is fixing this won't have breaking changes, it will just rely on browser support. |
After more investigation on the psuedo-elements on self-closing elements, please find below what I've been able to discover but cannot find any resources that explain why: I only demoed a few elements to get a feel for what's going on
The above findings are also true when I replace your demo tooltip with a Cooltipz.css tooltip. However, this is not recommended at all since With the above interesting issue researched and concluded, I will be happy to look into the other suggestions you provide. |
After some research on the default direction, I have concluded that it should not be implemented. It will cause breaking changes if I implement (I shouldn't have prematurely stated that it wouldn't without investigation). I could implement and release it as a new major version but the point below is the main reason why I will not be implementing it. Take the below HTML as an example for this explanation: <span data-cooltipz-dir="top" aria-label="Helpful tip">Hover me</span> If we implemented a default direction, this would eliminate the need for <span aria-label="Helpful tip">Hover me</span> This leaves us with a problem. Cooltipz.css, as a third-party package cannot safely assume that every element with We could refactor to use something like Therefore, remaining with the current method of defining a direction and a |
The customisable tooltip border will be available in v1.7.0 |
I am not sure I follow your logic why
If the default behavior is defined in the cooltipz's config via a new custom css feature, only then all tags with the |
If, as you say, I implement a way of defining a custom direction in the Cooltipz.css config, this would remove the need for <span aria-label="Message">Hover me</span> This means the Cooltipz.css CSS will be looking for It's a good idea, but unfortunately I don't think the pros outweigh the cons. Thank you for contributing. |
Is there a way to specify the default direction in css, so that for each definition of the tooltip in an html element (e.g.
<div aria-label="...">...</div>
, it's not necessary to adddata-cooltipz-dir="top"
)? The documentation only shows customization of other properties such as color, but not the direction.The text was updated successfully, but these errors were encountered: