Merge pull request 'UI/typograhy: init typography extension' (#2407) from hsjobeki/clan-core:hsjobeki-main into main
This commit is contained in:
1
pkgs/webview-ui/.gitignore
vendored
1
pkgs/webview-ui/.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
app/api
|
app/api
|
||||||
|
app/.fonts
|
||||||
|
|
||||||
.vite
|
.vite
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
import { FieldValues, FormStore, ResponseData } from "@modular-forms/solid";
|
import { FieldValues, FormStore, ResponseData } from "@modular-forms/solid";
|
||||||
import { createEffect, Show, type JSX } from "solid-js";
|
import { Show, type JSX } from "solid-js";
|
||||||
import cx from "classnames";
|
import cx from "classnames";
|
||||||
import { createECDH } from "crypto";
|
|
||||||
|
|
||||||
interface TextInputProps<T extends FieldValues, R extends ResponseData> {
|
interface TextInputProps<T extends FieldValues, R extends ResponseData> {
|
||||||
formStore: FormStore<T, R>;
|
formStore: FormStore<T, R>;
|
||||||
|
|||||||
@@ -1,10 +1,28 @@
|
|||||||
@import "material-icons/iconfont/filled.css";
|
@import "material-icons/iconfont/filled.css";
|
||||||
/* List of icons: https://marella.me/material-icons/demo/ */
|
/* List of icons: https://marella.me/material-icons/demo/ */
|
||||||
|
|
||||||
@tailwind base;
|
@tailwind base;
|
||||||
@tailwind components;
|
@tailwind components;
|
||||||
@tailwind utilities;
|
@tailwind utilities;
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: "Archivo";
|
||||||
|
font-weight: 400;
|
||||||
|
src: url(../.fonts/Archiv0-Regular.otf) format("opentype");
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: "Archivo";
|
||||||
|
font-weight: 500;
|
||||||
|
src: url(../.fonts/Archiv0-Medium.otf) format("opentype");
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: "Archivo";
|
||||||
|
font-weight: 600;
|
||||||
|
src: url(../.fonts/Archiv0-Bold.otf) format("opentype");
|
||||||
|
}
|
||||||
|
|
||||||
html {
|
html {
|
||||||
|
@apply font-sans;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export const Layout: Component<RouteSectionProps> = (props) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
return (
|
return (
|
||||||
<div class="h-screen bg-gradient-to-b from-white to-base-100 p-4">
|
<div class="h-screen bg-base-100 p-4">
|
||||||
<div class="drawer lg:drawer-open ">
|
<div class="drawer lg:drawer-open ">
|
||||||
<input
|
<input
|
||||||
id="toplevel-drawer"
|
id="toplevel-drawer"
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
const typography = require("@tailwindcss/typography");
|
import typography from "@tailwindcss/typography";
|
||||||
const daisyui = require("daisyui");
|
import daisyui from "daisyui";
|
||||||
|
import core from "./tailwind/core-plugin";
|
||||||
|
|
||||||
/** @type {import('tailwindcss').Config} */
|
/** @type {import('tailwindcss').Config} */
|
||||||
module.exports = {
|
const config = {
|
||||||
content: ["./src/**/*.{js,jsx,ts,tsx}"],
|
content: ["./src/**/*.{js,jsx,ts,tsx}"],
|
||||||
theme: {
|
theme: {
|
||||||
extend: {},
|
extend: {},
|
||||||
@@ -18,10 +19,13 @@ module.exports = {
|
|||||||
error: "#ff2c78",
|
error: "#ff2c78",
|
||||||
success: "#0ae856",
|
success: "#0ae856",
|
||||||
warning: "#ffdd2c",
|
warning: "#ffdd2c",
|
||||||
"base-100": "#d1dadb",
|
"base-100": "#F7F9FA",
|
||||||
|
"base-content": "#0D1416",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
plugins: [typography, daisyui],
|
plugins: [typography, daisyui, core],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default config;
|
||||||
20
pkgs/webview-ui/app/tailwind/core-plugin.ts
Normal file
20
pkgs/webview-ui/app/tailwind/core-plugin.ts
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
import plugin from "tailwindcss/plugin";
|
||||||
|
import { typography } from "./typography";
|
||||||
|
import theme from "tailwindcss/defaultTheme";
|
||||||
|
|
||||||
|
export default plugin.withOptions(
|
||||||
|
(_options = {}) =>
|
||||||
|
() => {
|
||||||
|
// add more base styles
|
||||||
|
},
|
||||||
|
// add configuration which is merged with the final config
|
||||||
|
() => ({
|
||||||
|
corePlugins: {
|
||||||
|
// we are using our own preflight (see above)
|
||||||
|
preflight: false,
|
||||||
|
},
|
||||||
|
theme: {
|
||||||
|
...typography,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
);
|
||||||
19
pkgs/webview-ui/app/tailwind/typography.ts
Normal file
19
pkgs/webview-ui/app/tailwind/typography.ts
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import defaultTheme from "tailwindcss/defaultTheme";
|
||||||
|
import type { Config } from "tailwindcss";
|
||||||
|
|
||||||
|
export const typography: Partial<Config["theme"]> = {
|
||||||
|
fontFamily: {
|
||||||
|
sans: ["Archivo", ...defaultTheme.fontFamily.sans],
|
||||||
|
},
|
||||||
|
fontSize: {
|
||||||
|
...defaultTheme.fontSize,
|
||||||
|
title: ["1.125rem", { lineHeight: "124%" }],
|
||||||
|
"title-m": ["1.25rem", { lineHeight: "124%" }],
|
||||||
|
"title-l": ["1.375rem", { lineHeight: "124%" }],
|
||||||
|
},
|
||||||
|
// textColor: {
|
||||||
|
// ...defaultTheme.textColor,
|
||||||
|
// primary: "#0D1416",
|
||||||
|
// secondary: "#2C4347",
|
||||||
|
// },
|
||||||
|
} as const;
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
preBuild = ''
|
preBuild = ''
|
||||||
mkdir -p api
|
mkdir -p api
|
||||||
cp -r ${config.packages.clan-ts-api}/* api
|
cp -r ${config.packages.clan-ts-api}/* api
|
||||||
|
cp -r ${pkgs.texlivePackages.archivo.tex}/fonts/opentype/public/archivo ".fonts"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
devShells.webview-ui = pkgs.mkShell {
|
devShells.webview-ui = pkgs.mkShell {
|
||||||
@@ -33,6 +34,8 @@
|
|||||||
export NODE_PATH="$PKG_ROOT/app/node_modules"
|
export NODE_PATH="$PKG_ROOT/app/node_modules"
|
||||||
export PATH="$NODE_PATH/.bin:$PATH"
|
export PATH="$NODE_PATH/.bin:$PATH"
|
||||||
|
|
||||||
|
cp -r ${pkgs.texlivePackages.archivo.tex}/fonts/opentype/public/archivo "$PKG_ROOT/app/.fonts"
|
||||||
|
|
||||||
# Define the yellow color code
|
# Define the yellow color code
|
||||||
YELLOW='\033[1;33m'
|
YELLOW='\033[1;33m'
|
||||||
# Define the reset color code
|
# Define the reset color code
|
||||||
|
|||||||
Reference in New Issue
Block a user