diff --git a/app/app.vue b/app/app.vue index 1e2fc1af2..07a71312d 100644 --- a/app/app.vue +++ b/app/app.vue @@ -139,7 +139,8 @@ if (import.meta.client) { padding: 0.5rem 1rem; background: var(--fg); color: var(--bg); - font-size: 0.875rem; + font-size: var(--text-sm-font-size); + line-height: var(--text-sm-line-height); z-index: 100; transition: top 0.2s ease; } diff --git a/app/assets/font-sizes.css b/app/assets/font-sizes.css new file mode 100644 index 000000000..e4b24ebda --- /dev/null +++ b/app/assets/font-sizes.css @@ -0,0 +1,167 @@ +:root { + --text-9xl-font-size: 8rem; + --text-9xl-line-height: 1; + --text-8xl-font-size: 6rem; + --text-8xl-line-height: 1; + --text-7xl-font-size: 4.5rem; + --text-7xl-line-height: 1; + --text-6xl-font-size: 4rem; + --text-6xl-line-height: 1; + --text-5xl-font-size: 3rem; + --text-5xl-line-height: 1; + --text-4xl-font-size: 2.25rem; + --text-4xl-line-height: 2.5rem; + --text-3xl-font-size: 1.875rem; + --text-3xl-line-height: 2.25rem; + --text-2xl-font-size: 1.5rem; + --text-2xl-line-height: 2rem; + --text-xl-font-size: 1.25rem; + --text-xl-line-height: 1.75rem; + --text-lg-font-size: 1.125rem; + --text-lg-line-height: 1.75rem; + --text-base-font-size: 1rem; + --text-base-line-height: 1.5rem; + --text-sm-font-size: 0.875rem; + --text-sm-line-height: 1.25rem; + --text-xs-font-size: 0.75rem; + --text-xs-line-height: 1rem; + --text-2xs-font-size: 0.6875rem; + --text-2xs-line-height: 0.875rem; + --text-3xs-font-size: 0.625rem; + --text-3xs-line-height: 0.75rem; + --text-4xs-font-size: 0.5rem; + --text-4xs-line-height: 0.625rem; +} + +html[data-text-size='largest'] { + --text-7xl-font-size: 6rem; + --text-7xl-line-height: 1; + --text-6xl-font-size: 6rem; + --text-6xl-line-height: 1; + --text-5xl-font-size: 4.5rem; + --text-5xl-line-height: 1; + --text-4xl-font-size: 4rem; + --text-4xl-line-height: 1; + --text-3xl-font-size: 3rem; + --text-3xl-line-height: 1; + --text-2xl-font-size: 2.25rem; + --text-2xl-line-height: 2.5rem; + --text-xl-font-size: 1.875rem; + --text-xl-line-height: 2.25rem; + --text-lg-font-size: 1.5rem; + --text-lg-line-height: 2rem; + --text-base-font-size: 1.25rem; + --text-base-line-height: 1.75rem; + --text-sm-font-size: 1.125rem; + --text-sm-line-height: 1.75rem; + --text-xs-font-size: 1rem; + --text-xs-line-height: 1.5rem; + --text-2xs-font-size: 0.875rem; + --text-2xs-line-height: 1.25rem; + --text-3xs-font-size: 0.75rem; + --text-3xs-line-height: 1rem; + --text-4xs-font-size: 0.6875rem; + --text-4xs-line-height: 0.875rem; +} + +html[data-text-size='large'] { + --text-7xl-font-size: 6rem; + --text-7xl-line-height: 1; + --text-6xl-font-size: 4.5rem; + --text-6xl-line-height: 1; + --text-5xl-font-size: 4rem; + --text-5xl-line-height: 1; + --text-4xl-font-size: 3rem; + --text-4xl-line-height: 1; + --text-3xl-font-size: 2.25rem; + --text-3xl-line-height: 2.5rem; + --text-2xl-font-size: 1.875rem; + --text-2xl-line-height: 2.25rem; + --text-xl-font-size: 1.5rem; + --text-xl-line-height: 2rem; + --text-lg-font-size: 1.25rem; + --text-lg-line-height: 1.75rem; + --text-base-font-size: 1.125rem; + --text-base-line-height: 1.75rem; + --text-sm-font-size: 1rem; + --text-sm-line-height: 1.5rem; + --text-xs-font-size: 0.875rem; + --text-xs-line-height: 1.25rem; + --text-2xs-font-size: 0.75rem; + --text-2xs-line-height: 1rem; + --text-3xs-font-size: 0.6875rem; + --text-3xs-line-height: 0.875rem; + --text-4xs-font-size: 0.625rem; + --text-4xs-line-height: 0.75rem; +} + +html[data-text-size='small'] { + --text-9xl-font-size: 6rem; + --text-9xl-line-height: 1; + --text-8xl-font-size: 4.5rem; + --text-8xl-line-height: 1; + --text-7xl-font-size: 4rem; + --text-7xl-line-height: 1; + --text-6xl-font-size: 3rem; + --text-6xl-line-height: 1; + --text-5xl-font-size: 2.25rem; + --text-5xl-line-height: 1; + --text-4xl-font-size: 1.875rem; + --text-4xl-line-height: 2.25rem; + --text-3xl-font-size: 1.5rem; + --text-3xl-line-height: 2rem; + --text-2xl-font-size: 1.25rem; + --text-2xl-line-height: 1.75rem; + --text-xl-font-size: 1.125rem; + --text-xl-line-height: 1.75rem; + --text-lg-font-size: 1rem; + --text-lg-line-height: 1.5rem; + --text-base-font-size: 0.875rem; + --text-base-line-height: 1.25rem; + --text-sm-font-size: 0.75rem; + --text-sm-line-height: 1rem; + --text-xs-font-size: 0.6875rem; + --text-xs-line-height: 0.875rem; + --text-2xs-font-size: 0.625rem; + --text-2xs-line-height: 0.75rem; + --text-3xs-font-size: 0.5rem; + --text-3xs-line-height: 0.625rem; +} + +html[data-text-size='smallest'] { + --text-9xl-font-size: 4.5rem; + --text-9xl-line-height: 1; + --text-8xl-font-size: 4rem; + --text-8xl-line-height: 1; + --text-7xl-font-size: 3rem; + --text-7xl-line-height: 1; + --text-6xl-font-size: 2.25rem; + --text-6xl-line-height: 1; + --text-5xl-font-size: 1.875rem; + --text-5xl-line-height: 2.25rem; + --text-4xl-font-size: 1.5rem; + --text-4xl-line-height: 2rem; + --text-3xl-font-size: 1.25rem; + --text-3xl-line-height: 1.75rem; + --text-2xl-font-size: 1.125rem; + --text-2xl-line-height: 1.75rem; + --text-xl-font-size: 1rem; + --text-xl-line-height: 1.5rem; + --text-lg-font-size: 0.875rem; + --text-lg-line-height: 1.25rem; + --text-base-font-size: 0.75rem; + --text-base-line-height: 1rem; + --text-sm-font-size: 0.6875rem; + --text-sm-line-height: 0.875rem; + --text-xs-font-size: 0.625rem; + --text-xs-line-height: 0.75rem; + --text-2xs-font-size: 0.5625rem; + --text-2xs-line-height: 0.625rem; + --text-3xs-font-size: 0.5rem; + --text-3xs-line-height: 0.625rem; +} + +body { + font-size: var(--text-base-font-size); + line-height: var(--text-base-line-height); +} diff --git a/app/assets/main.css b/app/assets/main.css index 85e8802a2..4b5f58772 100644 --- a/app/assets/main.css +++ b/app/assets/main.css @@ -270,7 +270,8 @@ html.light .shiki span { p > span > code, .line-clamp-2 code { @apply font-mono; - font-size: 0.85em; + font-size: var(--text-sm-font-size); + line-height: var(--text-sm-line-height); background: var(--bg-muted); padding: 0.1em 0.3em; border-radius: 3px; @@ -292,7 +293,8 @@ input[type='search'] { input, select, textarea { - font-size: 16px !important; + font-size: var(--text-base-font-size) !important; + line-height: var(--text-base-line-height) !important; } } diff --git a/app/components/Code/Viewer.vue b/app/components/Code/Viewer.vue index fb6b2a571..b696d5a8d 100644 --- a/app/components/Code/Viewer.vue +++ b/app/components/Code/Viewer.vue @@ -90,7 +90,8 @@ watch(