Skip to content

Commit

Permalink
Merge pull request #330 from db-ui/fix-generation-index-html
Browse files Browse the repository at this point in the history
fix: issue with generated icon preview
  • Loading branch information
nmerget authored Nov 15, 2024
2 parents b5f0eb2 + dd56cef commit 1e67b98
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/generate-icon-fonts/svg-to-font.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const svgToFont = async (
},
website: {
index: "font-class",
template: path.resolve(generateIconFontsDir, "templates/template.ejs"),
template: path.resolve(generateIconFontsDir, "templates/index.njk"),
links: [{ title: "", url: "" }],
},
styleTemplates: path.resolve(generateIconFontsDir, "styles"),
Expand Down
35 changes: 35 additions & 0 deletions src/generate-icon-fonts/templates/index.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{{ _title }}</title>
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
<link rel="stylesheet" href="index.css" />
<style>
*{margin: 0;padding: 0;list-style: none;}
body { color: #242629; font: 12px/1.5 tahoma, arial, \5b8b\4f53, sans-serif; }
.icons { padding: 16px; margin: 0 auto; }
.icons ul { text-align: center; display: grid; gap: 16px; grid-template-columns: repeat(8, 1fr); }
.icons ul li {
text-align: center;
border-radius: 4px;
border: 1px solid #242629;
}
.icons ul li.class-icon { font-size: 24px; line-height: 24px; padding: 16px; }
.icons ul li.class-icon p{ font-size: 12px; line-height: 20px;
overflow-wrap: anywhere; }
</style>
</head>

<body>

<div class="icons">
<ul>
{{ _IconHtml|safe }}
</ul>
</div>
</body>

</html>

0 comments on commit 1e67b98

Please sign in to comment.