Update mediaqueries

This commit is contained in:
Eric
2026-11-16 15:01:07 +01:00
parent 7ecdc680d8
commit 7e55676780
33 changed files with 126 additions and 56 deletions
@@ -161,7 +161,10 @@ ul.menu-items {
.arrow-up-button::before {
content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%0A%3E%3Cpolyline points='18 15 12 9 6 15' /%3E%3C/svg%3E%0A");
width: 20px;
height: 28px;
height: 20px;
/* line-height 0 keeps the chevron image at the top of this box, so the button's flex centering
centers it; it used to rely on VitePress 1's 38px button line-height instead */
line-height: 0;
margin: auto;
display: block;
}
@@ -21,13 +21,13 @@
padding: 8px;
}
@media (min-width: 960px) {
@media (min-width: 60rem) {
.card-grid-flex > * {
flex-basis: 50%;
}
}
@media (min-width: 1280px) {
@media (min-width: 80rem) {
.card-grid-flex > * {
flex-basis: 33.33%;
}
@@ -75,6 +75,7 @@ const model = computed({
appearance: none;
width: 16px;
height: 16px;
margin: 3px 3px 3px 4px;
cursor: pointer;
border: 1px solid var(--vp-input-border-color);
background-color: var(--vp-input-switch-bg-color);
@@ -29,7 +29,7 @@ import RocketDuotoneIcon from '../home/RocketDuotoneIcon.ts';
</template>
<style>
@media (min-width: 960px) {
@media (min-width: 60rem) {
:root {
--vp-layout-top-height: 32px;
}
@@ -16,13 +16,13 @@
padding: 8px;
}
@media (min-width: 960px) {
@media (min-width: 60rem) {
.overview-link-grid {
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
}
@media (min-width: 1280px) {
@media (min-width: 80rem) {
.overview-link-grid {
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
@@ -52,7 +52,7 @@
border-bottom: 2px solid var(--vp-c-brand);
}
@media (min-width: 860px) {
@media (min-width: 53.75rem) {
.tab-list {
justify-content: flex-start;
}
@@ -62,12 +62,12 @@
}
}
@media (min-width: 960px) {
@media (min-width: 60rem) {
.tab {
}
}
@media (min-width: 1152px) {
@media (min-width: 72rem) {
.tab {
}
}
@@ -246,7 +246,7 @@ const selected = defineModel<{ name: string; value: string; icon?: string; iconD
width: 1.25rem;
}
@media (min-width: 640px) {
@media (min-width: 40rem) {
.select-button,
.select-options {
font-size: 0.875rem;
@@ -11,21 +11,21 @@
margin-block: 24px;
}
@media (min-width: 640px) {
@media (min-width: 40rem) {
.home-container {
padding-inline: 48px;
margin-block: 48px;
}
}
@media (min-width: 960px) {
@media (min-width: 60rem) {
.home-container {
padding-inline: 64px;
margin-block: 64px;
}
}
@media (min-width: 1280px) {
@media (min-width: 80rem) {
.home-container {
margin: 64px auto;
max-width: 1152px;
@@ -443,7 +443,7 @@ const initial = <T,>(value: T) => (reducedMotion.value ? false : value);
margin-left: calc(((396px - 100vw) / 2) * -1);
}
@media (min-width: 396px) {
@media (min-width: 24.75rem) {
.home-hero-animation {
margin-left: auto;
}
@@ -461,7 +461,7 @@ const initial = <T,>(value: T) => (reducedMotion.value ? false : value);
pointer-events: none;
}
@media (min-width: 640px) {
@media (min-width: 40rem) {
.hero-background {
width: 680px;
height: 680px;
@@ -476,7 +476,7 @@ const initial = <T,>(value: T) => (reducedMotion.value ? false : value);
}
}
@media (min-width: 768px) {
@media (min-width: 48rem) {
.hero-background {
width: 760px;
height: 760px;
@@ -495,7 +495,7 @@ const initial = <T,>(value: T) => (reducedMotion.value ? false : value);
}
}
@media (min-width: 960px) {
@media (min-width: 60rem) {
.hero-background {
top: -20vw;
right: 20vw;
@@ -513,7 +513,7 @@ const initial = <T,>(value: T) => (reducedMotion.value ? false : value);
}
}
@media (min-width: 1160px) {
@media (min-width: 72.5rem) {
.home-hero-animation-container {
margin-right: -64px;
margin-bottom: -180px;
@@ -530,7 +530,7 @@ const initial = <T,>(value: T) => (reducedMotion.value ? false : value);
}
}
@media (min-width: 1280px) {
@media (min-width: 80rem) {
.home-hero-animation-container {
margin-right: -420px;
margin-top: -64px;
@@ -22,7 +22,7 @@ import RocketDuotoneIcon from './RocketDuotoneIcon.ts';
justify-content: center;
}
@media (min-width: 960px) {
@media (min-width: 60rem) {
.info {
justify-content: flex-start;
}
@@ -155,14 +155,14 @@ const iconStyle = computed(() => ({
background: none;
}
@media (min-width: 640px) {
@media (min-width: 40rem) {
.card {
display: grid;
grid-template-columns: 8fr 10fr;
}
}
@media (min-width: 960px) {
@media (min-width: 60rem) {
.card {
grid-template-columns: 1fr 2fr;
}
@@ -62,7 +62,7 @@ const onIntersectionObserver: IntersectionObserverCallback = ([{ isIntersecting
background: var(--vp-c-bg);
}
@media (min-width: 640px) {
@media (min-width: 40rem) {
.icon-grid {
top: 0;
right: -48px;
@@ -50,7 +50,7 @@ html:not(.dark) .logo.light {
display: none;
}
@media (min-width: 640px) {
@media (min-width: 40rem) {
.sponsor-card {
flex-direction: row;
justify-content: space-between;
@@ -39,13 +39,13 @@ const { theme } = useData()
margin-bottom: 48px;
}
@media (min-width: 640px) {
@media (min-width: 40rem) {
.team-members :deep(.card-grid > *) {
flex-basis: 50%;
}
}
@media (min-width: 768px) {
@media (min-width: 48rem) {
.team-members :deep(.card-grid > *) {
flex-basis: 33.33%;
}
@@ -61,7 +61,7 @@ const { theme } = useData()
display: none;
}
@media (min-width: 960px) {
@media (min-width: 60rem) {
.ad-card {
display: block;
}
@@ -88,13 +88,13 @@ onMounted(() => {
transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}
@media (min-width: 1280px) {
@media (min-width: 80rem) {
.floating-ad {
display: block;
}
}
@media (min-width: 1440px) {
@media (min-width: 90rem) {
.floating-ad {
right: calc(((100% - (var(--vp-layout-max-width) - var(--vp-sidebar-width))) - 272px) / 2);
}
@@ -77,6 +77,7 @@ const props = defineProps<{
transform: translateX(-50%) scale(1);
}
.avatar-image {
margin: 0;
width: 48px;
height: 48px;
border-radius: 50%;
@@ -135,13 +135,13 @@ const Expand = createLucideIcon('Expand', expand);
width: auto;
}
@media (min-width: 960px) {
@media (min-width: 60rem) {
.overlay-container {
--left: var(--vp-sidebar-width);
}
}
@media (min-width: 1440px) {
@media (min-width: 90rem) {
.overlay-container {
--left: calc((100% - (var(--vp-layout-max-width) - 64px)) / 2 + var(--vp-sidebar-width) - 32px);
--right: calc(((100% - (var(--vp-layout-max-width) - var(--vp-sidebar-width))) - 272px) / 2);
@@ -27,7 +27,7 @@ const props = defineProps<{
const emit = defineEmits(['setActiveIcon']);
const { go } = useRouter();
const showOverlay = useMediaQuery('(min-width: 860px)');
const showOverlay = useMediaQuery('(min-width: 53.75rem)');
const { animate, confetti, confettiText } = useConfetti();
const icon = computed(() => {
@@ -156,6 +156,7 @@ const gridLines = computed(() => Array.from({ length: size.value - 1 }));
.size-button {
color: var(--vp-code-tab-text-color);
padding: 2px 8px;
font-size: 13px;
}
.size-button.active {
@@ -263,6 +263,7 @@ const prettyName = props.name
display: flex;
flex-direction: row;
gap: 12px;
font-size: 13px;
font-weight: 500;
transition:
color 0.25s,
@@ -334,6 +335,7 @@ const prettyName = props.name
input {
padding: 12px 20px;
padding-inline-start: 48px;
font-size: 13px;
border-radius: 8px;
background-color: var(--vp-c-bg-soft);
color: var(--vp-c-text-1);
@@ -177,6 +177,8 @@ onBeforeUnmount(() => {
}
.shortcuts-dialog {
/* VitePress 2's reset zeroes the margin that centres a modal dialog */
margin: auto;
width: min(480px, calc(100vw - 32px));
padding: 20px 24px 24px;
color: var(--vp-c-text-1);
@@ -51,7 +51,7 @@
display: none;
}
@media (min-width: 640px) {
@media (min-width: 40rem) {
.search-bar :deep(.select-button) {
padding: 11px 16px 11px 16px;
}
@@ -94,7 +94,7 @@
display: none;
}
@media (min-width: 640px) {
@media (min-width: 40rem) {
.search-bar :deep(.select-button) {
padding: 11px 16px 11px 16px;
}
@@ -105,7 +105,7 @@
}
@media (min-width: 960px) {
@media (min-width: 60rem) {
.search-bar {
padding-top: 32px;
margin-top: calc((var(--vp-layout-top-height, 0px) + 33px) * -1);
@@ -351,7 +351,7 @@ const opacity = computed(() => {
justify-content: center;
} */
/*
@media (min-width: 960px) {
@media (min-width: 60rem) {
.VPHomeHero :deep(.actions) {
justify-content: center;
}
@@ -131,7 +131,7 @@ const links = computed(() => [
justify-content: center;
}
@media (min-width: 1152px) {
@media (min-width: 72rem) {
.VPFooter {
padding: 32px;
}
@@ -115,14 +115,14 @@ function isEditingContent(event: KeyboardEvent): boolean {
<style>
@media (min-width: 768px) {
@media (min-width: 48rem) {
.VPNavBarSearch {
flex-grow: 1;
padding-left: 0px;
}
}
@media (min-width: 960px) {
@media (min-width: 60rem) {
.VPNavBarSearch {
padding-left: 0px;
}
@@ -145,6 +145,9 @@ function isEditingContent(event: KeyboardEvent): boolean {
[class*='DocSearch'] {
--docsearch-primary-color: var(--vp-c-brand-1);
--docsearch-highlight-color: var(--docsearch-primary-color);
/* DocSearch 4 fills the selected hit with this; VitePress points it at the (indigo) brand-soft */
--docsearch-hit-highlight-color: color-mix(in srgb, var(--vp-c-brand) 10%, transparent);
--docsearch-soft-primary-color: color-mix(in srgb, var(--vp-c-brand) 10%, transparent);
--docsearch-text-color: var(--vp-c-text-1);
--docsearch-muted-color: var(--vp-c-text-2);
--docsearch-searchbox-shadow: none;
@@ -170,8 +173,15 @@ function isEditingContent(event: KeyboardEvent): boolean {
border-top: 1px solid var(--vp-c-divider);
}
.DocSearch-Form {
/* DocSearch 4 turned the search field into a full-width header; inset it again like before.
Its CSS is loaded lazily after ours, hence the extra .DocSearch-Modal for specificity. */
.DocSearch-Modal .DocSearch-SearchBar {
padding: var(--docsearch-spacing);
}
.DocSearch-Modal .DocSearch-Form {
border: 1px solid var(--vp-c-brand-1);
border-radius: 4px;
background-color: var(--vp-c-white);
}
@@ -57,7 +57,7 @@ const props = defineProps<{
align-items: flex-start;
gap: 24px;
}
@media screen and (min-width: 480px) {
@media screen and (min-width: 30rem) {
.package-header {
flex-direction: row;
}
@@ -167,13 +167,13 @@ const stats = [
margin: 0 -24px;
}
@media (min-width: 640px) {
@media (min-width: 40rem) {
.stats {
grid-template-columns: repeat(4, minmax(0, 1fr));
}
}
@media (min-width: 768px) {
@media (min-width: 48rem) {
.hero {
padding-top: 96px;
}
@@ -188,7 +188,7 @@ const stats = [
}
}
@media (min-width: 960px) {
@media (min-width: 60rem) {
.hero-content {
flex-direction: row;
}
@@ -240,7 +240,7 @@ const initial = <T,>(value: T) => (reducedMotion.value ? false : value);
overflow: hidden;
}
@media (min-width: 960px) {
@media (min-width: 60rem) {
.sponsor-hero-animation {
max-width: 860px;
}
@@ -167,8 +167,9 @@ const links = computed(() => getTierLinks(props.tier));
gap: 8px;
}
/* flex (not block) keeps VitePress 2's VPButton centring its label vertically */
.primary-action {
display: block;
display: flex;
}
.secondary-action {
@@ -216,7 +216,7 @@ function scrollTrack(direction: 1 | -1) {
background: linear-gradient(to right, transparent, var(--vp-c-bg) 85%);
}
@media (min-width: 640px) {
@media (min-width: 40rem) {
.fade-left {
width: 96px;
}
@@ -68,14 +68,14 @@ const isActive = computed(() => page.value.relativePath === 'sponsor.md');
transform: scale(1.1);
}
@media (min-width: 768px) {
@media (min-width: 48rem) {
.sponsor-button {
margin-left: 16px;
}
}
/* The nav menu leaves no room for the label between tablet and desktop widths. */
@media (min-width: 768px) and (max-width: 959px) {
@media (min-width: 48rem) and (max-width: 59.9375rem) {
.sponsor-button {
justify-content: center;
width: 32px;
+54 -5
View File
@@ -1,3 +1,35 @@
/* VitePress 2 replaced its base styles with Tailwind's preflight. Our custom components were built
on VitePress 1's base (fixed 24px line-height, 16px/400 headings), so restore those parts.
This layer sits right after VitePress's base layer, so every component and page style still wins. */
@layer __vitepress_base, vp1-base;
@layer vp1-base {
body {
line-height: 24px;
}
h1,
h2,
h3,
h4,
h5,
h6 {
line-height: 24px;
font-size: 16px;
font-weight: 400;
}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
input[type='number'] {
-moz-appearance: textfield;
}
}
:root {
--vp-c-brand: #f56565;
--vp-c-brand-light: #f67373;
@@ -123,8 +155,10 @@ html::-webkit-scrollbar-thumb:active {
}
}
/* VitePress 2 clips horizontal overflow itself (overflow-x: clip), but unlike the old overflow-x: hidden
that doesn't contain the last section's bottom margin, so keep a formatting context for the spacing. */
.VPHome {
overflow-x: hidden;
display: flow-root;
}
.VPNavBarTitle .logo {
@@ -189,7 +223,7 @@ html::-webkit-scrollbar-thumb:active {
display: none;
}
@media (min-width: 960px) {
@media (min-width: 60rem) {
.VPHomeHero .container .image {
order: 1;
margin-bottom: auto;
@@ -273,13 +307,23 @@ html::-webkit-scrollbar-thumb:active {
transform: rotate(-90deg);
}
/* VitePress 2 only transitions opacity and visibility here (and closes faster than it opens),
so add transform to both, or the slide would jump */
.VPNav .VPNavBarMenuGroup .button[aria-expanded='false'] + .menu {
transform: translateY(-8px);
transition:
opacity 0.1s,
visibility 0.1s,
transform 0.1s;
}
.VPNav .VPNavBarMenuGroup:hover .button + .menu,
.VPNav .VPNavBarMenuGroup .button[aria-expanded='true'] + .menu {
transform: translateY(0);
transition:
opacity 0.25s,
visibility 0.25s,
transform 0.25s;
}
/* Appearance switch: the thumb sits 2px inside the track and slides over with a small bounce,
@@ -385,7 +429,7 @@ html.dark .VPNav .VPSwitchAppearance .icon .moon {
transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
}
@media (min-width: 960px) {
@media (min-width: 60rem) {
.VPSidebar {
padding-right: 24px !important;
}
@@ -618,6 +662,11 @@ html.dark .VPNav .VPSwitchAppearance .icon .moon {
overflow: hidden;
}
/* VitePress 2 gives `.vp-doc img` a 1rem block margin */
.vp-doc .example-guidance__image {
margin: 0;
}
.example-guidance__image--raw svg {
display: block;
width: 100%;
@@ -681,7 +730,7 @@ html.dark .VPNav .VPSwitchAppearance .icon .moon {
--example-guidance-label-bg: var(--vp-c-warning-1);
}
@media (min-width: 640px) {
@media (min-width: 40rem) {
.example-block {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
@@ -697,7 +746,7 @@ html.dark .VPNav .VPSwitchAppearance .icon .moon {
}
}
@media (min-width: 960px) {
@media (min-width: 60rem) {
.example-block {
grid-template-columns: minmax(0, 0.9fr) repeat(2, minmax(0, 1fr));
}
+2 -2
View File
@@ -205,7 +205,7 @@ function releaseTagLink(version) {
align-items: flex-start;
}
@media (min-width: 640px) {
@media (min-width: 40rem) {
.layout {
align-items: flex-start;
display: grid;
@@ -247,7 +247,7 @@ function releaseTagLink(version) {
margin: 24px -24px 24px;
}
@media (min-width: 640px) {
@media (min-width: 40rem) {
.tab-list {
margin: 24px 0 24px;
}