-
Hi everyone, Currently paste components do not allow us to add classNames. This makes things a bit difficult when we want to add some custom styling if those properties are not exposed by Paste. The work around we use is to wrap them in another element and give that element a className then add stylesheet on that class or using styled component (@twilio-paste/styling-library). Is there a better way to do all this? So we don't need to create an extra element just to pass in some additional stylings? Also, is there an example of good practice project using Paste we can refer to? Thanks for the help. 🙇 |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
There's a couple of topics covered here and I'll try my best to cover them as best I can. When using Paste to build Twilio products there are some expectations set on what process to follow. Part of that process is ensuring that what we put in front of users is well researched and vetted within the UX organization, plus robust and accessible. We want the very best user experience so we put a lot of up front effort into design process of our components. As a result, we don't necessarily want that work to be degraded or removed without critical reasoning, peer review and use of a cohesive design language. This is the main reason around our design decision to not allow direct, uncontrolled customization of our components. Whilst we are acutely aware that a Design System cannot do and hold everything that is needed for each individual product, and that extension and customization is the key to a successful Design System at scale, we will not be providing that functionality via a custom classname. We won't be doing this for a number of reasons:
Above all, custom classnames erode trust in the system, the components, the product and adversely affect the trust of the customer. Customization and extension will be provided, but it will be provided via a controlled API, within the constraints of the Design System. More on that soon. In the meantime we have a number of existing mechanisms for product teams to use to ship their product features. The first part is process based. There should be regular design critique sessions for a designer to attend to get feedback on their designs and Paste usage. There are also twice weekly Design System Office hours to ask questions about component use and design. In these forums designers can present challenges, or research that suggests that a component within the system doesn't address the customer need. Upon receiving this feedback the Design System team can offer advice, reasoning and alternative suggestions, but most importantly use that feedback to improve the system for everyone else who uses it. The second part is based on the way we designed the system and our component APIs. A lot of our components accept any children due to the flexibility we want to provide to consumers. Here, components can take any styled content that solves that particular customer problem. What this does is keep a cohesive overall design, structure and interaction to all the base components whilst allowing you to display your data to the user in any format you wish. If that still isn't meeting the customer need, the system provides Component Primitives. Primitives come in 2 forms; functional and design. A design primitive like Box and Text encapsulate our design language into style props. Style props take a design token name and translate it to css. This allows you to create custom components within the guardrails of our design language, and when we update that design language you will inherit those changes just by updating the design tokens package. A functional primitive provides accessible functionality and interaction with out providing a UI, like the Menu Primitive. Coupled with a Design Primitive, you are then able to create product specific, accessible, custom components that will always use the approved design language provided by the Twilio UX organization. I hope that helps answer why we don't just allow consumers to change our components, and the mechanisms and primitives we provide still allow you to ship products that solve specific customer problems. Let us know if you have any further questions. |
Beta Was this translation helpful? Give feedback.
-
Hi Simon,
Thanks |
Beta Was this translation helpful? Give feedback.
-
Also, I will have to import basic Paste components / primitives every time, just to achieve something simple already supported by browser. Another thing will be on testability: Thanks |
Beta Was this translation helpful? Give feedback.
-
Although, with everything said, they are all just open questions. I will use Paste the way they are suggested now. |
Beta Was this translation helpful? Give feedback.
There's a couple of topics covered here and I'll try my best to cover them as best I can.
When using Paste to build Twilio products there are some expectations set on what process to follow. Part of that process is ensuring that what we put in front of users is well researched and vetted within the UX organization, plus robust and accessible. We want the very best user experience so we put a lot of up front effort into design process of our components. As a result, we don't necessarily want that work to be degraded or removed without critical reasoning, peer review and use of a cohesive design language.
This is the main reason around our design decision to not allow direct, uncontrolled c…