salt-ds icon indicating copy to clipboard operation
salt-ds copied to clipboard

Document use of icons across Salt

Open navkaur76 opened this issue 7 months ago • 0 comments

(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:

  1. Use the icon library directly within components that don't need to support icon scaling.
  2. Set a specific size that fits the component/pattern context.
  3. If an icon is used on its own (as part of a pattern), it can be scaled as required with variables.
  4. If teams need to change icon size in a component, a custom component needs to be created.
  5. If teams need to change icons (across components), icons have to be swapped on a per icon basis.
  6. If a component/ pattern has a status, the correct --decorative token is pre-applied to the icon in the component.
  7. 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??

navkaur76 avatar Jul 26 '24 17:07 navkaur76