Skip to content

Commit

Permalink
fix: website fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
iCrawl committed Oct 9, 2022
1 parent a5d2ce2 commit 5f72d8b
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 5 deletions.
1 change: 1 addition & 0 deletions packages/guide/src/layouts/SidebarLayout.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
import '../styles/main.css';
import '@code-hike/mdx/styles.css';
import '../styles/ch.css';
import type { MarkdownLayoutProps } from 'astro';
Expand Down
16 changes: 16 additions & 0 deletions packages/guide/src/styles/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@import url('https://rsms.me/inter/inter.css');

:root {
font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
'Noto Color Emoji';
font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

@supports (font-variation-settings: normal) {
:root {
font-family: 'Inter var', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
'Noto Color Emoji';
}
}
5 changes: 4 additions & 1 deletion packages/ui/src/lib/components/discord/Messages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import type { PropsWithChildren } from 'react';

export function DiscordMessages({ rounded, children }: PropsWithChildren<{ rounded?: boolean }>) {
return (
<div className={`pt-0.1 bg-[rgb(54_57_63)] pb-4 ${rounded ? 'rounded' : ''}`} id="messages-wrapper">
<div
className={`font-source-sans-pro pt-0.1 bg-[rgb(54_57_63)] pb-4 ${rounded ? 'rounded' : ''}`}
id="messages-wrapper"
>
{children}
</div>
);
Expand Down
18 changes: 17 additions & 1 deletion packages/ui/unocss.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,23 @@ export default defineConfig({
presetWebFonts({
provider: 'bunny',
fonts: {
mono: ['JetBrains Mono', 'JetBrains Mono:400,600,700'],
mono: ['JetBrains Mono:400,600,700'],
'source-sans-pro': [
'Source Sans Pro:300,400,500,600',
{ name: 'ui-sans-serif', provider: 'none' },
{ name: 'system-ui', provider: 'none' },
{ name: '-apple-system', provider: 'none' },
{ name: 'BlinkMacSystemFont', provider: 'none' },
{ name: 'Segoe UI', provider: 'none' },
{ name: 'Roboto', provider: 'none' },
{ name: 'Helvetica Neue', provider: 'none' },
{ name: 'Arial', provider: 'none' },
{ name: 'sans-serif', provider: 'none' },
{ name: 'Apple Color Emoji', provider: 'none' },
{ name: 'Segoe UI Emoji', provider: 'none' },
{ name: 'Segoe UI Symbol', provider: 'none' },
{ name: 'Noto Color Emoji', provider: 'none' },
],
},
}),
presetTypography({
Expand Down
2 changes: 1 addition & 1 deletion packages/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dev": "yarn run --top-level docs && concurrently 'yarn dev:css' 'yarn dev:next'",
"dev:next": "next dev",
"dev:css": "yarn generate:css --watch",
"generate:css": "unocss 'src/**/*.tsx' '../ui/src/**/*.tsx' --out-file ./src/styles/unocss.css --config ../ui/unocss.config.ts",
"generate:css": "unocss 'src/**/*.tsx' '../ui/src/lib/components/**/*.tsx' --out-file ./src/styles/unocss.css --config ../ui/unocss.config.ts",
"lint": "prettier --check . && cross-env TIMING=1 eslint src --ext .mjs,.js,.cjs,.ts,.tsx",
"format": "prettier --write . && cross-env TIMING=1 eslint src --ext .mjs,.js,.cjs,.ts,.tsx --fix"
},
Expand Down
7 changes: 5 additions & 2 deletions packages/website/src/styles/main.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
@import url('https://rsms.me/inter/inter.css');

:root {
font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue;
font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
'Noto Color Emoji';
font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

@supports (font-variation-settings: normal) {
:root {
font-family: 'Inter var', Arial, Noto Sans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', Segoe UI Symbol,
font-family: 'Inter var', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
'Noto Color Emoji';
}
}
Expand Down

2 comments on commit 5f72d8b

@vercel
Copy link

@vercel vercel bot commented on 5f72d8b Oct 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 5f72d8b Oct 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.