@@ -517,12 +517,12 @@ onKeyStroke(
517517 <main class =" container flex-1 w-full py-8" >
518518 <PackageSkeleton v-if =" status === 'pending'" />
519519
520- <article v-else-if =" status === 'success' && pkg" class =" package-page " >
520+ <article v-else-if =" status === 'success' && pkg" : class =" $style.packagePage " >
521521 <!-- Package header -->
522522 <header
523- class =" area-header sticky top-14 z-1 bg-[--bg] py-2 border-border"
523+ class =" sticky top-14 z-1 bg-[--bg] py-2 border-border"
524524 ref =" header"
525- :class =" { 'border-b': isHeaderPinned }"
525+ :class =" [$style.areaHeader, { 'border-b': isHeaderPinned }] "
526526 >
527527 <!-- Package name and version -->
528528 <div class =" flex items-baseline gap-x-2 gap-y-1 sm:gap-x-3 flex-wrap min-w-0" >
@@ -545,10 +545,11 @@ onKeyStroke(
545545 <button
546546 type =" button"
547547 @click =" copyPkgName()"
548- class =" copy-button absolute z-20 inset-is-0 top-full inline-flex items-center gap-1 px-2 py-1 rounded border text-xs font-mono whitespace-nowrap transition-all duration-150 opacity-0 -translate-y-1 pointer-events-none group-hover:opacity-100 group-hover:translate-y-0 group-hover:pointer-events-auto focus-visible:opacity-100 focus-visible:translate-y-0 focus-visible:pointer-events-auto"
549- :class ="
550- copiedPkgName ? 'text-accent bg-accent/10' : 'text-fg-muted bg-bg border-border'
551- "
548+ class =" absolute z-20 inset-is-0 top-full inline-flex items-center gap-1 px-2 py-1 rounded border text-xs font-mono whitespace-nowrap transition-all duration-150 opacity-0 -translate-y-1 pointer-events-none group-hover:opacity-100 group-hover:translate-y-0 group-hover:pointer-events-auto focus-visible:opacity-100 focus-visible:translate-y-0 focus-visible:pointer-events-auto"
549+ :class =" [
550+ $style.copyButton,
551+ copiedPkgName ? 'text-accent bg-accent/10' : 'text-fg-muted bg-bg border-border',
552+ ]"
552553 :aria-label =" copiedPkgName ? $t('common.copied') : $t('package.copy_name')"
553554 >
554555 <span
@@ -610,7 +611,8 @@ onKeyStroke(
610611 v-if =" resolvedVersion"
611612 as =" nav"
612613 :aria-label =" $t('package.navigation')"
613- class =" package-nav hidden sm:flex max-sm:flex max-sm:fixed max-sm:z-40 max-sm:inset-is-50% max-sm:-translate-x-50% max-sm:bg-[--bg]/90 max-sm:backdrop-blur-md max-sm:border max-sm:border-border max-sm:rounded-md max-sm:shadow-md"
614+ class =" hidden sm:flex max-sm:flex max-sm:fixed max-sm:z-40 max-sm:inset-is-50% max-sm:-translate-x-50% max-sm:bg-[--bg]/90 max-sm:backdrop-blur-md max-sm:border max-sm:border-border max-sm:rounded-md max-sm:shadow-md"
615+ :class =" $style.packageNav"
614616 >
615617 <LinkBase
616618 variant =" button-secondary"
@@ -701,7 +703,7 @@ onKeyStroke(
701703 </header >
702704
703705 <!-- Package details -->
704- <section class =" area-details " >
706+ <section : class =" $style.areaDetails " >
705707 <div class =" mb-4" >
706708 <!-- Description container with min-height to prevent CLS -->
707709 <div class =" max-w-2xl min-h-[4.5rem]" >
@@ -978,7 +980,7 @@ onKeyStroke(
978980 </section >
979981
980982 <!-- Binary-only packages: Show only execute command (no install) -->
981- <section v-if =" isBinaryOnly" class =" area-install scroll-mt-20" >
983+ <section v-if =" isBinaryOnly" class =" scroll-mt-20" :class = " $style.areaInstall " >
982984 <div class =" flex flex-wrap items-center justify-between mb-3" >
983985 <h2 id =" run-heading" class =" text-xs text-fg-subtle uppercase tracking-wider" >
984986 {{ $t('package.run.title') }}
@@ -1000,7 +1002,7 @@ onKeyStroke(
10001002 </section >
10011003
10021004 <!-- Regular packages: Install command with optional run command -->
1003- <section v-else id =" get-started" class =" area-install scroll-mt-20" >
1005+ <section v-else id =" get-started" class =" scroll-mt-20" :class = " $style.areaInstall " >
10041006 <div class =" flex flex-wrap items-center justify-between mb-3" >
10051007 <h2
10061008 id =" get-started-heading"
@@ -1029,7 +1031,7 @@ onKeyStroke(
10291031 </div >
10301032 </section >
10311033
1032- <div class =" area-vulns space-y-6" >
1034+ <div class =" space-y-6" :class = " $style.areaVulns " >
10331035 <!-- Bad package warning -->
10341036 <PackageReplacement v-if =" moduleReplacement" :replacement =" moduleReplacement" />
10351037 <!-- Vulnerability scan -->
@@ -1049,7 +1051,7 @@ onKeyStroke(
10491051 </div >
10501052
10511053 <!-- README -->
1052- <section id =" readme" class =" area-readme min-w-0 scroll-mt-20" >
1054+ <section id =" readme" class =" min-w-0 scroll-mt-20" :class = " $style.areaReadme " >
10531055 <div class =" flex flex-wrap items-center justify-between mb-3 px-1" >
10541056 <h2 id =" readme-heading" class =" group text-xs text-fg-subtle uppercase tracking-wider" >
10551057 <LinkBase to =" #readme" >
@@ -1129,7 +1131,7 @@ onKeyStroke(
11291131 </section >
11301132 </section >
11311133
1132- <PackageSidebar class =" area-sidebar " >
1134+ <PackageSidebar : class =" $style.areaSidebar " >
11331135 <div class =" flex flex-col gap-4 sm:gap-6 xl:(pt-2)" >
11341136 <!-- Team access controls (for scoped packages when connected) -->
11351137 <ClientOnly >
@@ -1212,10 +1214,13 @@ onKeyStroke(
12121214 </main >
12131215</template >
12141216
1215- <style scoped >
1216- .package-page {
1217+ <style module >
1218+ .packagePage {
12171219 display : grid ;
12181220 gap : 2rem ;
1221+ word-wrap : break-word ;
1222+ overflow-wrap : break-word ;
1223+ max-width : 100% ;
12191224
12201225 /* Mobile: single column, sidebar above readme */
12211226 grid-template-columns : minmax (0 , 1fr );
@@ -1230,7 +1235,7 @@ onKeyStroke(
12301235
12311236/* Tablet/medium: header/install/vulns full width, readme+sidebar side by side */
12321237@media (min-width : 1024px ) {
1233- .package-page {
1238+ .packagePage {
12341239 grid-template-columns : 2fr 1fr ;
12351240 grid-template-areas :
12361241 ' header header'
@@ -1244,7 +1249,7 @@ onKeyStroke(
12441249
12451250/* Desktop: floating sidebar alongside all content */
12461251@media (min-width : 1280px ) {
1247- .package-page {
1252+ .packagePage {
12481253 grid-template-columns : 1fr 20rem ;
12491254 grid-template-areas :
12501255 ' header sidebar'
@@ -1255,68 +1260,61 @@ onKeyStroke(
12551260 }
12561261}
12571262
1258- .area-header {
1259- grid-area : header;
1260- }
1261-
1262- .area-details {
1263- grid-area : details;
1264- }
1265-
1266- .area-install {
1267- grid-area : install;
1268- }
1269-
1270- .area-vulns {
1271- grid-area : vulns;
1272- overflow-x : hidden ;
1273- }
1274-
1275- .area-readme {
1276- grid-area : readme;
1277- }
1278-
1279- .area-readme > .readme {
1280- overflow-x : hidden ;
1263+ /* Ensure all children respect max-width */
1264+ .packagePage > * {
1265+ max-width : 100% ;
1266+ min-width : 0 ;
12811267}
12821268
1283- .area-sidebar {
1284- grid-area : sidebar ;
1269+ .areaHeader {
1270+ grid-area : header ;
12851271}
12861272
12871273/* Improve package name wrapping for narrow screens */
1288- .area-header h1 {
1274+ .areaHeader h1 {
12891275 overflow-wrap : anywhere;
12901276}
12911277
12921278/* Ensure description text wraps properly */
1293- .area-header p {
1279+ .areaHeader p {
12941280 word-wrap : break-word ;
12951281 overflow-wrap : break-word ;
12961282 word-break : break-word ;
12971283}
12981284
1285+ .areaDetails {
1286+ grid-area : details;
1287+ }
1288+
1289+ .areaInstall {
1290+ grid-area : install;
1291+ }
1292+
12991293/* Allow install command text to break on narrow screens */
1300- .area-install code {
1294+ .areaInstall code {
13011295 word-break : break-word ;
13021296 overflow-wrap : anywhere;
13031297 white-space : pre-wrap ;
13041298}
13051299
1306- /* Ensure all text content wraps on narrow screens */
1307- .package-page {
1308- word-wrap : break-word ;
1309- overflow-wrap : break-word ;
1310- max-width : 100% ;
1300+ .areaVulns {
1301+ grid-area : vulns;
1302+ overflow-x : hidden ;
13111303}
13121304
1313- /* Ensure all children respect max-width */
1314- .package-page > * {
1315- max-width : 100% ;
1316- min-width : 0 ;
1305+ .areaReadme {
1306+ grid-area : readme;
1307+ }
1308+
1309+ .areaReadme > :global(.readme ) {
1310+ overflow-x : hidden ;
1311+ }
1312+
1313+ .areaSidebar {
1314+ grid-area : sidebar;
13171315}
13181316
1319- .copy-button {
1317+ .copyButton {
13201318 clip : rect (0 0 0 0 );
13211319 clip-path : inset (50% );
13221320 height : 1px ;
@@ -1331,8 +1329,8 @@ onKeyStroke(
13311329 width 0.01s 0.34s allow-discrete;
13321330}
13331331
1334- .group :hover .copy-button ,
1335- .copy-button :focus-visible {
1332+ :global( .group ) :hover .copyButton ,
1333+ .copyButton :focus-visible {
13361334 clip : auto ;
13371335 clip-path : none ;
13381336 height : auto ;
@@ -1344,22 +1342,22 @@ onKeyStroke(
13441342}
13451343
13461344@media (hover : none) {
1347- .copy-button {
1345+ .copyButton {
13481346 display : none ;
13491347 }
13501348}
13511349
13521350/* Mobile floating nav: safe-area positioning + kbd hiding */
13531351@media (max-width : 639.9px ) {
1354- .package-nav {
1352+ .packageNav {
13551353 bottom : calc (1.25rem + env(safe-area-inset-bottom, 0px ));
13561354 }
13571355
1358- .package-nav > :deep (a kbd ) {
1356+ .packageNav > :global (a kbd ) {
13591357 display : none ;
13601358 }
13611359
1362- .package-page {
1360+ .packagePage {
13631361 padding-bottom : calc (4.5rem + env(safe-area-inset-bottom, 0px ));
13641362 }
13651363}
0 commit comments