Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/sweet-mirrors-live.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/fuselage': minor
---

feat(fuselage): Integrate Inter font
14 changes: 12 additions & 2 deletions packages/fuselage/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@ import { dirname, join } from 'path';

import type { StorybookConfig } from '@storybook/react-webpack5';

export default {
const config: StorybookConfig = {
webpackFinal: async (config) => {
config.module?.rules?.push({
test: /\.woff2$/,
type: 'asset/resource',
});

return config;
},
addons: [
getAbsolutePath('@storybook/addon-a11y'),
getAbsolutePath('@rocket.chat/storybook-dark-mode'),
Expand Down Expand Up @@ -87,7 +95,9 @@ export default {
typescript: {
reactDocgen: 'react-docgen-typescript',
},
} satisfies StorybookConfig;
};

export default config;

function getAbsolutePath(value: string): any {
return dirname(require.resolve(join(value, 'package.json')));
Expand Down
Binary file added packages/fuselage/src/fonts/InterVariable.woff2
Binary file not shown.
7 changes: 7 additions & 0 deletions packages/fuselage/src/fonts/inter.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@font-face {
font-family: 'Inter';
font-weight: 100 900;
font-style: normal;
font-display: swap;
src: url('./InterVariable.woff2') format('woff2');
}
1 change: 1 addition & 0 deletions packages/fuselage/src/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@import './fonts/inter.scss';
@import './styles/functions.scss';
@import './styles/variables/all.scss';
@import './styles/mixins/all.scss';
Expand Down
17 changes: 15 additions & 2 deletions packages/fuselage/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ export default (env, { mode = 'production' }) =>
},
},
},
{
test: /\.woff2$/,
type: 'asset/resource',
generator: {
filename: 'fonts/[name][ext]',
},
},
{
test: /\.scss$/,
use: [
Expand All @@ -49,7 +56,7 @@ export default (env, { mode = 'production' }) =>
{
loader: 'css-loader',
options: {
importLoaders: 2,
importLoaders: 3,
},
},
{
Expand All @@ -65,7 +72,13 @@ export default (env, { mode = 'production' }) =>
},
},
},
'sass-loader',
'resolve-url-loader',
{
loader: 'sass-loader',
options: {
sourceMap: true,
},
},
],
},
],
Expand Down
Loading