Open lukewarlow opened 9 months ago
A syntax such as that below could be used instead allowing you to show nesting and then this could be converted to an actual HTML representation of the anatomy for display in the UI. Would have to think pseudo and legacy-pseudo would be optional and only really useful for browsers. Perhaps a more generic name could be thought of that would be shared with other design systems "slots and parts". But just an initial idea?
"anatomy": [
{
"name": "slider-container",
"legacy-pseudo": "-webkit-slider-container",
"children": [
{
"name": "track",
"pseudo": "slider-track",
"legacy-pseudo": "-webkit-slider-runnable-track",
"children": [
{
"name": "thumb",
"pseudo": "slider-thumb",
"legacy-pseudo": "-webkit-slider-thumb"
}
]
}
]
}
],
The Open UI Community Group just discussed Improve design system anatomy JSON Schema and display
.
The Open UI Community Group just discussed Improve design system anatomy JSON Schema
, and agreed to the following:
RESOLVED: Improve design system schema to account for anatomies
ACTION: luke open issue for naming of parts and slots
@lukewarlow as you were presenting this it dawned on me that we may want to actually standardize a web component schema. Then a colleague internally who works on one of our builders reached out about the potential for something along these lines and I remembered the WC manifest spec. Should we align schema with that proposal: https://github.com/webcomponents/custom-elements-manifest
Huh that looks pretty neat. I think that's a good idea. Will be quite exhaustive that way.
Do we want to discuss that or should I just go ahead and do it? @gregwhitworth
@lukewarlow I don't think we need to discuss this at this moment; however I'm intrigued at your "quite exhaustive" statement as maybe we should influence that spec/proposal for changes? For now just land in the direction you were already heading and possibly do a draft that follows that proposal? @mfreed7 fyi since you requested the naming of "parts and slots" issue and if we do decide to adopt the WCCG schema then it may already be covered.
I noticed our schemas were lacking in other places https://github.com/openui/open-ui/issues/875 that I think that above one could handle (events for example) and others that it might not handle (state pseudos see https://github.com/webcomponents/custom-elements-manifest/issues/113) that we can upstream.
In that case I have the open PR that we can land get the browser follow up one in aswell and then I can work on a draft using the linked schema.
I'm happy to iterate on this and migrate between them as time goes on so the duplicate work isn't an issue for me.
@gregwhitworth on the topic of upstreaming improvements, I've made a PR to add custom state to the schema which we can use for both design systems proper and also for browser pseudo classes.
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.
THe PR mentioned above got merged. So when I've got some time I'll pick this back up and see what I can come up with.
Currently the anatomy that can be defined for a component in a design system is rather limited. Just an array of names with a description.
It's also displayed rather simply
It would be good to be able to represent the structure in an anatomy like we can in our anatomy proposals. It would also be good to display the anatomies in a way more akin to the concepts where the various design systems have their anatomies displayed and labelled with where the anatomy comes from.
This would make it far easier to turn these anatomies into a proposal with confidence that we cover X% of design systems.