salt-ds
salt-ds copied to clipboard
Document use of icons across Salt
(Additional documentation requirement identified through the icon switching work in #3625.)
Context (problem with icon swapping in figma):
- Nested icons cannot be scaled with variables. If teams want to change the icon size in these components they will have to create a local component.
- Icons on their own can be scaled with variables without a problem. However, there currently isn't enough visibility on the icon tokens + explanation on where/how to use them
- There isn't a 1-to-1 mapping between different icon libraries + naming conventions for easy swapping (e.g. MDS icon library vs Salt icon library)
Main points to address this problem:
- Use the icon library directly within components that don't need to support icon scaling.
- Set a specific size that fits the component/pattern context.
- If an icon is used on its own (as part of a pattern), it can be scaled as required with variables.
- If teams need to change icon size in a component, a custom component needs to be created.
- If teams need to change icons (across components), icons have to be swapped on a per icon basis.
- If a component/ pattern has a status, the correct --decorative token is pre-applied to the icon in the component.
- If teams need a standalone status icon, they should apply to correct --decorative token and icon size token.
Documentation will be required in the form of:
- Document use of icons on iconography page?
- For point no. 4 above, step-by-step of this to live in the figma component guides
- Anything else??