Re: [csswg-drafts] OS cursor size units and property (#12048)

Thanks for the comments thus far. I'd like to address a few of the points.

> Though... does the result of the calculation need to be exposed? If this uses something like a % instead of a special unit, then it could just serialize back to that same percentage. I'm not aware of a way for web content to read the current cursor.

The reason why I'd be interested in providing a `cur` value is when the `cursor` property is not appropriate. The example I have in the original post is when the cursor content is dynamic. This is common for sites that make the cursor change when hovering an element. This is usually done by getting the `x, y` of the cursor and then repositioning a DOM element to be at that location. Adding the `cur` size could ensure that the minimum size is met.

```css
.some-animated-blob {
  min-width: 1cur;
}
```

> Alternatively: Just spec that browser vendors should respect the OS's cursor scale and automatically scale any cursor images to match. I don't think that's observable, and it means websites just work without authors having to worry about this.

That would be fine at a minimum, but it does miss the use-case of dynamic cursors using DOM elements. Unless you'd expect to have a keyword added to `width` et al that represents the current cursor size. I'd think the introduction of `cur` would just end up being more flexible overall.

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


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

Received on Friday, 4 April 2025 11:34:26 UTC