Skip to content

Commit

Permalink
css: add icons utility
Browse files Browse the repository at this point in the history
Adds an .icon utility class to set ligature text via via a data-icon
attribute on the element. This is a workaround to prevent crawlers from
picking up the font ligature innertext in html directly.

Signed-off-by: David Karlsson <[email protected]>
  • Loading branch information
dvdksn committed Jan 8, 2024
1 parent 48b3eb2 commit d006adf
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
19 changes: 19 additions & 0 deletions assets/css/icons.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@layer utilities {
.icon {
font-family: "Material Symbols Rounded";
font-weight: normal;
font-style: normal;
font-size: 24px; /* Preferred icon size */
display: inline-block;
line-height: 1;
text-transform: none;
letter-spacing: normal;
word-wrap: normal;
white-space: nowrap;
direction: ltr;
}

.icon:after {
content: attr(data-icon);
}
}
1 change: 1 addition & 0 deletions assets/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
@import "tailwindcss/utilities";
@import "/assets/css/syntax-light";
@import "/assets/css/syntax-dark";
@import "/assets/css/icons";

0 comments on commit d006adf

Please sign in to comment.