Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Material Icons with Kolibri Design System Icon #4913

Open
wants to merge 2 commits into
base: unstable
Choose a base branch
from

Conversation

SukhvirKooner
Copy link

Summary

Fixes: #4907
This PR removes all instances of material-icons from the codebase and replaces them with corresponding icons from the Kolibri Design System where applicable. In cases where no direct replacement was available, the icons were removed (e.g., in base.html).

Changes Made

  • Replaced all usages of material-icons with equivalent Kolibri Design System icons.
<svg
      v-else
      viewBox="0 0 40 40"
      :aria-label="kindTitle"
      class="nothumbnail-image"
      :class="$isRTL ? 'rtl-image' : 'ltr-image'"
    >
    <KIcon icon="image" 
        :x="-3"
        :y="y - 14"
        :style="{ fill: '#999999' }"  />
    </svg>

Before

Screenshot 2025-02-14 at 11 56 37 PM

After

Screenshot 2025-02-14 at 11 59 13 PM

<svg
      v-else-if="compact"
      viewBox="0 0 24 24"
      :aria-label="kindTitle"
      class="thumbnail-image"
    >
    <KIcon icon="infoOutline" 
        :x="+10"
        :y="y+20"
        :style="{ fill: '#ffffff' }"  />
    </svg>

Before

Screenshot 2025-02-14 at 11 58 18 PM

After

Screenshot 2025-02-14 at 11 59 37 PM

<svg
      v-else
      viewBox="0 0 40 40"
      :aria-label="title"
      class="nothumbnail-image"
      :class="$isRTL ? 'rtl-image' : 'ltr-image'"
    >
    <KIcon icon="image" 
        :x="-1"
        :y="y - 14"
        :style="{ fill: '#999999' }"  />
    </svg>

Before

Screenshot 2025-02-15 at 12 10 53 AM

After

Screenshot 2025-02-15 at 12 12 50 AM

  • Removed instances where material-icons were referenced but not actively used. in base.html

Testing

  • Verified that all updated icons render correctly in the UI.

  • Ensured no broken references remain in the code.

  • Manually tested affected pages to confirm visual correctness.

  • Please feel free to share any suggestions or further changes you'd like me to make. I'm happy to update the PR as needed. Looking forward to your feedback!

@@ -26,19 +26,15 @@
</div>
<svg
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No update needed yet, just to understand the need to keep svg - if we removed svg and kept only KIcon, would there be a difference in user experience and what it would look like?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

  • Removing the <svg> makes the icon appear like in the screenshot, where it loses proper responsiveness and alignment.
  • Burying the icon within an <svg> ensures better adaptability since font-size scaling is harder to manage consistently.
  • Using <svg> provides better control over size, alignment, and responsiveness across different screen sizes and layouts.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @SukhvirKooner, that's helpful. The proper alignment should be achievable no matter of the presence of svg. However KIcon doesn't have auto-scaling feature as of now so it's fine to keep it withing svg to not have regressions.

We may want to consider having these behaviors supported by KIcon itself at some point in the future.

@MisRob
Copy link
Member

MisRob commented Feb 17, 2025

In cases where no direct replacement was available, the icons were removed (e.g., in base.html)

@shruti862 I understand that this concerns the icons that you mention later and that "were referenced but not actively used", right?

@MisRob
Copy link
Member

MisRob commented Feb 17, 2025

Thanks @SukhvirKooner, and as always, I appreciate that you manually tested thoroughly and provided us with such a helpful pull request description. For now just leaving a few clarification questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove use of material-icons library from code base
2 participants