Просмотр исходного кода

refactor: reorganize HTML structure for Playground and add custom icon styles

Yuki Takei 4 месяцев назад
Родитель
Сommit
4885392b43
2 измененных файлов с 31 добавлено и 11 удалено
  1. 22 11
      packages/editor/index.html
  2. 9 0
      packages/editor/src/main.scss

+ 22 - 11
packages/editor/index.html

@@ -1,14 +1,25 @@
 <!DOCTYPE html>
 <html lang="en">
-  <head>
-    <meta charset="UTF-8" />
-    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
-    <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,300,0..1" rel="stylesheet" />
-    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <title>Vite + React + TS</title>
-  </head>
-  <body>
-    <div id="root"></div>
-    <script type="module" src="/src/main.tsx"></script>
-  </body>
+
+<head>
+  <meta charset="UTF-8" />
+  <link rel="icon" type="image/svg+xml" href="/vite.svg" />
+  <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,300,0..1"
+    rel="stylesheet" />
+  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+  <title>Vite + React + TS</title>
+  <style>
+    @font-face {
+      font-family: 'growi-custom-icons';
+      src: url('../custom-icons/dist/growi-custom-icons.woff2') format('woff2');
+      font-display: block;
+    }
+  </style>
+</head>
+
+<body>
+  <div id="root"></div>
+  <script type="module" src="/src/main.tsx"></script>
+</body>
+
 </html>

+ 9 - 0
packages/editor/src/main.scss

@@ -8,4 +8,13 @@
   --font-family-sans-serif: -apple-system, blinkmacsystemfont, 'Hiragino Kaku Gothic ProN', meiryo, sans-serif;
   --font-family-serif: georgia, 'Times New Roman', times, serif;
   --font-family-monospace: Menlo, Consolas, DejaVu Sans Mono, monospace;
+  --grw-font-family-custom-icon: 'growi-custom-icons';
+}
+
+.growi-custom-icons {
+  font-family: var(--grw-font-family-custom-icon);
+  font-size: 0.8em;
+  font-style: normal;
+  -webkit-font-smoothing: auto;
+  -moz-osx-font-smoothing: auto;
 }