This repository has been archived by the owner on Feb 22, 2023. It is now read-only.
Ensure icon size classes are not purged #451
Labels
💻 aspect: code
Concerns the software code in the repository
✨ goal: improvement
Improvement to an existing user-facing feature
🟩 priority: low
Low priority and doesn't need to be rushed
🚦 status: awaiting triage
Has not been triaged & therefore, not ready for work
Projects
Problem
The icon sizes in
VIcon
component are set using dynamically-generated Tailwind classnames:openverse-frontend/src/components/VIcon/VIcon.vue
Lines 2 to 8 in df42a22
In production, unused class names are purged, which might cause the icon size to not work correctly.
Description
We should add the commonly-used icon class names to the
safelist
in tailwind config so that they are never purged.Alternatives
An alternative could be to apply fully-qualified class names conditionally (ie `:class="size === 4 ? 'w-4 h-4' : 'w-5 h-5'"). But this would be more difficult to adjust if the sizes change, and it would be more difficult to accommodate more that 2 sizes.
Additional context
Implementation
The text was updated successfully, but these errors were encountered: