Skip to content
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

Closed
1 task done
obulat opened this issue Nov 25, 2021 · 0 comments · Fixed by #452
Closed
1 task done

Ensure icon size classes are not purged #451

obulat opened this issue Nov 25, 2021 · 0 comments · Fixed by #452
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

Comments

@obulat
Copy link
Contributor

obulat commented Nov 25, 2021

Problem

The icon sizes in VIcon component are set using dynamically-generated Tailwind classnames:

<svg
class="v-icon"
:class="`w-${size} h-${size}`"
xmlns="http://www.w3.org/2000/svg"
:viewBox="viewBox"
aria-hidden="true"
focusable="false"

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

  • 🙋 I would be interested in implementing this feature.
@obulat obulat added 🟩 priority: low Low priority and doesn't need to be rushed 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work ✨ goal: improvement Improvement to an existing user-facing feature 💻 aspect: code Concerns the software code in the repository labels Nov 25, 2021
@dhruvkb dhruvkb added this to Backlog in Openverse Nov 25, 2021
@dhruvkb dhruvkb moved this from Backlog to In progress in Openverse Nov 25, 2021
Openverse automation moved this from In progress to Done! Dec 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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
No open projects
Openverse
  
Done!
Development

Successfully merging a pull request may close this issue.

1 participant