valaxy-theme-press 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,18 +30,26 @@ const { t } = useI18n()
30
30
  font-weight: 600;
31
31
  line-height: 24px;
32
32
  text-decoration: none;
33
- transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
33
+ transition:
34
+ background-color var(--va-transition-duration),
35
+ border-color var(--va-transition-duration),
36
+ box-shadow var(--va-transition-duration),
37
+ transform var(--va-transition-duration-fast) var(--pr-ease-out);
38
+ }
39
+
40
+ .press-button:active {
41
+ transform: scale(0.98);
34
42
  }
35
43
 
36
44
  .is-brand {
37
45
  color: #fff;
38
46
  background: var(--pr-button-brand-bg);
39
47
  border-color: transparent;
40
- box-shadow: 0 3px 8px rgb(77 65 169 / 0.12);
48
+ box-shadow: 0 3px 8px var(--pr-button-brand-shadow);
41
49
  }
42
50
 
43
51
  .is-brand:hover {
44
- box-shadow: 0 4px 20px rgb(100 77 214 / 0.28);
52
+ box-shadow: 0 4px 20px var(--pr-button-brand-shadow-hover);
45
53
  }
46
54
 
47
55
  .is-alt {
@@ -56,5 +64,6 @@ const { t } = useI18n()
56
64
 
57
65
  @media (prefers-reduced-motion: reduce) {
58
66
  .press-button { transition: none; }
67
+ .press-button:active { transform: none; }
59
68
  }
60
69
  </style>
@@ -68,7 +68,7 @@ const control = usePrevNext()
68
68
  border-radius: 8px;
69
69
  padding: 0.75rem 1rem;
70
70
  width: 100%;
71
- transition: border-color 0.25s;
71
+ transition: border-color var(--va-transition-duration);
72
72
  text-decoration: none;
73
73
  }
74
74
 
@@ -94,6 +94,6 @@ const control = usePrevNext()
94
94
  font-weight: 500;
95
95
  line-height: 20px;
96
96
  color: var(--va-c-primary);
97
- transition: color 0.25s;
97
+ transition: color var(--va-transition-duration);
98
98
  }
99
99
  </style>
@@ -30,15 +30,32 @@ const { t } = useI18n()
30
30
 
31
31
  <style scoped>
32
32
  .press-feature {
33
+ position: relative;
33
34
  height: 100%;
34
35
  padding: 40px 36px;
35
- transition: background-color 0.2s;
36
+ transition: background-color var(--va-transition-duration);
37
+ }
38
+
39
+ /* A brand line draws across the top edge on hover. */
40
+ .press-feature::before {
41
+ content: '';
42
+ position: absolute;
43
+ inset: 0 0 auto;
44
+ height: 2px;
45
+ background: var(--pr-button-brand-bg);
46
+ transform: scaleX(0);
47
+ transform-origin: left;
48
+ transition: transform var(--va-transition-duration-moderate) var(--pr-ease-out);
36
49
  }
37
50
 
38
51
  .press-feature:hover {
39
52
  background: var(--pr-c-brand-soft);
40
53
  }
41
54
 
55
+ .press-feature:hover::before {
56
+ transform: scaleX(1);
57
+ }
58
+
42
59
  .icon {
43
60
  display: flex;
44
61
  align-items: center;
@@ -46,6 +63,11 @@ const { t } = useI18n()
46
63
  margin-bottom: 24px;
47
64
  font-size: 32px;
48
65
  color: var(--pr-c-brand);
66
+ transition: transform var(--va-transition-duration-moderate) var(--pr-ease-out);
67
+ }
68
+
69
+ .press-feature:hover .icon {
70
+ transform: translateY(-3px);
49
71
  }
50
72
 
51
73
  /* The Markdown logo is monochrome; preserve the colors of other brand icons. */
@@ -71,12 +93,36 @@ const { t } = useI18n()
71
93
  color: var(--pr-c-text-2);
72
94
  }
73
95
 
96
+ /* Single-column phones: put the icon beside the title to keep long lists short. */
74
97
  @media (width <= 639px) {
75
- .press-feature { padding: 32px 24px; }
76
- .icon { margin-bottom: 20px; }
98
+ .press-feature {
99
+ padding: 24px;
100
+ }
101
+
102
+ .press-feature:has(> .icon) {
103
+ display: grid;
104
+ grid-template-columns: auto minmax(0, 1fr);
105
+ align-items: center;
106
+ column-gap: 14px;
107
+ }
108
+
109
+ .icon {
110
+ height: 28px;
111
+ margin-bottom: 0;
112
+ font-size: 28px;
113
+ }
114
+
115
+ .details {
116
+ grid-column: 1 / -1;
117
+ margin-top: 10px;
118
+ }
77
119
  }
78
120
 
79
121
  @media (prefers-reduced-motion: reduce) {
80
- .press-feature { transition: none; }
122
+ .press-feature,
123
+ .press-feature::before,
124
+ .icon { transition: none; }
125
+
126
+ .press-feature:hover .icon { transform: none; }
81
127
  }
82
128
  </style>
@@ -15,7 +15,7 @@ const columns = computed(() => {
15
15
  </script>
16
16
 
17
17
  <template>
18
- <div v-if="features.length" class="press-features" :style="{ '--pr-feature-columns': columns }">
18
+ <div v-if="features.length" class="press-features press-reveal" :style="{ '--pr-feature-columns': columns }">
19
19
  <div v-for="feature in features" :key="feature.title" class="press-feature-cell">
20
20
  <PressFeature :feature="feature" />
21
21
  </div>
@@ -54,7 +54,7 @@ const { t } = useI18n()
54
54
  height: 2.75rem;
55
55
  cursor: pointer;
56
56
  color: var(--press-c-text-2);
57
- transition: all var(--va-transition-duration-fast) cubic-bezier(0.4, 0, 0.2, 1);
57
+ transition: color var(--va-transition-duration-fast) var(--pr-ease-standard), transform var(--va-transition-duration-fast) var(--pr-ease-standard);
58
58
  outline: none;
59
59
 
60
60
  &:hover {
@@ -87,7 +87,7 @@ const { t } = useI18n()
87
87
  .press-search-btn-icon {
88
88
  width: 1.25rem;
89
89
  height: 1.25rem;
90
- transition: all var(--va-transition-duration-fast) cubic-bezier(0.4, 0, 0.2, 1);
90
+ transition: opacity var(--va-transition-duration-fast) var(--pr-ease-standard), transform var(--va-transition-duration-fast) var(--pr-ease-standard);
91
91
  opacity: 0.8;
92
92
 
93
93
  .press-search-btn:hover & {
@@ -96,7 +96,7 @@ const { t } = useI18n()
96
96
 
97
97
  &--close {
98
98
  transform: rotate(0deg);
99
- transition: all var(--va-transition-duration-fast) cubic-bezier(0.4, 0, 0.2, 1);
99
+ transition: opacity var(--va-transition-duration-fast) var(--pr-ease-standard), transform var(--va-transition-duration-fast) var(--pr-ease-standard);
100
100
 
101
101
  .press-search-btn:hover & {
102
102
  transform: rotate(90deg);
@@ -201,7 +201,7 @@ function getResultKey(title: string | Record<string, string>): string {
201
201
  border-radius: 12px;
202
202
  border: 2px solid var(--press-c-divider);
203
203
  box-shadow: 0 4px 20px rgb(0 0 0 / 0.1);
204
- transition: all var(--va-transition-duration-fast) ease;
204
+ transition: border-color var(--va-transition-duration-fast), box-shadow var(--va-transition-duration-fast);
205
205
 
206
206
  &:focus-within {
207
207
  border-color: var(--press-c-brand);
@@ -247,7 +247,7 @@ function getResultKey(title: string | Record<string, string>): string {
247
247
  border: none;
248
248
  cursor: pointer;
249
249
  border-radius: 8px;
250
- transition: all var(--va-transition-duration-fast) ease;
250
+ transition: color var(--va-transition-duration-fast), background-color var(--va-transition-duration-fast);
251
251
  flex-shrink: 0;
252
252
 
253
253
  &:hover {
@@ -297,8 +297,8 @@ function getResultKey(title: string | Record<string, string>): string {
297
297
  padding: 1rem 1.25rem;
298
298
  color: var(--press-c-text-1);
299
299
  text-decoration: none;
300
- transition: all var(--va-transition-duration-fast) ease;
301
- animation: slide-in-up 0.3s ease forwards;
300
+ transition: color var(--va-transition-duration-fast), background-color var(--va-transition-duration-fast);
301
+ animation: slide-in-up var(--va-transition-duration) var(--pr-ease-out) forwards;
302
302
  opacity: 0;
303
303
  transform: translateY(10px);
304
304
 
@@ -383,7 +383,7 @@ function getResultKey(title: string | Record<string, string>): string {
383
383
  color: var(--press-c-text-3);
384
384
  margin-left: 0.75rem;
385
385
  flex-shrink: 0;
386
- transition: all var(--va-transition-duration-fast) ease;
386
+ transition: color var(--va-transition-duration-fast), transform var(--va-transition-duration-fast) var(--pr-ease-out);
387
387
  }
388
388
 
389
389
  .press-result-item:hover .press-result-arrow {
@@ -449,7 +449,7 @@ function getResultKey(title: string | Record<string, string>): string {
449
449
 
450
450
  .modal-enter-active,
451
451
  .modal-leave-active {
452
- transition: all var(--va-transition-duration) cubic-bezier(0.4, 0, 0.2, 1);
452
+ transition: opacity var(--va-transition-duration) var(--pr-ease-standard), transform var(--va-transition-duration) var(--pr-ease-standard);
453
453
  }
454
454
 
455
455
  .modal-enter-from {
@@ -47,7 +47,7 @@ const iconStyle = computed(() => ({
47
47
  mask-repeat: no-repeat;
48
48
  mask-position: center;
49
49
  background-color: currentcolor;
50
- transition: transform 0.25s;
50
+ transition: transform var(--va-transition-duration) var(--pr-ease-out);
51
51
  }
52
52
 
53
53
  .press-get-started:hover .icon {
@@ -24,7 +24,7 @@ async function copyCommand() {
24
24
  </script>
25
25
 
26
26
  <template>
27
- <div class="press-home-command">
27
+ <div class="press-home-command" :class="{ 'is-copied': copied }">
28
28
  <span class="command-prompt" aria-hidden="true">$</span>
29
29
  <code class="command-text">{{ command }}</code>
30
30
  <button
@@ -60,6 +60,11 @@ async function copyCommand() {
60
60
  border-radius: 8px;
61
61
  background: var(--pr-c-surface);
62
62
  font-size: 13px;
63
+ transition: border-color var(--va-transition-duration);
64
+ }
65
+
66
+ .is-copied {
67
+ border-color: color-mix(in srgb, var(--pr-c-brand) 45%, transparent);
63
68
  }
64
69
 
65
70
  .command-prompt,
@@ -94,6 +99,23 @@ async function copyCommand() {
94
99
  background: var(--pr-c-brand-soft);
95
100
  }
96
101
 
102
+ .is-copied .command-copy {
103
+ color: var(--pr-c-brand);
104
+ }
105
+
106
+ @media (prefers-reduced-motion: no-preference) {
107
+ .is-copied .command-copy svg {
108
+ animation: press-copy-pop var(--va-transition-duration-moderate) var(--pr-ease-out);
109
+ }
110
+ }
111
+
112
+ @keyframes press-copy-pop {
113
+ from {
114
+ opacity: 0.4;
115
+ transform: scale(0.6);
116
+ }
117
+ }
118
+
97
119
  .command-status {
98
120
  position: absolute;
99
121
  top: calc(100% + 6px);
@@ -6,7 +6,7 @@ const fm = useFrontmatter()
6
6
 
7
7
  <template>
8
8
  <section v-if="fm.features?.length" class="press-home-features">
9
- <div v-if="fm.featuresTitle || fm.featuresDescription" class="features-heading">
9
+ <div v-if="fm.featuresTitle || fm.featuresDescription" class="features-heading press-reveal">
10
10
  <h2 v-if="fm.featuresTitle" class="features-title">
11
11
  {{ fm.featuresTitle }}
12
12
  </h2>
@@ -41,17 +41,17 @@ const actions = computed(() => {
41
41
  }"
42
42
  >
43
43
  <div class="hero-copy">
44
- <p v-if="hero.eyebrow" class="hero-eyebrow">
44
+ <p v-if="hero.eyebrow" class="hero-eyebrow press-enter">
45
45
  {{ hero.eyebrow }}
46
46
  </p>
47
- <h1 class="hero-heading">
47
+ <h1 class="hero-heading press-enter" :style="{ '--pr-enter-order': 1 }">
48
48
  <span v-if="hero.name" class="hero-name" :class="{ 'is-title': !hero.text }">{{ hero.name }}</span>
49
49
  <span v-if="hero.text" class="hero-text">{{ hero.text }}</span>
50
50
  </h1>
51
- <p v-if="hero.tagline" class="hero-tagline">
51
+ <p v-if="hero.tagline" class="hero-tagline press-enter" :style="{ '--pr-enter-order': 2 }">
52
52
  {{ hero.tagline }}
53
53
  </p>
54
- <div v-if="actions.length" class="hero-actions">
54
+ <div v-if="actions.length" class="hero-actions press-enter" :style="{ '--pr-enter-order': 3 }">
55
55
  <template v-for="action in actions" :key="action.link">
56
56
  <PressGetStarted
57
57
  v-if="action.type === 'fly'"
@@ -67,7 +67,7 @@ const actions = computed(() => {
67
67
  />
68
68
  </template>
69
69
  </div>
70
- <PressHomeCommand v-if="hero.command" :command="hero.command" />
70
+ <PressHomeCommand v-if="hero.command" class="press-enter" :style="{ '--pr-enter-order': 4 }" :command="hero.command" />
71
71
  </div>
72
72
 
73
73
  <div v-if="hero.image" class="hero-visual">
@@ -230,6 +230,20 @@ const actions = computed(() => {
230
230
  padding-top: 32px;
231
231
  }
232
232
 
233
+ /* The orbit settles in behind the copy; the divider border stays still. */
234
+ @media (prefers-reduced-motion: no-preference) {
235
+ .hero-visual > :first-child {
236
+ animation: press-hero-visual-in 0.9s var(--pr-ease-out) 0.12s both;
237
+ }
238
+ }
239
+
240
+ @keyframes press-hero-visual-in {
241
+ from {
242
+ opacity: 0.01;
243
+ transform: scale(0.96);
244
+ }
245
+ }
246
+
233
247
  @media (width <= 959px) {
234
248
  .press-home-hero {
235
249
  grid-template-columns: minmax(0, 1fr);
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import type { ThemeableImage } from '../types'
3
- import { useElementVisibility } from '@vueuse/core'
3
+ import { useDocumentVisibility, useElementVisibility } from '@vueuse/core'
4
4
  import { computed, shallowRef, useTemplateRef } from 'vue'
5
5
  import { useI18n } from 'vue-i18n'
6
6
 
@@ -14,8 +14,9 @@ const props = withDefaults(defineProps<{
14
14
  const { t } = useI18n()
15
15
  const scene = useTemplateRef<HTMLElement>('scene')
16
16
  const isVisible = useElementVisibility(scene)
17
+ const documentVisibility = useDocumentVisibility()
17
18
  const paused = shallowRef(false)
18
- const playing = computed(() => props.animated && isVisible.value && !paused.value)
19
+ const playing = computed(() => props.animated && isVisible.value && documentVisibility.value === 'visible' && !paused.value)
19
20
  </script>
20
21
 
21
22
  <template>
@@ -95,7 +95,7 @@ function scrollToTop() {
95
95
  .icon {
96
96
  width: 16px;
97
97
  height: 16px;
98
- transition: transform 0.2s;
98
+ transition: transform var(--va-transition-duration) var(--pr-ease-out);
99
99
  }
100
100
 
101
101
  [aria-expanded='true'] > .icon {
@@ -124,7 +124,7 @@ function scrollToTop() {
124
124
 
125
125
  .flyout-enter-active,
126
126
  .flyout-leave-active {
127
- transition: opacity 0.15s, transform 0.15s;
127
+ transition: opacity var(--va-transition-duration-fast), transform var(--va-transition-duration-fast) var(--pr-ease-out);
128
128
  }
129
129
 
130
130
  .flyout-enter-from,
@@ -191,7 +191,7 @@ watch(() => props.open, (val) => {
191
191
  border-radius: 12px;
192
192
  border: 2px solid var(--press-c-divider);
193
193
  box-shadow: 0 4px 20px rgb(0 0 0 / 0.1);
194
- transition: all var(--va-transition-duration-fast) ease;
194
+ transition: border-color var(--va-transition-duration-fast), box-shadow var(--va-transition-duration-fast);
195
195
 
196
196
  &:focus-within {
197
197
  border-color: var(--press-c-brand);
@@ -237,7 +237,7 @@ watch(() => props.open, (val) => {
237
237
  border: none;
238
238
  cursor: pointer;
239
239
  border-radius: 8px;
240
- transition: all var(--va-transition-duration-fast) ease;
240
+ transition: color var(--va-transition-duration-fast), background-color var(--va-transition-duration-fast);
241
241
  flex-shrink: 0;
242
242
 
243
243
  &:hover {
@@ -287,8 +287,8 @@ watch(() => props.open, (val) => {
287
287
  padding: 1rem 1.25rem;
288
288
  color: var(--press-c-text-1);
289
289
  text-decoration: none;
290
- transition: all var(--va-transition-duration-fast) ease;
291
- animation: slide-in-up 0.3s ease forwards;
290
+ transition: color var(--va-transition-duration-fast), background-color var(--va-transition-duration-fast);
291
+ animation: slide-in-up var(--va-transition-duration) var(--pr-ease-out) forwards;
292
292
  opacity: 0;
293
293
  transform: translateY(10px);
294
294
 
@@ -377,7 +377,7 @@ watch(() => props.open, (val) => {
377
377
  color: var(--press-c-text-3);
378
378
  margin-left: 0.75rem;
379
379
  flex-shrink: 0;
380
- transition: all var(--va-transition-duration-fast) ease;
380
+ transition: color var(--va-transition-duration-fast), transform var(--va-transition-duration-fast) var(--pr-ease-out);
381
381
  }
382
382
 
383
383
  .press-result-item:hover .press-result-arrow {
@@ -443,7 +443,7 @@ watch(() => props.open, (val) => {
443
443
 
444
444
  .modal-enter-active,
445
445
  .modal-leave-active {
446
- transition: all var(--va-transition-duration) cubic-bezier(0.4, 0, 0.2, 1);
446
+ transition: opacity var(--va-transition-duration) var(--pr-ease-standard), transform var(--va-transition-duration) var(--pr-ease-standard);
447
447
  }
448
448
 
449
449
  .modal-enter-from {
@@ -38,8 +38,8 @@ const route = useRoute()
38
38
  font-weight: 500;
39
39
  white-space: nowrap;
40
40
  transition:
41
- background-color 0.25s,
42
- color 0.25s;
41
+ background-color var(--va-transition-duration),
42
+ color var(--va-transition-duration);
43
43
 
44
44
  &:hover {
45
45
  background-color: #f1f1f1;
@@ -82,7 +82,7 @@ useActiveAnchor(container, marker)
82
82
  width: 1px;
83
83
  height: 18px;
84
84
  background-color: var(--va-c-brand);
85
- transition: top var(--va-transition-duration) cubic-bezier(0, 1, 0.5, 1), background-color var(--va-transition-duration-moderate), opacity var(--va-transition-duration);
85
+ transition: top var(--va-transition-duration) var(--pr-ease-out-expo), background-color var(--va-transition-duration-moderate), opacity var(--va-transition-duration);
86
86
  border-top-right-radius: 2px;
87
87
  border-bottom-right-radius: 2px;
88
88
  }
@@ -222,7 +222,7 @@ function onSelect(key: string) {
222
222
  padding: 4px;
223
223
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.08);
224
224
  z-index: 100;
225
- animation: press-dropdown-fade-in 0.15s ease;
225
+ animation: press-dropdown-fade-in var(--va-transition-duration-fast) var(--pr-ease-out);
226
226
  }
227
227
 
228
228
  @keyframes press-dropdown-fade-in {
@@ -264,7 +264,7 @@ function getSidebarRootItemClasses(groupIndex: number, itemIndex = 0, isSection
264
264
  opacity: 1;
265
265
  transform: translateX(0);
266
266
  transition: opacity var(--va-transition-duration),
267
- transform var(--va-transition-duration-moderate) cubic-bezier(0.19, 1, 0.22, 1);
267
+ transform var(--va-transition-duration-moderate) var(--pr-ease-out-expo);
268
268
  }
269
269
  }
270
270
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valaxy-theme-press",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Docs (VitePress-like) theme for Valaxy",
5
5
  "author": {
6
6
  "email": "me@yunyoujun.cn",
@@ -37,6 +37,6 @@
37
37
  "reka-ui": "^2.10.4"
38
38
  },
39
39
  "devDependencies": {
40
- "valaxy": "1.1.0"
40
+ "valaxy": "1.2.0"
41
41
  }
42
42
  }
@@ -39,7 +39,7 @@
39
39
  color: var(--press-code-tab-text-color);
40
40
  white-space: nowrap;
41
41
  cursor: pointer;
42
- transition: color 0.25s;
42
+ transition: color var(--va-transition-duration);
43
43
  }
44
44
 
45
45
  .vp-code-group .tabs label::after {
@@ -52,7 +52,7 @@
52
52
  border-radius: 2px;
53
53
  content: '';
54
54
  background-color: transparent;
55
- transition: background-color 0.25s;
55
+ transition: background-color var(--va-transition-duration);
56
56
  }
57
57
 
58
58
  .vp-code-group label:hover {
@@ -3,19 +3,43 @@
3
3
  --pr-font-display: "Avenir Next", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
4
4
  --pr-font-body: var(--va-font-sans);
5
5
  --pr-font-mono: var(--va-font-mono);
6
+
7
+ // brand: every brand tint derives from --va-c-primary (themeConfig.colors.primary)
6
8
  --pr-c-brand: color-mix(in srgb, var(--va-c-primary) 85%, #172554);
7
- --pr-c-accent: #8546ef;
8
- --pr-button-brand-bg: linear-gradient(120deg, color-mix(in srgb, var(--va-c-primary) 65%, #6750d8), #7547d9);
9
+ --pr-c-brand-hover: color-mix(in srgb, var(--va-c-primary) 70%, #172554);
9
10
  --pr-c-brand-soft: color-mix(in srgb, var(--va-c-primary) 8%, transparent);
11
+ --pr-c-accent: color-mix(in srgb, var(--va-c-primary) 70%, #fff);
12
+
13
+ // same stops in light and dark so white button text keeps >= 4.5:1
14
+ --pr-button-brand-bg: linear-gradient(
15
+ 120deg,
16
+ color-mix(in srgb, var(--va-c-primary) 85%, #172554),
17
+ color-mix(in srgb, var(--va-c-primary) 62%, #172554)
18
+ );
19
+ --pr-button-brand-shadow: color-mix(in srgb, var(--va-c-primary) 16%, transparent);
20
+ --pr-button-brand-shadow-hover: color-mix(in srgb, var(--va-c-primary) 32%, transparent);
10
21
  --pr-c-surface: color-mix(in srgb, var(--va-c-bg) 97%, #6876a0);
11
- --pr-c-orbit-glow: rgb(120 91 238 / 0.16);
12
- --pr-c-orbit-line: rgb(115 100 206 / 0.25);
22
+ --pr-c-orbit-glow: color-mix(in srgb, var(--va-c-primary) 16%, transparent);
23
+ --pr-c-orbit-line: color-mix(in srgb, var(--va-c-primary) 25%, transparent);
24
+
25
+ // core custom blocks and code tabs read --va-c-brand-*, which default to indigo
26
+ --va-c-brand-1: var(--pr-c-brand);
27
+ --va-c-brand-2: var(--pr-c-brand-hover);
28
+ --va-c-brand-3: var(--pr-c-brand-hover);
29
+ --va-c-brand-soft: var(--pr-c-brand-soft);
13
30
  --pr-c-indigo-lighter: #c9def1;
14
31
  --pr-c-bg: var(--va-c-bg);
15
32
  --pr-c-text-code: #374562;
16
33
  --pr-c-text-1: #202331;
17
34
  --pr-c-text-2: #626777;
18
35
 
36
+ // motion: durations come from --va-transition-duration(-fast|-moderate)
37
+ --pr-ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
38
+ --pr-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
39
+ --pr-ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
40
+ --pr-duration-enter: 0.6s;
41
+ --pr-enter-distance: 16px;
42
+
19
43
  // sidebar
20
44
  --pr-sidebar-bg: var(--va-c-bg);
21
45
  --pr-sidebar-divider: color-mix(in srgb, var(--pr-c-text-1) 12%, transparent);
@@ -48,12 +72,15 @@
48
72
  }
49
73
 
50
74
  .dark {
51
- --pr-c-brand: color-mix(in srgb, var(--va-c-primary) 65%, #c9d8ff);
75
+ // lighter tint keeps links and inline code >= 4.5:1 on dark surfaces
76
+ --pr-c-brand: color-mix(in srgb, var(--va-c-primary) 50%, #dde4ff);
77
+ --pr-c-brand-hover: color-mix(in srgb, var(--va-c-primary) 35%, #eef1ff);
52
78
  --pr-c-surface: color-mix(in srgb, var(--va-c-bg) 94%, #a1a6c7);
53
79
  --pr-c-brand-soft: color-mix(in srgb, var(--va-c-primary) 14%, transparent);
54
80
  --pr-c-divider-light: rgb(171 179 209 / 0.16);
55
- --pr-c-orbit-glow: rgb(116 72 229 / 0.23);
56
- --pr-c-orbit-line: rgb(162 144 249 / 0.27);
81
+ --pr-c-accent: color-mix(in srgb, var(--va-c-primary) 55%, #fff);
82
+ --pr-c-orbit-glow: color-mix(in srgb, var(--va-c-primary) 24%, transparent);
83
+ --pr-c-orbit-line: color-mix(in srgb, var(--pr-c-brand) 32%, transparent);
57
84
  --pr-c-text-code: var(--pr-c-indigo-lighter);
58
85
  --pr-c-text-1: #ffffffde;
59
86
  --pr-c-text-2: rgb(235 235 235 / 0.6);
package/styles/doc.css CHANGED
@@ -79,8 +79,8 @@
79
79
  opacity: 0;
80
80
  text-decoration: none;
81
81
  transition:
82
- color 0.25s,
83
- opacity 0.25s;
82
+ color var(--va-transition-duration),
83
+ opacity var(--va-transition-duration);
84
84
  }
85
85
 
86
86
  .press-doc .header-anchor::before {
@@ -132,14 +132,14 @@
132
132
  margin: 1rem 0;
133
133
  border-left: 2px solid var(--press-c-divider);
134
134
  padding-left: 1rem;
135
- transition: border-color 0.5s;
135
+ transition: border-color var(--va-transition-duration-moderate);
136
136
  color: var(--press-c-text-2);
137
137
  }
138
138
 
139
139
  .press-doc blockquote > p {
140
140
  margin: 0;
141
141
  font-size: 1rem;
142
- transition: color 0.5s;
142
+ transition: color var(--va-transition-duration-moderate);
143
143
  }
144
144
 
145
145
  .press-doc a {
@@ -148,8 +148,8 @@
148
148
  text-decoration: underline;
149
149
  text-underline-offset: 0.125rem;
150
150
  transition:
151
- color 0.25s,
152
- opacity 0.25s;
151
+ color var(--va-transition-duration),
152
+ opacity var(--va-transition-duration);
153
153
  }
154
154
 
155
155
  .press-doc a:hover {
@@ -232,7 +232,7 @@
232
232
  .press-doc tr {
233
233
  background-color: var(--press-c-bg);
234
234
  border-top: 1px solid var(--press-c-divider);
235
- transition: background-color 0.5s;
235
+ transition: background-color var(--va-transition-duration-moderate);
236
236
  }
237
237
 
238
238
  .press-doc tr:nth-child(2n) {
@@ -324,8 +324,8 @@
324
324
  padding: 0.1875rem 0.375rem;
325
325
  background-color: var(--press-code-bg);
326
326
  transition:
327
- color 0.25s,
328
- background-color 0.5s;
327
+ color var(--va-transition-duration),
328
+ background-color var(--va-transition-duration-moderate);
329
329
  }
330
330
 
331
331
  .press-doc a > code {
@@ -349,7 +349,7 @@
349
349
  margin: 1rem -1.5rem;
350
350
  background-color: var(--press-code-block-bg);
351
351
  overflow-x: auto;
352
- transition: background-color 0.5s;
352
+ transition: background-color var(--va-transition-duration-moderate);
353
353
  }
354
354
 
355
355
  @media (width >= 40rem) {
@@ -397,12 +397,12 @@
397
397
  line-height: var(--press-code-line-height);
398
398
  font-size: var(--press-code-font-size);
399
399
  color: var(--press-code-block-color);
400
- transition: color 0.5s;
400
+ transition: color var(--va-transition-duration-moderate);
401
401
  }
402
402
 
403
403
  .press-doc [class*='language-'] code .highlighted {
404
404
  background-color: var(--press-code-line-highlight-color);
405
- transition: background-color 0.5s;
405
+ transition: background-color var(--va-transition-duration-moderate);
406
406
  margin: 0 -1.5rem;
407
407
  padding: 0 1.5rem;
408
408
  width: calc(100% + 2 * 1.5rem);
@@ -418,7 +418,7 @@
418
418
  }
419
419
 
420
420
  .press-doc [class*='language-'] code .diff {
421
- transition: background-color 0.5s;
421
+ transition: background-color var(--va-transition-duration-moderate);
422
422
  margin: 0 -1.5rem;
423
423
  padding: 0 1.5rem;
424
424
  width: calc(100% + 2 * 1.5rem);
@@ -434,15 +434,15 @@
434
434
  filter: blur(0.095rem);
435
435
  opacity: 0.4;
436
436
  transition:
437
- filter 0.35s,
438
- opacity 0.35s;
437
+ filter var(--va-transition-duration-moderate),
438
+ opacity var(--va-transition-duration-moderate);
439
439
  }
440
440
 
441
441
  .press-doc [class*='language-'] .has-focused-lines .line:not(.has-focus) {
442
442
  opacity: 0.7;
443
443
  transition:
444
- filter 0.35s,
445
- opacity 0.35s;
444
+ filter var(--va-transition-duration-moderate),
445
+ opacity var(--va-transition-duration-moderate);
446
446
  }
447
447
 
448
448
  .press-doc [class*='language-']:hover .has-focused-lines .line:not(.has-focus) {
@@ -493,8 +493,8 @@
493
493
  font-size: var(--press-code-font-size);
494
494
  color: var(--press-code-line-number-color);
495
495
  transition:
496
- border-color 0.5s,
497
- color 0.5s;
496
+ border-color var(--va-transition-duration-moderate),
497
+ color var(--va-transition-duration-moderate);
498
498
  }
499
499
 
500
500
  .press-doc [class*='language-'] > button.copy {
@@ -518,9 +518,9 @@
518
518
  background-size: 1.25rem;
519
519
  background-repeat: no-repeat;
520
520
  transition:
521
- border-color 0.25s,
522
- background-color 0.25s,
523
- opacity 0.25s;
521
+ border-color var(--va-transition-duration),
522
+ background-color var(--va-transition-duration),
523
+ opacity var(--va-transition-duration);
524
524
  }
525
525
 
526
526
  .press-doc [class*='language-']:hover > button.copy,
@@ -583,8 +583,8 @@
583
583
  user-select: none;
584
584
  color: var(--press-code-lang-color);
585
585
  transition:
586
- color 0.4s,
587
- opacity 0.4s;
586
+ color var(--va-transition-duration-moderate),
587
+ opacity var(--va-transition-duration-moderate);
588
588
  }
589
589
 
590
590
  .press-doc [class*='language-']:hover > button.copy + span.lang,
package/styles/main.scss CHANGED
@@ -2,6 +2,7 @@
2
2
  @use "./markdown";
3
3
  @use "./api";
4
4
  @use "./sidebar";
5
+ @use "./motion";
5
6
 
6
7
  .layout {
7
8
  display: flex;
@@ -9,10 +10,8 @@
9
10
  }
10
11
 
11
12
  .press-layout {
12
- --press-c-brand-1: var(--pr-c-brand);
13
- --press-c-brand-2: var(--va-c-primary);
14
- --press-c-brand-3: var(--va-c-primary);
15
- --press-c-brand-soft: var(--pr-c-brand-soft);
13
+ // core sets --va-c-link on html.dark, so override it on the layout element
14
+ --va-c-link: var(--pr-c-brand);
16
15
 
17
16
  color: var(--pr-c-text-1);
18
17
  font-family: var(--pr-font-body);
@@ -20,7 +20,7 @@
20
20
  display: inline-block;
21
21
  text-decoration: none;
22
22
  border-bottom: 1px solid transparent;
23
- transition: all var(--va-transition-duration-moderate);
23
+ transition: color var(--va-transition-duration-moderate), border-color var(--va-transition-duration-moderate);
24
24
  }
25
25
 
26
26
  code:not(pre > code) {
@@ -53,7 +53,7 @@
53
53
 
54
54
  a {
55
55
  text-decoration: inherit;
56
- transition: all var(--va-transition-duration-moderate);
56
+ transition: color var(--va-transition-duration-moderate), border-color var(--va-transition-duration-moderate);
57
57
 
58
58
  &:hover {
59
59
  text-decoration: underline;
@@ -0,0 +1,28 @@
1
+ // Entrance and scroll-reveal motion.
2
+ // Pure CSS: content is fully visible without JS, and nothing moves when the
3
+ // visitor prefers reduced motion or the browser lacks scroll-driven animations.
4
+
5
+ // Start at 0.01 instead of 0 so animated text stays an LCP candidate.
6
+ @keyframes press-enter {
7
+ from {
8
+ opacity: 0.01;
9
+ transform: translateY(var(--pr-enter-distance));
10
+ }
11
+ }
12
+
13
+ @media (prefers-reduced-motion: no-preference) {
14
+ // One-shot entrance; set --pr-enter-order to stagger siblings.
15
+ .press-enter {
16
+ animation: press-enter var(--pr-duration-enter) var(--pr-ease-out) both;
17
+ animation-delay: calc(var(--pr-enter-order, 0) * 70ms);
18
+ }
19
+
20
+ @supports (animation-timeline: view()) {
21
+ // Rises in as it enters the viewport; already-visible content is unaffected.
22
+ .press-reveal {
23
+ animation: press-enter var(--pr-ease-out) both;
24
+ animation-timeline: view();
25
+ animation-range: entry 0% entry 240px;
26
+ }
27
+ }
28
+ }
package/styles/tokens.css CHANGED
@@ -64,8 +64,13 @@
64
64
 
65
65
  :root {
66
66
  --press-c-default-soft: var(--press-c-gray-soft);
67
- --press-c-brand-1: var(--press-c-indigo-1);
68
- --press-c-brand-2: var(--press-c-indigo-2);
67
+
68
+ /* Valaxy: brand follows --va-c-primary everywhere, including teleported
69
+ overlays (search modals) that render outside .press-layout. */
70
+ --press-c-brand-1: var(--pr-c-brand);
71
+ --press-c-brand-2: var(--pr-c-brand-hover);
72
+ --press-c-brand-3: var(--pr-c-brand-hover);
73
+ --press-c-brand-soft: var(--pr-c-brand-soft);
69
74
  --press-c-brand: var(--press-c-brand-1);
70
75
  --press-c-success-1: var(--press-c-green-1);
71
76
  --press-c-success-soft: var(--press-c-green-soft);