runem / web-component-analyzer

CLI that analyzes web components and emits documentation
https://runem.github.io/web-component-analyzer
MIT License
504 stars 64 forks source link

Feature request: document CSS shadow parts #109

Closed web-padawan closed 4 years ago

web-padawan commented 5 years ago

CSS shadow parts are available in Chrome 73+, Firefox 69 + (behind a flag) and WebKit nightly. They are important part of the public CSS API, e.g. we are using part in Vaadin components.

Let me suggest a syntax to document CSS Shadow Parts like this:

@csspart thumb - A part representing a switch thumb
@csspart track - A part representing a switch track
@csspart track-fill - An inner part (child of "track")  

Parsing should be most likely the same as for Custom CSS properties.

If you think this feature would be a nice addition, I could try to submit a PR.

runem commented 5 years ago

I would very much like this feature to web-component-analyzer! I'm in the process of refactoring on a separate branch for performance, so if it's okay I'll add this feature based on that branch. I expect to be finished within a week. I'll keep you updated :+1:

Is exportparts still a part of the spec? If so, do you think it would be a good idea to look into if it's possible to handle this concept as well? Even though this would, however, perhaps require WCA to be able to read HTML which I think might be out of scope for this project :-)