Updated font handling for admin-x settings

refs https://github.com/TryGhost/Team/issues/3151

- splits font loading between css files that are loaded locally for storybook/demo app vs the exported App
- uses local Inter font for exported App vs local asset for demo
This commit is contained in:
Rishabh 2023-05-17 15:23:55 +05:30
parent bfd6581696
commit 6630fd1cb4
4 changed files with 66 additions and 3 deletions

View File

@ -1,6 +1,6 @@
import React from 'react';
import '../src/styles/index.css';
import '../src/styles/demo.css';
import type { Preview } from "@storybook/react";
const preview: Preview = {

View File

@ -1,4 +1,4 @@
import './styles/index.css';
import './styles/demo.css';
import App from './App.tsx';
import React from 'react';
import ReactDOM from 'react-dom/client';

View File

@ -0,0 +1,63 @@
@import './preflight.css';
@import 'tailwindcss/base';
@import 'tailwindcss/components';
@import 'tailwindcss/utilities';
/* Defaults */
@layer base {
@font-face {
font-family: "Inter";
src: url("./src/assets/fonts/Inter.ttf") format("truetype-variations");
font-weight: 100 900;
}
body {
@apply font-sans text-black text-base leading-normal;
}
h1, h2, h3, h4, h5, h6 {
@apply font-bold tracking-tight leading-tighter;
}
h1 {
@apply text-4xl leading-supertight;
}
h2 {
@apply text-3xl;
}
h3 {
@apply text-2xl;
}
h4 {
@apply text-xl;
}
h5 {
@apply text-lg leading-tight;
}
h6 {
@apply text-md leading-normal;
}
}
:root {
font-size: 62.5%;
line-height: 1.5;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-text-size-adjust: 100%;
}
html, body, #root {
width: 100%;
height: 100%;
}

View File

@ -8,7 +8,7 @@
@layer base {
@font-face {
font-family: "Inter";
src: url("./src/assets/fonts/Inter.ttf") format("truetype-variations");
src: local("Inter") format("truetype-variations");
font-weight: 100 900;
}