Skip to content
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

[switch]: Should author defined content be allowed on the thumb? #979

Open
gfellerph opened this issue Jan 19, 2024 · 3 comments
Open

[switch]: Should author defined content be allowed on the thumb? #979

gfellerph opened this issue Jan 19, 2024 · 3 comments
Labels
stale switch Switch control

Comments

@gfellerph
Copy link
Collaborator

This is a sub-ticket of #959 which did not reach a resolution at the discussion on the call of Nov 30, 2023 (#959 (comment)).

Should authors be able to add text or image content to the thumb element?

image

@gregwhitworth gregwhitworth added the agenda+ Use this label if you'd like the topic to be added to the meeting agenda label Jan 31, 2024
@gfellerph
Copy link
Collaborator Author

Here is a demo of what <input type="checkbox" switch> looks like in Safari Technology preview: https://nt1m.github.io/html-switch-demos/

image
Screenshot taken from whatwg/html#9546 (comment)

@css-meeting-bot
Copy link

The Open UI Community Group just discussed [switch]: Should author defined content be allowed on the thumb?, and agreed to the following:

  • RESOLVED
  • RESOLVED: PROPOSED RESOLUTION: allow img/svg content (excluding <foreignObject>) within the thumb of the switch
The full IRC log of that discussion <gregwhitworth> scribenick: Travis
<gregwhitworth> q+
<Travis> philipp: Question is simple: should text/image/etc. content be allowed on the DOM of the switch (the little dot that moves around). Next issue, should it be allowed on the track?
<Travis> gregwhitworth: It's shipping in beta in Safari now.
<Travis> .. in pseudo elements, it allows content.
<Travis> .. overloaded topic. Would prefer to answer, should it allow complex content?
<Travis> .. this is why I split up the checkbox proposal (lots of examples of complex content) like SVG.
<Travis> .. I think the pseudo is a great stop-gap.
<Travis> .. There are so many scenarios where folks are going to want to do it. Yes, unicode chars are ok, but folks will want more.
<scotto_> q+
<Travis> .. I doubt this will go into the input type=checkbox (switch attribute)
<gregwhitworth> ack gregwhitworth
<gregwhitworth> ack scotto_
<Travis> scotto_: Interesting that WHATWG has allowed an attribute on the checkbox to change it.
<bkardell_> scotto_: is it because one has children?
<Travis> .. but seems to be pushback on XXX.
<bkardell_> s/XXX/select
<Travis> .. I agree with gregwhitworth that people should be able to put images, etc.
<Travis> .. It could be unfortuante if we allow one thing, then it will allow everything.. which will lead to issues.
<Travis> gregwhitworth: I'm not opposed to limiting to SVG/images...
<Travis> .. would love to hear from philipp on this.
<Travis> .. are there scenarios where...
<Travis> .. there should be no interactive children (agree with this).
<Travis> .. philipp did you see any scenarios where they were complex?
<Travis> .. If we say SVG, then does that lead to complex SVG-with-HTML...
<Travis> philipp: No, most use cases I saw were very simple.
<Travis> .. mostly it was a checkbox on the thumb
<gregwhitworth> q?
<Travis> .. and on the track: text that was "on" or "off"
<Travis> gregwhitworth: what about this scenario? Tooltips that stay snapped to the thumb.
<keithamus> q+
<Travis> .. CSS WG is ensuring that name for progress thing is same as switch thing.
<Travis> .. we should make sure they are aligned.
<Travis> .. would you envision similar children being those tooltips?
<Travis> .. or would they be siblings that could be aligned (and thus contain SVG/etc.)
<Travis> .. ?
<Travis> philipp: don't have a lot of experience with anchor position, but think that would match the moving tooltip nicely.
<Travis> gregwhitworth: from a blueprint perspective... we're going to say WHATWG needs to figure out a new way to allow complex children to exist.
<Travis> keithamus: the other thing I wanted to mention (implementation-wise): it would be great to not worry about anchor positioning for switch (versus others that are unbounded)
<gregwhitworth> q?
<gregwhitworth> ack keithamus
<Travis> .. also, safari tech preview also enabled alts for content.
<Travis> .. resolves some potential a11y concerns about how to resolve complex content that needs description.
<Luke> q+
<Travis> gregwhitworth: if your SVG is a checkbox then transitions into an X...
<Travis> .. I saw that when doing checkbox research (a transformation using complex SVG)
<gregwhitworth> ack Luke
<Travis> Luke: Point 1: current impl allows content, but only on ::before ::after pseudos.
<Travis> .. I also think it would be useful if it could support children.
<Travis> .. Is there a mechanism that could allow that to work now?
<Travis> masonf_: Is it clear it doesn't work?
<Travis> Luke: Well, haven't actually tried. If it works, that could allow some complicated children use cases.
<Travis> .. otherwise, I would prefer to limit it.
<Travis> .. for reasons already said.
<Travis> .. we can always make it more complicated in the future.
<Travis> gregwhitworth: well, disagree. Some incompatibilities can creep in even using that approach.
<Travis> .. I here there is general agreement that there could be complex children for img/svg, but not for other types.
<Travis> philipp: PROPOSED RESOLUTION: allow img/svg content (excluding <foreignContent>)
<gregwhitworth> Travis: isn't there something in the SVG spec that keeps it to just the raw image
<Travis> gregwhitworth: Don't disagree if that exists, but it might limit the scenario of transforming an SVG
<Luke> +1
<Travis> .. also add "within a switch"
<keithamus> +1
<philipp> PROPOSED RESOLUTION: allow img/svg content (excluding <foreignContent>) within the thumb of the switch
<scotto_> +1
<keithamus> +1
<masonf_> +1
<philipp> PROPOSED RESOLUTION: allow img/svg content (excluding <foreignObject>) within the thumb of the switch
<keithamus> +1 still
<philipp> RESOLVED
<philipp> RESOLVED: PROPOSED RESOLUTION: allow img/svg content (excluding <foreignObject>) within the thumb of the switch

@gregwhitworth gregwhitworth removed the agenda+ Use this label if you'd like the topic to be added to the meeting agenda label Feb 13, 2024
@mfreed7 mfreed7 added the switch Switch control label Feb 21, 2024
Copy link

There hasn't been any discussion on this issue for a while, so we're marking it as stale. If you choose to kick off the discussion again, we'll remove the 'stale' label.

@github-actions github-actions bot added the stale label Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale switch Switch control
Projects
None yet
Development

No branches or pull requests

4 participants