Re: position: pointer

In the draft spec I addressed that topic a bit in a note, but the behavior
in the case where the user has no pointer needs to be thought of. My
suggestion is to unify the behavior, i.e. make the position of the element
the user's current point of interest, be it the pointer position, and if
none, focused element or caret position when applicable. After all, the
caret can be also be thought of as a sort of a pointer. Obviously using
this technique to display tooltips for users without pointers needs a
little bit more effort from the developer, namely making the elements that
have tooltips focusable and if you using the selector example I provided,
extend it a bit to be `:not(:hover, :focus) + .tooltip`, but making
elements focusable is essential for accessibility anyway.

Cheers,
Jussi

On Tue, Oct 9, 2012 at 1:45 PM, Andrew Thompson <lordpixel@mac.com> wrote:

> Logically, wouldn't one also want to add position: caret to cater for
> those people using caret based browsing?
>
> Or alternatively specify what happens if the browser is in caret mode? If
> one of the use cases for this is hover effects that follow the user's
> current point of interest, that would be the caret not the pointer if a
> caret exists?
>
>
> On Oct 9, 2012, at 6:20 AM, Jussi Kalliokoski <jussi.kalliokoski@gmail.com>
> wrote:
>
> As per Brian Kardell's suggestion, and seeing that this might go
> somewhere, I threw together a quick spec draft for the proposal [1].
>
> Cheers,
> Jussi
>
> [1] http://fs.avd.io/css-pointer-position/
>
> On Mon, Oct 8, 2012 at 8:08 PM, Jussi Kalliokoski <
> jussi.kalliokoski@gmail.com> wrote:
>
>> Hi everyone,
>>
>> I wanted to discuss the possibility of adding a new `position` type
>> called `pointer`. I came up with the idea as I was thinking about how
>> limited `title` attribute tooltips are, which made me check out the JS
>> libraries for the purpose, which are crappy as well, and I think JS
>> shouldn't be needed for "simple" positioning of elements like this (there
>> may be a few cycles to save here as well). The idea is pretty simple, it
>> works kinda like absolute or fixed position (in that the element is
>> floating), but the given coordinates are relative to the main pointer
>> position.
>>
>> This would let you make tooltips in pure CSS and HTML (not to mention
>> that you could recreate those stars flying around the mouse from the 90s
>> with just CSS and HTML ;). I made a small demo [1] [2] to give a better
>> picture of what I mean. The actual demo uses a silly JS shim, and I think
>> the smoothness speaks for itself about how unsuitable JS is for this kind
>> of functionality.
>>
>> Looking forward to feedback!
>>
>> Cheers,
>> Jussi
>>
>> [1] (code) https://gist.github.com/3853601
>> [2] (result) http://labs.avd.io/position-pointer/
>>
>
>

Received on Tuesday, 9 October 2012 11:05:53 UTC