The Parsley Design System has been created with the follwoing best practices in mind, these best practices must be considered when updating or creating new design system elements.
Governance
- Follow the defined governance model when considering updating or creating new design system assets.
- New or update design system assets must follow a design led approach and be approved before development starts.
- Ensure the new or updated design system assets have been tested for accessibility.
- Ensure the new or updated design system assets have been user tested and a valid reason exists to create these assets.
- Speak with the product owner and/or designer when an asset has deviated from the defined design system foundations.
Tokens
- Always use the defined tokens where possible.
- When extending tokens keeps the naming conventions consistent.
- Tokens values should point to a css variable defined within the core theme style file.
- When updating or creating a new token ensure the token is mapped correctly across both design and development.
- If extending colour tokens ensure that both a light and dark mode colour token is created and inserted into design and development environments.
Documentation
- All design system assets require documentation, both designers and developers can contribute.
- Define usage guidelines, document best practices, warn of common mistakes and describe how to correctly use the component.
- Development documentation should match the props interface.
- Ensure all variations are displayed in the Examples tab, this helps product team members know what they can achieve with each design system asset.
Design
- Ensure the component is responsive, flexible and future-proof.
- Think about all the places the design system asset may be used - when, why and how - and design the new asset accordingly.
- Ensure styles from the foundations are used when applying colour, typography, spacing and so on.
- Ensure naming conventions are consistent to those defined within the Parsley Design System.
- Create design components wherever the content is likely to be reused.
- Ensure the values defined within the design assets match those within the Parsley Design System.
- Ensure the styles defined in the foundation libraries are always used.
- Always keep the design libraries up to date.
- When designing new components rely upon existing design system assets where possible.
- Define all variants and interactive states when design new design system assets.
- Maintaining brand alignment is key to preserving a high quality and consistent experience.
Development
- Use tokens for all spacing, padding and other unit based attributes.
- Relative units in the form of rems must be used instead of pixels.
- Always consider semantic markup when updating or creating new design system assets.
- Rely on the defined assets like spacing, colour and typography styles. Speak with the product owner and/or designer when an asset has deviated from the defined design system foundations.
- Use Typescript as the foundation for defining content and functionality types.
- Structure new components in the same format as existing components.
- Ensure styles from the foundations are used when applying colour, typography, spacing and so on.
- When creating new components rely on existing components to construct the new components.
- Apply encapsulation techniques to ensure the component or pattern does not control anything external to itself, for example avoid margins where possible - instead use Cluster Layout, Stack or Content Stack to control spacing between elements.
- Add test scripts to every new component or pattern created.
- Before creating a pull request run the test and lint commands to check the new code passes requirements.