I recently joined a team where one other front end dev had started a Pattern Lab for a UI component design system. Note: we're using the PHP/mustache version of Brad Frost's Pattern Lab. In my coworker's attempt to make it very flexible and future-friendly, we're trying to decide if the below is a smart way of building a component library or not.
Here's an example of a basic radio button (a default and disabled status):
<div class="atoms-radio-button">
</div>
<div class="atoms-radio-button">
</div>
and the json:
"inputRadio" : {
"type": "radio",
"name": "...",
"id": "inputRadio",
"value": "...",
"checkedstate": "",
"arialabel": "",
"ariadescribedby": "",
"disabled": ""
},
"inputRadioDisabled" : {
"type": "radio",
"name": "...",
"id": "inputRadioDisabled",
"value": "...",
"checkedstate": "",
"arialabel": "",
"ariadescribedby": "",
"disabled": "disabled"
},
"inputRadioGroup" : {
"type": "radio",
"name": "...",
"id": "inputRadioGroup",
"value": "...",
"checkedstate": "",
"arialabel": "",
"ariadescribedby": "",
"disabled": ""
}
And as you build up the Pattern Lab, you include partials so some files are mostly or all partials. He believes this allows for maximum variability and flexibility over time but the time upfront to break everything down this way is, of course, substantial versus simply writing standard HTML. My question is ... Is this overkill? Is it sustainable to develop this way and keep our sanity? Does anyone else build their component library in a similar way? Or have a better solution?
Aucun commentaire:
Enregistrer un commentaire