Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
167 changes: 167 additions & 0 deletions app/assets/font-sizes.css
Original file line number Diff line number Diff line change
@@ -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);
}
6 changes: 4 additions & 2 deletions app/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Comment on lines +296 to +297
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Potential iOS zoom issue on smaller text sizes.

The original 16px value was likely chosen to prevent iOS Safari from auto-zooming inputs (iOS zooms when input font-size is below 16px). With the smallest text size setting, --text-base-font-size becomes 0.75rem (12px), which may trigger unwanted auto-zoom on iOS devices when users focus inputs.

Consider preserving the 16px minimum or using max():

🛠️ Suggested fix
 `@media` screen and (max-width: 767px) {
   input,
   select,
   textarea {
-    font-size: var(--text-base-font-size) !important;
-    line-height: var(--text-base-line-height) !important;
+    font-size: max(16px, var(--text-base-font-size)) !important;
+    line-height: var(--text-base-line-height) !important;
   }
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
font-size: var(--text-base-font-size) !important;
line-height: var(--text-base-line-height) !important;
font-size: max(16px, var(--text-base-font-size)) !important;
line-height: var(--text-base-line-height) !important;

}
}

Expand Down
3 changes: 2 additions & 1 deletion app/components/Code/Viewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ watch(

<style scoped>
.code-viewer {
font-size: 14px;
font-size: var(--text-sm-font-size);
line-height: var(--text-sm-line-height);
}
.line-numbers {
Expand Down
2 changes: 1 addition & 1 deletion app/components/DependencyPathPopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function parsePackageString(pkg: string): { name: string; version: string } {
<!-- Path badge button -->
<button
type="button"
class="path-badge font-mono text-[10px] px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/30 text-amber-700 dark:text-amber-400 cursor-pointer transition-all duration-200 ease-out whitespace-nowrap flex items-center gap-1 hover:bg-amber-500/20 hover:border-amber-500/50"
class="path-badge font-mono text-2xs px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/30 text-amber-700 dark:text-amber-400 cursor-pointer transition-all duration-200 ease-out whitespace-nowrap flex items-center gap-1 hover:bg-amber-500/20 hover:border-amber-500/50"
:aria-expanded="isOpen"
@click.stop="togglePopup"
>
Expand Down
2 changes: 1 addition & 1 deletion app/components/Header/AccountMenu.client.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function openAuthModal() {
<!-- Operation count badge (when npm connected with pending ops) -->
<span
v-if="isNpmConnected && operationCount > 0"
class="absolute -top-1 -inset-ie-1 min-w-[1rem] h-4 px-1 flex items-center justify-center font-mono text-[10px] rounded-full"
class="absolute -top-1 -inset-ie-1 min-w-[1rem] h-4 px-1 flex items-center justify-center font-mono text-2xs rounded-full"
:class="hasPendingOperations ? 'bg-yellow-500 text-black' : 'bg-blue-500 text-white'"
aria-hidden="true"
>
Expand Down
2 changes: 1 addition & 1 deletion app/components/Package/Dependencies.vue
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ const sortedOptionalDependencies = computed(() => {
</NuxtLink>
<span
v-if="peer.optional"
class="px-1 py-0.5 font-mono text-[10px] text-fg-subtle bg-bg-muted border border-border rounded shrink-0"
class="px-1 py-0.5 font-mono text-2xs text-fg-subtle bg-bg-muted border border-border rounded shrink-0"
:title="$t('package.dependencies.optional')"
>
{{ $t('package.dependencies.optional') }}
Expand Down
9 changes: 3 additions & 6 deletions app/components/Package/DownloadAnalytics.vue
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ const config = computed(() => {
<div class="flex flex-col gap-1 sm:shrink-0">
<label
for="granularity"
class="text-[10px] font-mono text-fg-subtle tracking-wide uppercase"
class="text-2xs font-mono text-fg-subtle tracking-wide uppercase"
>
{{ $t('package.downloads.granularity') }}
</label>
Expand All @@ -641,7 +641,7 @@ const config = computed(() => {
<div class="flex flex-col gap-1">
<label
for="startDate"
class="text-[10px] font-mono text-fg-subtle tracking-wide uppercase"
class="text-2xs font-mono text-fg-subtle tracking-wide uppercase"
>
{{ $t('package.downloads.start_date') }}
</label>
Expand All @@ -659,10 +659,7 @@ const config = computed(() => {
</div>

<div class="flex flex-col gap-1">
<label
for="endDate"
class="text-[10px] font-mono text-fg-subtle tracking-wide uppercase"
>
<label for="endDate" class="text-2xs font-mono text-fg-subtle tracking-wide uppercase">
{{ $t('package.downloads.end_date') }}
</label>
<div
Expand Down
22 changes: 11 additions & 11 deletions app/components/Package/Versions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ function getTagVersions(tag: string): VersionDisplay[] {
<span
v-for="tag in row.tags"
:key="tag"
class="text-[9px] font-semibold text-fg-subtle uppercase tracking-wide truncate max-w-[150px]"
class="text-3xs font-semibold text-fg-subtle uppercase tracking-wide truncate max-w-[150px]"
:title="tag"
>
{{ tag }}
Expand Down Expand Up @@ -434,7 +434,7 @@ function getTagVersions(tag: string): VersionDisplay[] {
<DateTime
v-if="v.time"
:datetime="v.time"
class="text-[10px] text-fg-subtle"
class="text-2xs text-fg-subtle"
year="numeric"
month="short"
day="numeric"
Expand All @@ -454,7 +454,7 @@ function getTagVersions(tag: string): VersionDisplay[] {
<span
v-for="tag in filterExcludedTags(v.tags, row.tags)"
:key="tag"
class="text-[8px] font-semibold text-fg-subtle uppercase tracking-wide truncate max-w-[120px]"
class="text-4xs font-semibold text-fg-subtle uppercase tracking-wide truncate max-w-[120px]"
:title="tag"
>
{{ tag }}
Expand Down Expand Up @@ -539,7 +539,7 @@ function getTagVersions(tag: string): VersionDisplay[] {
<DateTime
v-if="row.primaryVersion.time"
:datetime="row.primaryVersion.time"
class="text-[10px] text-fg-subtle"
class="text-2xs text-fg-subtle"
year="numeric"
month="short"
day="numeric"
Expand All @@ -550,7 +550,7 @@ function getTagVersions(tag: string): VersionDisplay[] {
<span
v-for="tag in row.tags"
:key="tag"
class="text-[8px] font-semibold text-fg-subtle uppercase tracking-wide truncate max-w-[120px]"
class="text-4xs font-semibold text-fg-subtle uppercase tracking-wide truncate max-w-[120px]"
:title="tag"
>
{{ tag }}
Expand Down Expand Up @@ -616,7 +616,7 @@ function getTagVersions(tag: string): VersionDisplay[] {
<DateTime
v-if="group.versions[0]?.time"
:datetime="group.versions[0]?.time"
class="text-[10px] text-fg-subtle"
class="text-2xs text-fg-subtle"
year="numeric"
month="short"
day="numeric"
Expand All @@ -636,7 +636,7 @@ function getTagVersions(tag: string): VersionDisplay[] {
<span
v-for="tag in group.versions[0].tags"
:key="tag"
class="text-[8px] font-semibold text-fg-subtle uppercase tracking-wide truncate max-w-[120px]"
class="text-4xs font-semibold text-fg-subtle uppercase tracking-wide truncate max-w-[120px]"
:title="tag"
>
{{ tag }}
Expand Down Expand Up @@ -677,7 +677,7 @@ function getTagVersions(tag: string): VersionDisplay[] {
<DateTime
v-if="group.versions[0]?.time"
:datetime="group.versions[0]?.time"
class="text-[10px] text-fg-subtle"
class="text-2xs text-fg-subtle"
year="numeric"
month="short"
day="numeric"
Expand All @@ -694,7 +694,7 @@ function getTagVersions(tag: string): VersionDisplay[] {
<span
v-for="tag in group.versions[0].tags"
:key="tag"
class="text-[8px] font-semibold text-fg-subtle uppercase tracking-wide"
class="text-4xs font-semibold text-fg-subtle uppercase tracking-wide"
>
{{ tag }}
</span>
Expand Down Expand Up @@ -733,7 +733,7 @@ function getTagVersions(tag: string): VersionDisplay[] {
<DateTime
v-if="v.time"
:datetime="v.time"
class="text-[10px] text-fg-subtle"
class="text-2xs text-fg-subtle"
year="numeric"
month="short"
day="numeric"
Expand All @@ -750,7 +750,7 @@ function getTagVersions(tag: string): VersionDisplay[] {
<span
v-for="tag in v.tags"
:key="tag"
class="text-[8px] font-semibold text-fg-subtle uppercase tracking-wide"
class="text-4xs font-semibold text-fg-subtle uppercase tracking-wide"
>
{{ tag }}
</span>
Expand Down
2 changes: 1 addition & 1 deletion app/components/Package/VulnerabilityTree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function getDepthStyle(depth: string | undefined) {
<span
v-for="s in SEVERITY_LEVELS.filter(s => pkg.counts[s] > 0)"
:key="s"
class="px-1.5 py-0.5 text-[10px] font-mono rounded border"
class="px-1.5 py-0.5 text-2xs font-mono rounded border"
:class="SEVERITY_COLORS[s]"
>
{{ pkg.counts[s] }} {{ $t(`package.vulnerabilities.severity.${s}`) }}
Expand Down
Loading