I am currently incorporating Google's Material Icons into my project.
The font is being linked like so :
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded&display=block:opsz,wght,FILL,<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="682f3a292c285a5846465c50">[email protected]</a>,100..700,0..1,-50..200" />
followed by a css class :
.material-symbols-rounded {
font-variation-settings:
'FILL' var(--fill-icons),
'wght' 300,
'GRAD' 200
}
I have a set of list items (li elements
) and I want to alter the default list-style-type
, replacing the bullet point with a Material Icon such as folder
(with codepoint : e2c7
).
My current CSS for this task looks like this:
li::marker {
font-family: 'Material Icons Rounded';
content: "\e2c7";
color: white;
display: inline-block;
margin-right: 6px;
}
I also attempted using the ::before
pseudo-element and experimenting with ligatures instead of codepoints.
However, the result I'm getting is different from what I expected, as shown in these comparisons: https://i.sstatic.net/v8BoE.png vs https://i.sstatic.net/7oMEs.png
What might be causing this discrepancy and how can I adjust my code to achieve the desired outcome?
Operating on Chrome version 114