mirror of
https://github.com/unraid/api.git
synced 2026-05-23 09:49:24 -05:00
refactor(web): tailwind config use .env VITE_TAILWIND_BASE_FONT_SIZE
This commit is contained in:
+4
-3
@@ -1,6 +1,7 @@
|
||||
VITE_ACCOUNT=https://localhost:8008
|
||||
VITE_ACCOUNT=http://localhost:5555
|
||||
VITE_CONNECT=https://connect.myunraid.net
|
||||
VITE_UNRAID_NET=https://unraid.ddev.site
|
||||
VITE_OS_RELEASES="https://releases.unraid.net/os"
|
||||
VITE_CALLBACK_KEY=aNotSoSecretKeyUsedToObfuscateQueryParams
|
||||
VITE_ALLOW_CONSOLE_LOGS=false
|
||||
VITE_WEBGUI=http://localhost
|
||||
VITE_ALLOW_CONSOLE_LOGS=true
|
||||
VTIE_TAILWIND_BASE_FONT_SIZE=10
|
||||
|
||||
+12
-2
@@ -1,5 +1,10 @@
|
||||
import type { Config } from "tailwindcss";
|
||||
import type { PluginAPI } from "tailwindcss/types/config";
|
||||
|
||||
import { readFileSync } from 'fs';
|
||||
import { parse } from 'dotenv';
|
||||
const envConfig = parse(readFileSync('.env'));
|
||||
|
||||
export default <Partial<Config>>{
|
||||
safelist: [
|
||||
"DropdownWrapper_blip",
|
||||
@@ -200,6 +205,11 @@ export default <Partial<Config>>{
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
plugins: [require("@tailwindcss/typography"), require('./utils/tailwind-rem-to-rem').default({
|
||||
baseFontSize: 16,
|
||||
newFontSize: 10
|
||||
/**
|
||||
* The font size where the web components will rendered in production.
|
||||
* Required due to the webgui using the 62.5% font-size "trick".
|
||||
* Set an env to 16 for local development and 10 for everything else.
|
||||
*/
|
||||
newFontSize: envConfig.VITE_TAILWIND_BASE_FONT_SIZE ?? 10,
|
||||
})],
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user