Re: [csswg-drafts] [css-forms-1] `control-value()` function (#7869)

I really appreciate everyone's thoughts, discuss this.

@Crissov I really like the pseudo attributes you proposed in #354, especially those for numeric comparisons (e.g. `==`, `%=`, `>`, `>=`, `<`, `<=`, `!=`). I would love to see that gain some traction alongside `:control-value()`.

@tabatkins I would love to hear any feedback you have my previous comment's points
- boolean type
  
  As we progress into CSS `@function`, `if()` and other checks, it seems that we'll eventually need a `<boolean>` type)
- scoping
  
  Should a control value be accessible from outside its DOM element? I think you could add a lot of value for different elements on a page to be able to reference a control value. Perhaps
  
  Maybe the syntax could be
    - `:control-value()` - reference the value of the current element (assuming it is a control)
    - `:control-value(name)` - reference the value of a control by name within the same scope (will match the closest `form` as the scope by default if the control is a descendant of a `form`, otherwise the closest scope, possibly `:root`)
    - `:control-value(name scope)` - reference the value of a control by name within a different scope (scope argument accepts form IDs or scope identifiers, e.g. `:root` or `:scope`)

-- 
GitHub Notification of comment by brandonmcconnell
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7869#issuecomment-2779265987 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 16:43:39 UTC