Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: Adding custom icons

James Cotrotsios free asked 4 years ago


Expected behavior Have the ability to add a custom svg image and specify it as an icon. I am new to designing web pages so this may be basic knowledge but would like to leverage your classes with my SVG image if that makes sense

Actual behavior This works for the included icons simply by specifying a class

Resources (screenshots, code snippets etc.)


Marcin Luczak staff answered 4 years ago


Hello,

MDB Icons doesn't have any predefined functionality for adding custom SVGs to our icon sets, but as icons are originally defined via proper class names you can create one just as you would create any SVG class without MDB. To do it you have to add URL-encoded SVG link inside the content of :before pseudo selector for your desired class. Please see my snippet :

https://mdbootstrap.com/snippets/jquery/marcin-luczak/2659825

Please just remember that it is a custom functionality, MDB Icon styles may not apply here, and you would have to manually create media queries or other styles regarding your icon size or style.

Regards, Marcin



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: 2.0.0
  • Device: All
  • Browser: All (
  • OS: All
  • Provided sample code: No
  • Provided link: No
Tags