Re: [csswg-drafts] Proposal: Expose Pointer Position Information on Hovered Elements (#6733)

@Loirooriol 

> Starting with `--` would break this promise

Ah yes. Started off with Custom Properties in my explorations, and then worked my way back to something proposal-y which uses Env Vars but forgot to remove  the `--` prefix in the process.

> Also, sometimes you use `var()` and sometimes `env()`

In the part where I compare the various coordinate systems I indeed use `var()` as they were code explorations built with Custom Properties. These snippets are more meant to illustrate the side-effects of the used coordinate system.

> Environment variables must have the same value everywhere, can't depend on the element.

Oh, that I did not know. This would indeed make env vars not part of a possible solution here.

> pseudo-classes are just a way to select elements. They shouldn't which CSS features you can use in these elements.

I started off from hover and built from there. I'm sure WG has better solutions to this that align with all other existing things :)

---

@tabatkins 

> env() values aren't allowed to change based on context

Time for a new function? j/k 🙃

> Maybe another value to control whether they return a `<length>` or a `<percentage>`, since I can see use-cases for both and you can't easily convert between them.

In my experimentation I found that "percentage expressed as a float" hit the sweet spot:

- Mutiply by 100% to get a percentage
- Multiply by `qi`/`qb` to get a length

Could of course be that I'm overlooking things here.



-- 
GitHub Notification of comment by bramus
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6733#issuecomment-945073271 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Sunday, 17 October 2021 08:33:56 UTC