You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The addition of a relatively utility could make this much simpler.
constprocessDataCols=()=>{constdataCols=document.querySelectorAll(['data-cols']);/* for each data col split out sizes, spans and starts then apply Carbon column classes */[...dataCols].forEach((dataColEl)=>{constattr=dataColEl.getAttribute('data-cols');constcolSizes=attr.split(',');colSizes.forEach((colSize)=>{const[size,value]=colSize.split(' ');constparts=value.split['s'];constspan=parts.pop();if(parts.length>0){conststart=parts.pop();dataColEl.classList.add(`cds--${size}:col-start-${start}`);}dataColEl.classList.add(`cds--${size}:col-span-${span}`);});});}
Reducing the above html to
<divclass="cds--grid"><divclass="cds--css-grid-column" data-cols="sm 4, md 4, lg 7">
7/16
</div><divclass="cds--css-grid-column" data-cols="sm 4, md 4, lg 8s9">
8/16
</div></div>
Thank you for submitting a feature request. Your proposal is open and will soon be triaged by the Carbon team.
If your proposal is accepted and the Carbon team has bandwidth they will take on the issue, or else request you or other volunteers from the community to work on this issue.
The problem
When not using a library or framework that includes a Column component it can be cumbersome and overly verbose to use the Carbon grid.
For example the Carbon tutorial the following for @carbon/react
To achieve the same without the grid component requires the following.
The solution
The addition of a relatively utility could make this much simpler.
Reducing the above html to
Examples
No response
Application/PAL
No response
Business priority
None
Available extra resources
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: