Skip to content

Commit

Permalink
fix: necessary font changes (#1818)
Browse files Browse the repository at this point in the history
* fix: necessary font changes

* chore: minor bump
  • Loading branch information
danny-avila committed Feb 16, 2024
1 parent fe0ef2c commit 9806424
Show file tree
Hide file tree
Showing 37 changed files with 177 additions and 46 deletions.
2 changes: 1 addition & 1 deletion api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@librechat/backend",
"version": "0.6.9",
"version": "0.6.10",
"description": "",
"scripts": {
"start": "echo 'please run this from the root directory'",
Expand Down
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@librechat/frontend",
"version": "0.6.9",
"version": "0.6.10",
"description": "",
"type": "module",
"scripts": {
Expand Down
Binary file added client/public/fonts/Inter-Bold.woff2
Binary file not shown.
Binary file added client/public/fonts/Inter-BoldItalic.woff2
Binary file not shown.
Binary file added client/public/fonts/Inter-Italic.woff2
Binary file not shown.
Binary file added client/public/fonts/Inter-Regular.woff2
Binary file not shown.
Binary file added client/public/fonts/Inter-SemiBold.woff2
Binary file not shown.
Binary file added client/public/fonts/Inter-SemiBoldItalic.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed client/public/fonts/signifier-bold-italic.woff2
Binary file not shown.
Binary file removed client/public/fonts/signifier-bold.woff2
Binary file not shown.
Binary file removed client/public/fonts/signifier-light-italic.woff2
Binary file not shown.
Binary file removed client/public/fonts/signifier-light.woff2
Binary file not shown.
Binary file removed client/public/fonts/soehne-buch-kursiv.woff2
Binary file not shown.
Binary file removed client/public/fonts/soehne-buch.woff2
Binary file not shown.
Binary file removed client/public/fonts/soehne-halbfett-kursiv.woff2
Binary file not shown.
Binary file removed client/public/fonts/soehne-halbfett.woff2
Binary file not shown.
Binary file removed client/public/fonts/soehne-kraftig-kursiv.woff2
Binary file not shown.
Binary file removed client/public/fonts/soehne-kraftig.woff2
Binary file not shown.
Binary file removed client/public/fonts/soehne-mono-buch-kursiv.woff2
Binary file not shown.
Binary file removed client/public/fonts/soehne-mono-buch.woff2
Binary file not shown.
Binary file removed client/public/fonts/soehne-mono-halbfett.woff2
Binary file not shown.
2 changes: 1 addition & 1 deletion client/src/components/Chat/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function Footer() {
rel="noreferrer"
className="underline"
>
{config?.appTitle || 'LibreChat'} v0.6.9
{config?.appTitle || 'LibreChat'} v0.6.10
</a>
{' - '} {localize('com_ui_new_footer')}
</>
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Chat/Messages/Content/Markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const p = memo(({ children }: { children: React.ReactNode }) => {
return <p className="mb-2 whitespace-pre-wrap">{children}</p>;
});

const cursor = ' ';
const cursor = ' ';
const Markdown = memo(({ content, message, showCursor }: TContentProps) => {
const { isSubmitting, latestMessage } = useChatContext();
const LaTeXParsing = useRecoilValue<boolean>(store.LaTeXParsing);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const DisplayMessage = ({ text, isCreatedByUser, message, showCursor }: TDisplay
))}
<div
className={cn(
showCursor && !!text?.length ? 'result-streaming' : '',
'markdown prose dark:prose-invert light w-full break-words',
isCreatedByUser ? 'whitespace-pre-wrap dark:text-gray-20' : 'dark:text-gray-70',
)}
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Input/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function Footer() {
rel="noreferrer"
className="underline"
>
{config?.appTitle || 'LibreChat'} v0.6.9
{config?.appTitle || 'LibreChat'} v0.6.10
</a>
{' - '}. {localize('com_ui_pay_per_call')}
</>
Expand Down
184 changes: 155 additions & 29 deletions client/src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,111 @@

@font-face {
font-display: swap;
font-family: Signifier;
font-family: Inter;
font-style: normal;
font-weight: 400;
src: url("$fonts/signifier-light.woff2") format("woff2")
src: url("$fonts/Inter-Regular.woff2") format("woff2");
size-adjust: 94%;
}

@font-face {
font-display: swap;
font-family: Signifier;
font-family: Inter;
font-style: italic;
font-weight: 400;
src: url("$fonts/signifier-light-italic.woff2") format("woff2")
src: url("$fonts/Inter-Italic.woff2") format("woff2");
size-adjust: 94%;
}

@font-face {
font-display: swap;
font-family: Signifier;
font-family: Inter;
font-style: normal;
font-weight: 700;
src: url("$fonts/signifier-bold.woff2") format("woff2")
font-weight: 500;
src: url("$fonts/Inter-SemiBold.woff2") format("woff2");
size-adjust: 94%;
}

@font-face {
font-display: swap;
font-family: Inter;
font-style: italic;
font-weight: 500;
src: url("$fonts/Inter-SemiBoldItalic.woff2") format("woff2");
size-adjust: 94%;
}

@font-face {
font-display: swap;
font-family: Inter;
font-style: normal;
font-weight: 600;
src: url("$fonts/Inter-Bold.woff2") format("woff2");
size-adjust: 94%;
}

@font-face {
font-display: swap;
font-family: Signifier;
font-family: Inter;
font-style: italic;
font-weight: 600;
src: url("$fonts/Inter-BoldItalic.woff2") format("woff2");
size-adjust: 94%;
}

@font-face {
font-display: swap;
font-family: Roboto Mono;
font-style: normal;
font-weight: 400;
src: url("$fonts/roboto-mono-latin-400-normal.woff2") format("woff2")
}

@font-face {
font-display: swap;
font-family: Roboto Mono;
font-style: normal;
font-weight: 700;
src: url("$fonts/signifier-bold-italic.woff2") format("woff2")
src: url("$fonts/roboto-mono-latin-700-normal.woff2") format("woff2")
}

@font-face {
font-display: swap;
font-family: Roboto Mono;
font-style: italic;
font-weight: 400;
src: url("$fonts/roboto-mono-latin-400-italic.woff2") format("woff2")
}

/*
The default ChatGPT fonts, according to OpenAI's brand guidelines, are proprietary and require appropriate font license according to your use case.
They can be purchased here: https://klim.co.nz/buy/soehne/
The fonts in question are (9 total):
> - Söhne (Buch Kursiv, Buch, Halbfett Kursiv, Halbfett, Kraftig Kursiv, Kraftig, Mono Buch Kursiv, Mono Buch, Mono Halbfett)
If you have purchased a license, you can use the commented-out `@font-face` declarations below to include them in your project.
Step 1: Buy whatever license applies to you and allows use of `.woff2` font files (likely web font license).
Step 2: Place them in ./client/public/fonts/ directory.
Step 3: Replace the current `fontFamily` config in ./client/tailwind.config.cjs with the following:
```
fontFamily: {
sans: ['Söhne', 'sans-serif'],
mono: ['Söhne Mono', 'monospace'],
},
```
Step 4: Uncomment all Söhne font-face declarations below.
Step 5: rebuild frontend code: `npm run frontend` (or rebuild docker).
*/

/* @font-face {
font-display: swap;
font-family: Söhne;
font-style: normal;
Expand Down Expand Up @@ -110,7 +184,7 @@
font-style: italic;
font-weight: 400;
src: url("$fonts/soehne-mono-buch-kursiv.woff2") format("woff2")
}
} */

/* * {
box-sizing: border-box;
Expand Down Expand Up @@ -1311,25 +1385,6 @@ html {
animation: spin 1s linear infinite;
}

.result-streaming {
-webkit-animation: blink 1s steps(5, start) infinite;
animation: blink 1s steps(5, start) infinite;
content:"⬤ ";
margin-left: 0.25rem;
vertical-align: baseline;
}

/* .result-streaming>:not(ol):not(ul):not(pre):last-child:after,
.result-streaming>ol:last-child li:last-child:after,
.result-streaming>pre:last-child code:after,
.result-streaming>ul:last-child li:last-child:after {
-webkit-animation:blink 1s steps(5,start) infinite;
animation:blink 1s steps(5,start) infinite;
content:"▋";
margin-left:.25rem;
vertical-align:baseline
} */

.form-input,
.form-multiselect,
.form-select,
Expand Down Expand Up @@ -1870,3 +1925,74 @@ html {
--tw-shadow: inset 0 0 0 1px rgba(0,0,0,.25);
--tw-shadow-colored: inset 0 0 0 1px var(--tw-shadow-color);
}

.result-streaming>:not(ol):not(ul):not(pre):last-child:after,
.result-streaming>pre:last-child code:after {
display: inline-block; /* Add this line */
content:"⬤";
width: 12px;
height: 12px;
font-family:system-ui,Inter,Söhne Circle,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;
line-height:normal;
margin-left:.25rem;
vertical-align:middle;
font-size: 0.5rem;
}

.result-streaming>pre:last-child code {
background: url('path-to-circle-image') no-repeat right center;
padding-right: 1em; /* Adjust as necessary */
}

@supports (selector(:has(*))) {
.result-streaming>ol:last-child>li:last-child>ol:last-child>li:last-child:after,
.result-streaming>ol:last-child>li:last-child>ol:last-child>li:last-child>ol:last-child>li:last-child:after,
.result-streaming>ol:last-child>li:last-child>ol:last-child>li:last-child>ul:last-child>li:last-child:after,
.result-streaming>ol:last-child>li:last-child>ul:last-child>li:last-child:after,
.result-streaming>ol:last-child>li:last-child>ul:last-child>li:last-child>ol:last-child>li:last-child:after,
.result-streaming>ol:last-child>li:last-child>ul:last-child>li:last-child>ul:last-child>li:last-child:after,
.result-streaming>ul:last-child>li:last-child>ol:last-child>li:last-child:after,
.result-streaming>ul:last-child>li:last-child>ol:last-child>li:last-child>ol:last-child>li:last-child:after,
.result-streaming>ul:last-child>li:last-child>ol:last-child>li:last-child>ul:last-child>li:last-child:after,
.result-streaming>ul:last-child>li:last-child>ul:last-child>li:last-child:after,
.result-streaming>ul:last-child>li:last-child>ul:last-child>li:last-child>ol:last-child>li:last-child:after,
.result-streaming>ul:last-child>li:last-child>ul:last-child>li:last-child>ul:last-child>li:last-child:after,
.result-streaming>ul:last-child>li:last-child[*|\:not-has\(]:after {
content:"⬤";
font-family:system-ui,Inter,Söhne Circle,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;
line-height:normal;
margin-left:.25rem;
vertical-align:baseline
}
.result-streaming>ul:last-child>li:last-child:not(:has(*>li)):after {
content:"⬤";
font-family:system-ui,Inter,Söhne Circle,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;
line-height:normal;
margin-left:.25rem;
vertical-align:baseline
}
.result-streaming>ol:last-child>li:last-child[*|\:not-has\(]:after {
content:"⬤";
font-family:system-ui,Inter,Söhne Circle,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;
line-height:normal;
margin-left:.25rem;
vertical-align:baseline
}
.result-streaming>ol:last-child>li:last-child:not(:has(*>li)):after {
content:"⬤";
font-family:system-ui,Inter,Söhne Circle,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;
line-height:normal;
margin-left:.25rem;
vertical-align:baseline
}
}
@supports not (selector(:has(*))) {
.result-streaming>ol:last-child>li:last-child:after,
.result-streaming>ul:last-child>li:last-child:after {
content:"⬤";
font-family:system-ui,Inter,Söhne Circle,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;
line-height:normal;
margin-left:.25rem;
vertical-align:baseline
}
}
8 changes: 6 additions & 2 deletions client/tailwind.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ module.exports = {
// 'gpt-dark-gray': '#343541',
// },
fontFamily: {
sans: ['Söhne', 'sans-serif'],
mono: ['Söhne Mono', 'monospace'],
sans: ['Inter', 'sans-serif'],
mono: ['Roboto Mono', 'monospace'],
},
// fontFamily: {
// sans: ['Söhne', 'sans-serif'],
// mono: ['Söhne Mono', 'monospace'],
// },
extend: {
width: {
'authPageWidth': '370px',
Expand Down
2 changes: 1 addition & 1 deletion e2e/jestSetup.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// v0.6.9
// v0.6.10
// See .env.test.example for an example of the '.env.test' file.
require('dotenv').config({ path: './e2e/.env.test' });
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- v0.6.9 -->
<!-- v0.6.10 -->
<!DOCTYPE html>
<html>
<head>
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "LibreChat",
"version": "0.6.9",
"version": "0.6.10",
"description": "",
"workspaces": [
"api",
Expand Down
2 changes: 1 addition & 1 deletion packages/data-provider/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "librechat-data-provider",
"version": "0.4.1",
"version": "0.4.2",
"description": "data services for librechat apps",
"main": "dist/index.js",
"module": "dist/index.es.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/data-provider/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ export enum Constants {
/**
* Key for the app's version.
*/
VERSION = 'v0.6.9',
VERSION = 'v0.6.10',
/**
* Key for the Custom Config's version (librechat.yaml).
*/
Expand Down
2 changes: 1 addition & 1 deletion prettier.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// v0.6.9
// v0.6.10
module.exports = {
tailwindConfig: './client/tailwind.config.cjs',
printWidth: 100,
Expand Down

0 comments on commit 9806424

Please sign in to comment.