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

CustomStateSet plus using custom elements #30566

Merged
merged 10 commits into from
Dec 8, 2023

Conversation

hamishwillee
Copy link
Collaborator

@hamishwillee hamishwillee commented Nov 27, 2023

This updates CustomStateSet and Using custom components to reflect the addition of support for exposing states from a custom web component so that they can be used as a selector for CSS.

Note, it also moves CustomStateSet and ElementInternals into the Web Components sidebar rather than DOM sidebar - of course all of these are also DOM, but they can only be used in custom components.

Things to do.

  • CustomStateSet
    • needs to show how to attachInternals - you can't use this otherwise.
    • Text incorrectly refers to it as CustomStateList
    • Structure needs to follow current templates
    • Example is cut down version of the spec checked state checkbox thingy. Better to either show whole thing or a different example.
    • Omits how you handle multiple non-boolean states. Perhaps a loading, non, loading state like spec but worked.
    • I think these can only be done with automatic components, not built ins. Confirming.
  • Using custom components - cross link and at least outline what you can do.

Related docs work in #30339

@github-actions github-actions bot added the Content:WebAPI Web API docs label Nov 27, 2023
Copy link
Contributor

github-actions bot commented Nov 27, 2023

Preview URLs (66 pages)
External URLs (2)

URL: /en-US/docs/Web/API/HTMLElement/attachInternals
Title: HTMLElement: attachInternals() method


URL: /en-US/docs/Web/API/CustomStateSet
Title: CustomStateSet

(comment last updated: 2023-12-08 01:31:29)

@hamishwillee hamishwillee marked this pull request as ready for review November 28, 2023 06:28
@hamishwillee hamishwillee requested review from a team as code owners November 28, 2023 06:28
@hamishwillee hamishwillee requested review from wbamberg and bsmth and removed request for a team November 28, 2023 06:28
@wbamberg wbamberg removed their request for review December 4, 2023 19:47
@hamishwillee
Copy link
Collaborator Author

Thanks for the review @bsmth - very helpful. I've merged the changes with very minor modifications. Yes, this example doesn't work properly on FF. I'm OK with that while it is behind a preference. It matches the spec, and works on chrome.

@bsmth
Copy link
Member

bsmth commented Dec 8, 2023

very helpful. I've merged the changes with very minor modifications.

Super, thanks!

This example doesn't work properly on FF. I'm OK with that while it is behind a preference. It matches the spec, and works on chrome.

Agreed, looking good!

Copy link
Member

@bsmth bsmth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Hamish, merging shortly 🚢

@bsmth bsmth merged commit ce10da0 into mdn:main Dec 8, 2023
8 checks passed
@hamishwillee hamishwillee deleted the ff121_customstateset_updates branch December 8, 2023 20:51
dipikabh pushed a commit to dipikabh/content that referenced this pull request Jan 17, 2024
* CustomStateSet plus using custom elements

* ElementInternals is WebComponent specialization of DOM

* CustomStateSet is WebComponent specialization of DOM

* Add ElementInternals and CustomStateSet to the WebComponents API

* CustomStateSet - correct and uses the checkbox

* Cross link to Using custom elements

* Make my custom element a block element

* Fix up to use annoying heading separaters meh

* Apply suggestions from code review

Co-authored-by: Brian Thomas Smith <brian@smith.berlin>

* Apply suggestions from code review

---------

Co-authored-by: Brian Thomas Smith <brian@smith.berlin>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants