Skip to content

More flexible approach on icons #376

Description

@ivanBell199

Before submitting...

Context

There are a lot of options when it comes to icons. Google alone provides more than one set. Therefore, I think the approach of MaterializeCSS may need some changes.

Current Behavior

Currently the docs require this pattern for icons:
<i class="material-icons">add</i>

Also CSS styles explicitly use selectors like these:

    [class^="mdi-"], [class*="mdi-"],
    i.material-icons {}

If I use <span> instead of <i>, the output sometimes becomes broken. Also now we have Material Symbols. Some people may even want to use icons from a different source. I think it would be very good if the framework did not dictate which icons to use.

Expected behavior

No response

Possible Solutions or Causes

Perhaps there could be a specific class or data attribute that must be added to any icon element? Then in CSS we would not need to list various tags and classes and it would be enough to have something like [data-icon] {} or .materialize-icon {}

Your Environment

  • Version used: 2.0.1-alpha

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions