Have 2 types of sized in google icon font

Issue

I need to have 2 types of menu

one with small icons and one with larger icons

I have tried adding small class

<!DOCTYPE html>
<html>

<body>
<!doctype html>
<html lang="en">
  <head>
  
    <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,[email protected],400,0,0" />
    <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
    
    <style>
    <style>
.material-symbols-outlined {
    font-variation-settings: "FILL"0,"wght"400,"GRAD"0,"opsz"40
}

.material-symbols-outlined-small {
    font-variation-settings: "FILL"0,"wght"100,"GRAD"0,"opsz"24

}

</style>
    
    </style>
    
    
  </head>
  
  <body>

    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>
    
<ul class="dropdown-menu dropdown-menu-lg-end show" style=" margin: 0px; transform: translate3d(0px, 38.4px, 0px);" data-popper-placement="bottom-end">
                <li><a class="dropdown-item" href="#"><span class=" material-symbols-outlined align-middle">share</span>&nbsp;Export</a></li>
                <li><a class="dropdown-item" href="#"><span class="material-symbols-outlined align-middle">edit</span>&nbsp;Duplicate</a></li>
                <li><a class="dropdown-item tdelete" href="#"><span class="material-symbols-outlined align-middle">delete</span>&nbsp;Delete</a></li>
            </ul>
            

<ul class="dropdown-menu dropdown-menu-lg-end show" style="inset: 0px 0px auto auto; margin: 0px; transform: translate3d(0px, 38.4px, 0px);" data-popper-placement="bottom-end">
                <li><a class="dropdown-item" href="#"><span class=" material-symbols-outlined align-middle">share</span>&nbsp;Export</a></li>
                <li><a class="dropdown-item" href="#"><span class="material-symbols-outlined align-middle">edit</span>&nbsp;Duplicate</a></li>
                <li><a class="dropdown-item tdelete" href="#"><span class="material-symbols-outlined align-middle">delete</span>&nbsp;Delete</a></li>
            </ul>
            

  </body>
</html>

Solution

The class material-symbols-outlined is reserved for Google Material Symbols. You cannot change it to material-symbols-outlined-small and expect Google Material Symbols to work. Instead, add the second class (e.g., small).

WRONG:

<li><a class="dropdown-item" href="#"><span class="material-symbols-outlined-small align-middle">share</span>&nbsp;Export</a></li>

CORRECT:

<li><a class="dropdown-item" href="#"><span class="material-symbols-outlined small align-middle">share</span>&nbsp;Export</a></li>

See the snippet below.

.material-symbols-outlined {
  font-variation-settings: "FILL"0, "wght"400, "GRAD"0, "OPSZ"40;
}

.material-symbols-outlined.small {
  font-variation-settings: "FILL"0, "wght"100, "GRAD"0, "OPSZ"24;
}
<!doctype html>
<html lang="en">

<head>
  <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,[email protected],100..700,0..1,-50..200" rel="stylesheet" />
  <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
</head>

<body>
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>

  <ul class="dropdown-menu dropdown-menu-lg-end show" style=" margin: 0px; transform: translate3d(0px, 38.4px, 0px);" data-popper-placement="bottom-end">
    <li><a class="dropdown-item" href="#"><span class="material-symbols-outlined align-middle">share</span>&nbsp;Export</a></li>
    <li><a class="dropdown-item" href="#"><span class="material-symbols-outlined align-middle">edit</span>&nbsp;Duplicate</a></li>
    <li><a class="dropdown-item tdelete" href="#"><span class="material-symbols-outlined align-middle">delete</span>&nbsp;Delete</a></li>
  </ul>


  <ul class="dropdown-menu dropdown-menu-lg-end show" style="inset: 0px 0px auto auto; margin: 0px; transform: translate3d(0px, 38.4px, 0px);" data-popper-placement="bottom-end">
    <li><a class="dropdown-item" href="#"><span class="material-symbols-outlined small align-middle">share</span>&nbsp;Export</a></li>
    <li><a class="dropdown-item" href="#"><span class="material-symbols-outlined small align-middle">edit</span>&nbsp;Duplicate</a></li>
    <li><a class="dropdown-item tdelete" href="#"><span class="material-symbols-outlined small align-middle">delete</span>&nbsp;Delete</a></li>
  </ul>
</body>

</html>

Answered By – Cervus camelopardalis

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published