Issue with border and color of Rounded Material Icons

I have integrated Material Icons Rounded into my website using the following code:

<link href="https://fonts.googleapis.com/icon?family=Material+Icons|Material+Icons+Round" rel="stylesheet">

Additionally, I have a CSS rule for the rounded class:

.material-icons.material-icons--rounded {
  font-family: 'Material Icons Round';
}

On the page, the star icon appears like this:

https://i.sstatic.net/phREF.png

If I increase the font size, it changes to this:

https://i.sstatic.net/8Dfcx.png

Where does that border come from and how can it be removed?

Edit: I have created a pen to demonstrate the issue https://codepen.io/anon/pen/wOJdMZ

@import "https://fonts.googleapis.com/icon?family=Material+Icons|Material+Icons+Round";
.material-icons--rounded {
  font-family: "Material Icons Round";
}
i {
   color: red;
}

.material-icons {
  font-size: 60px;
}

.size--2 {
  font-size: 90px;
}
<table>
  <tr>
    <th>Rounded</th>
    <td><i class="material-icons material-icons--rounded">star</i></td>
    <td><i class="material-icons material-icons--rounded size--2">star</i></td>
    <td><i class="material-icons material-icons--rounded">star_half</i></td>
    <td><i class="material-icons material-icons--rounded size--2">star_half</i></td>
    <td><i class="material-icons material-icons--rounded">star_border</i></td>
    <td><i class="material-icons material-icons--rounded size--2">star_border</i></td>
  </tr>
  <tr>
    <th>Not Rounded<br>
      <td><i class="material-icons">star</i></td>
      <td><i class="material-icons size--2">star</i></td>
      <td><i class="material-icons">star_half</i></td>
      <td><i class="material-icons size--2">star_half</i></td>
      <td><i class="material-icons">star_border</i></td>
      <td><i class="material-icons size--2">star_border</i></td>
  </tr>
</table>

UPDATE: The colors of the rounded icons are not changing on certain screen sizes.

I have updated the code snippet included in the question.

  • On the 1920x1080 monitor, all icons are appearing as red.
  • On the 2560 x 1600 MacBook Retina screen, the rounded icons are black while the others remain red. (This issue doesn't seem to occur in Chrome or Firefox)

UPDATE 2

The color issue remains unsolved. On Retina screens, the icons do not display any color. They always appear black. https://i.sstatic.net/MEIde.jpg Looking for assistance regarding this matter.

Answer №1

It appears that there is an issue with the glyph itself

If you want to access the SVG glyphs, you can do so by visiting the following links:
https://material.io/tools/icons/?icon=star&style=round
and here https://material.io/tools/icons/?icon=star&style=round

You'll notice that the rounded glyph is incorrect while the pointy star is accurate.

We recommend submitting an issue to https://github.com/material-components

Additional information for the material team

The current path is

path("M 0 0 h 24 v 24 H 0 V 0 Z m 0 0 h 24 v 24 H 0 V 0 Z m 12 17.27 ..., 1.49 1.08l 4.15 -2.5 Z");

<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120" viewBox="0 0 24 24" wtx-context="97FAD225-6CA6-4D16-A578-52C0523A648F"><path d="M0 0h24v24H0V0zm0 0h24v24H0V0zm12 17.27l4.15 2.51c.76.46 1.69-.22 1.49-1.08l-1.1-4.72 3.67-3.18c.67-.58.31-1.68-.57-1.75l-4.83-.41-1.89-4.46c-.34-.81-1.5-.81-1.84 0L9.19 8.63l-4.83.41c-.88.07-1.24 1.17-.57 1.75l3.67 3.18-1.1 4.72c-.2.86.73 1.54 1.49 1.08l4.15-2.5z"/></svg>

However, it should be corrected to

path("M 12 17.27 l 4.15 2.51 ..., 1.49 1.08l 4.15 -2.5 Z")

<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120" viewBox="0 0 24 24" wtx-context="97FAD225-6CA6-4D16-A578-52C0523A648F"><path d="M 12 17.27 l 4.15 2.51 ..., 1.49 1.08l 4.15 -2.5 Z"/></svg>

Answer №2

There was an issue where font-size was added to both classes unnecessarily. I decided to replace it with a new class called size--1

.size--1 {
  font-size: 60px;
}
.size--2 {
  font-size: 90px;
}
.material-icons--rounded {
  font-family: 'Material Icons Round;
}

The material-icons class did not require that style as it is used for applying icons.

HTML:

<i class="material-icons material-icons--rounded size--1">star</i>
<i class="material-icons material-icons--rounded size--2">star</i>

After viewing the updated pen... I attempted

outline: none !important;
border: none !important; 
box-shadow: none !important;

Unfortunately, none of these solutions worked...
And the star icon turned into a square when the font-size reached 67px... even using transform: scale(2,2) did not fix the issue. There seems to be something wrong with the rounded class))

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Issues with Font Awesome fonts failing to load after compiling an Angular project using `ng build`

I've encountered an issue with Angular 8 and Font Awesome icons. I initially added the font-awesome path in the angular.json as follows: "./node_modules/font-awesome/css/font-awesome.css" However, all the icons were displaying as empty boxes (not lo ...

Creating a stylish login form with Bootstrap: How to effortlessly center it on your webpage

My login form is currently positioned to the left. However, I am trying to move it to the center of the page. I attempted some CSS styles without success. Interestingly, when I removed '{% extends "common/base.html" %}' from the code, the form di ...

The table borders in IE 11 do not display properly when using Html5 and CSS

In a previous version, the table had visible borders. However, when I added the property text-align:center; to my container, the table did not align to the center. I then tried adding display:inline-block; to the table, which successfully centered it. It l ...

Using the Enter key to submit HTML forms

I created a custom console using HTML, CSS, and JavaScript. The input doesn't show up when I press enter, I have to click the send button. How can I make it send on enter press? Here is the code, please assist me: /* code goes below*/ <!DOCTY ...

Display the Bootstrap dropdown menu on the right-hand side

I am currently working on a dropdown menu and I would like the dropdown items to be displayed on the right side. The functionality is working, but there seems to be an issue where the dropdown menu is not fully visible. The dropdown menu is located within ...

The outline feature cannot be applied to buttons within a btn-group in Bootstrap 4

I have successfully removed the outline for a single button, but I am struggling to remove it for a button within a btn-group class. Check out my JSFiddle DEMO This is the HTML code I am working with: <button class="btn btn-primary">Button without ...

What is the best way to style a select element to achieve this appearance?

https://i.sstatic.net/4yGqf.png Currently working on converting a .psd file to html/css and encountering difficulty with a unique looking select element. Struggling to find a suitable example online for reference. Wondering if this design element is indee ...

"Utilizing a range input element with a set value on the slider

I have implemented the input type range property on my webpage and have applied some CSS styling to it. However, I feel like there is room for improvement. .Slider { -webkit-appearance: none; width: 75%; height: 15px; border-radius: 5px; backg ...

Tips for customizing the base font size in a Bootstrap 4 template

My Java/Spring Boot webapp utilizes Thymeleaf HTML page templates and Bootstrap 4, with the foundation being a free Bootstrap 4 site template called 'Simple Sidebar': . The current setup is functioning smoothly for me. I am interested in adjusti ...

Automatic width table design

I am trying to position the "User ID" label closer to its value by aligning it to the right side, as shown in the picture below. I have attempted using additional colspan's but haven't been successful. The User ID can contain anywhere from 1 to 9 ...

What is the correct method for asynchronously loading CSS files in web development?

On a mission to enhance my website's performance, I set out to achieve the perfect score on PageSpeed Insights. Everything was going smoothly until I encountered an issue with CSS delivery. I initially achieved a flawless result by utilizing the prel ...

Thumbnails being centered

I am facing an issue where I am attempting to center a group of fluid thumbnails, but they are always aligning left instead of center. Can someone help me with this problem? To better illustrate the problem, here's the JSFiddle link: http://jsfiddle. ...

Unable to get div elements to expand to their full width

Trying to center items within a div, but having issues achieving the desired output. This is an image of the desired layout: https://i.sstatic.net/949al.png The items in the div are aligning to the left and the input text does not stretch across ...

Increased dropdown extending over current items or text

Whenever I expand my dropdown, the items and existing controls seem to be getting mixed up. I am looking to completely hide background items and have the dropdown nested within another set of divs. Here is the code snippet: dropdown.component.css .par ...

Guide to animating an image along a unique path with JavaScript

I'm trying to animate an arrow along a specific path using CSS translate, but I'm facing a challenge. The arrow should move downwards, then to the left, and finally upwards until it reaches the same horizontal level as its starting point but to ...

Prevent automatic image blurring within an SVGZ file

Utilizing SVGZ images on my HTML pages for their ability to be resized. These SVGZ images consist of enlarged PNGs that have been altered in specific ways that I desire to maintain, pixelation and all. Firefox is rendering them correctly (as designed in In ...

When using angular.less, the @import feature is functioning correctly but a 404 error is displayed in the

Currently, I am working on a project using AngularJS along with angular.less. To centralize all my constants, I have stored them in one .less file and imported it at the beginning of all my other less files using a relative path: @import "constants" Even ...

Elements are receiving CSS properties from other elements within the same component

I'm encountering an issue with my components: 1. I cannot seem to style html and body in signin.component.css for some reason. The workaround I found was using: encapsulation: ViewEncapsulation.None ==> This works perfectly However, when I switch ...

Designing a loading animation with rotating lines converging towards the center to form a circular motion

Check out my code snippet below: .circle { border: 1px solid transparent; border-radius: 50%; width: 100px; overflow: hidden; } .div7 { width: 100px; height: 10px; background: red; color: white; font-weight: bold; positi ...

What is the best way to design distinct buttons for various devices?

For my current responsive web design project, I have utilized Bootstrap extensively. Recently, I encountered a new issue that I'm uncertain of how to tackle. The problem arises with the following HTML code snippet: <!-- button color depending on d ...