chore: migrate main module to TypeScript
Migrated main module (src/main.js) to TypeScript. Fonts configuration has been moved from JSON to TypeScript module to make fonts type annotations easier.
This commit is contained in:
3 files changed
+66
-33
No files matched your search
@@ -23,7 +23,7 @@ import { createApp } from 'vue';
|
||||
import App from './App.vue';
|
||||
|
||||
import './styles/common.css';
|
||||
import rawFonts from './styles/fonts.json';
|
||||
import rawFonts from './styles/fonts';
|
||||
import './styles/variables/colors.css';
|
||||
import './styles/variables/dimensions.css';
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
[
|
||||
{
|
||||
"family": "Inter",
|
||||
"weight": "100 900",
|
||||
"style": "normal",
|
||||
"source": [
|
||||
{
|
||||
"url": "fonts/Inter/Inter-Variable.woff2",
|
||||
"format": "woff2"
|
||||
},
|
||||
{
|
||||
"url": "fonts/Inter/Inter-Variable.ttf",
|
||||
"format": "truetype"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"family": "Inter",
|
||||
"weight": "100 900",
|
||||
"style": "italic",
|
||||
"source": [
|
||||
{
|
||||
"url": "fonts/Inter/Inter-Italic-Variable.woff2",
|
||||
"format": "woff2"
|
||||
},
|
||||
{
|
||||
"url": "fonts/Inter/Inter-Italic-Variable.ttf",
|
||||
"format": "truetype"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
Copyright 2026 Seekra
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
type FontFormat =
|
||||
'woff2' | 'woff' | 'truetype' | 'opentype' | 'embedded-opentype' | 'svg';
|
||||
|
||||
interface FontSource {
|
||||
url: string;
|
||||
format: FontFormat;
|
||||
}
|
||||
|
||||
interface RawFont {
|
||||
family: string;
|
||||
weight: string;
|
||||
style: string;
|
||||
source: FontSource[];
|
||||
}
|
||||
|
||||
const fonts: RawFont[] = [
|
||||
{
|
||||
family: 'Inter',
|
||||
weight: '100 900',
|
||||
style: 'normal',
|
||||
source: [
|
||||
{
|
||||
url: 'fonts/Inter/Inter-Variable.woff2',
|
||||
format: 'woff2',
|
||||
},
|
||||
{
|
||||
url: 'fonts/Inter/Inter-Variable.ttf',
|
||||
format: 'truetype',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
family: 'Inter',
|
||||
weight: '100 900',
|
||||
style: 'italic',
|
||||
source: [
|
||||
{
|
||||
url: 'fonts/Inter/Inter-Italic-Variable.woff2',
|
||||
format: 'woff2',
|
||||
},
|
||||
{
|
||||
url: 'fonts/Inter/Inter-Italic-Variable.ttf',
|
||||
format: 'truetype',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export default fonts;
|
||||
Reference in new issue
Block a user