Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dee6684

Browse files
committed
build with fonts
1 parent 2ab6c3a commit dee6684

14 files changed

+241
-21
lines changed

web-app/.storybook/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { configure } from '@storybook/react'
2-
import '../src/styles/index.css'
2+
import '../src/styles/index.scss'
33

44
// setup acquireVsCodeApi mock
55
// @ts-ignore

web-app/.storybook/webpack.config.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ module.exports = ({ config }) => {
1313
test: /\.(ts|tsx)$/,
1414
loader: require.resolve('babel-loader'),
1515
options: {
16-
plugins: [
17-
[
18-
'babel-plugin-import',
19-
{
20-
libraryName: '@alifd/next',
21-
style: true,
22-
},
23-
],
24-
],
16+
// plugins: [
17+
// [
18+
// 'babel-plugin-import',
19+
// {
20+
// libraryName: '@alifd/next',
21+
// style: true,
22+
// },
23+
// ],
24+
// ],
2525
presets: [
2626
// react-app
2727
['react-app', { flow: false, typescript: true }],

web-app/config-overrides.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/* eslint-disable @typescript-eslint/no-var-requires */
2-
const path = require('path')
3-
const { addBabelPreset, addBabelPlugin, addWebpackModuleRule } = require('customize-cra')
2+
const { addBabelPreset, addWebpackModuleRule, addWebpackPlugin } = require('customize-cra')
43

54
module.exports = function override(config) {
65
addWebpackModuleRule({
@@ -17,13 +16,13 @@ module.exports = function override(config) {
1716
})(config)
1817

1918
// load @alifd/next component css
20-
addBabelPlugin([
21-
'babel-plugin-import',
22-
{
23-
libraryName: '@alifd/next',
24-
style: true,
25-
},
26-
])(config)
19+
// addBabelPlugin([
20+
// 'babel-plugin-import',
21+
// {
22+
// libraryName: '@alifd/next',
23+
// style: true,
24+
// },
25+
// ])(config)
2726

2827
// setup emotion styles
2928
addBabelPreset('@emotion/babel-preset-css-prop')(config)

web-app/src/containers/LoadingPage.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as React from 'react'
22
import * as T from 'typings'
33
import { css, jsx } from '@emotion/core'
44
import Loading from '../components/Loading'
5+
import { Icon } from '@alifd/next'
56
import Message from '../components/Message'
67

78
interface Props {
@@ -31,6 +32,7 @@ const LoadingPage = ({ text, context }: Props) => {
3132
}
3233
return (
3334
<div css={styles.page}>
35+
<Icon type="smile" />
3436
<Loading text={text} />
3537
</div>
3638
)

web-app/src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import App from './App'
55
// init error logging
66
import './services/sentry/init'
77
// init initial styles
8-
import './styles/index.css'
8+
import './styles/index.scss'
99
// init listeners
1010
import './services/listeners'
1111

web-app/src/styles/font.scss

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@charset "UTF-8";
2+
3+
@font-face {
4+
font-family: 'NextIcon';
5+
src: url('/styles/fonts/next-icon.woff2') format('woff2'), url('/styles/fonts/next-icon.svg#NextIcon') format('svg');
6+
}
7+
@font-face {
8+
font-family: 'Roboto';
9+
src: url('/styles/fonts/roboto-thin.woff2') format('woff2');
10+
font-weight: 200;
11+
}
12+
13+
@font-face {
14+
font-family: 'Roboto';
15+
src: url('/styles/fonts/roboto-light.woff2') format('woff2');
16+
font-weight: 300;
17+
}
18+
19+
@font-face {
20+
font-family: 'Roboto';
21+
src: url('/styles/fonts/roboto-regular.woff2') format('woff2');
22+
font-weight: 400;
23+
}
24+
25+
@font-face {
26+
font-family: 'Roboto';
27+
src: url('/styles/fonts/roboto-medium.woff2') format('woff2');
28+
font-weight: 500;
29+
}
30+
31+
@font-face {
32+
font-family: 'Roboto';
33+
src: url('/styles/fonts/roboto-bold.woff2') format('woff2');
34+
font-weight: 700;
35+
}

web-app/src/styles/fonts/next-icon.svg

Lines changed: 182 additions & 0 deletions
Loading
5.47 KB
Binary file not shown.
19.8 KB
Binary file not shown.
19.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)