vitepress 1.0.0-draft.7 → 1.0.0-draft.8

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.
@@ -8,8 +8,8 @@ export interface HeroAction {
8
8
  }
9
9
 
10
10
  export interface Image {
11
- light: string
12
- dark: string
11
+ src: string
12
+ alt?: string
13
13
  }
14
14
 
15
15
  defineProps<{
@@ -44,8 +44,8 @@ defineProps<{
44
44
 
45
45
  <div v-if="image" class="image">
46
46
  <div class="image-container">
47
- <img class="image-src light" :src="image.light">
48
- <img class="image-src dark" :src="image.dark">
47
+ <div class="image-bg" />
48
+ <img class="image-src" :src="image.src" :alt="image.alt">
49
49
  </div>
50
50
  </div>
51
51
  </div>
@@ -56,7 +56,6 @@ defineProps<{
56
56
  .VPHero {
57
57
  margin-top: calc(var(--vp-nav-height) * -1);
58
58
  padding: calc(var(--vp-nav-height) + 48px) 24px 48px;
59
- overflow: hidden;
60
59
  }
61
60
 
62
61
  @media (min-width: 640px) {
@@ -229,6 +228,15 @@ defineProps<{
229
228
  }
230
229
  }
231
230
 
231
+ @media (min-width: 960px) {
232
+ .image {
233
+ order: 2;
234
+ margin: 0;
235
+ width: calc(100% / 3);
236
+ min-height: 100%;
237
+ }
238
+ }
239
+
232
240
  .image-container {
233
241
  position: relative;
234
242
  margin: 0 auto;
@@ -243,43 +251,60 @@ defineProps<{
243
251
  }
244
252
  }
245
253
 
246
- .image-src {
254
+ @media (min-width: 960px) {
255
+ .image-container {
256
+ display: flex;
257
+ justify-content: center;
258
+ align-items: center;
259
+ width: 100%;
260
+ height: 100%;
261
+ transform: translate(-32px, -32px);
262
+ }
263
+ }
264
+
265
+ .image-bg {
247
266
  position: absolute;
248
267
  top: 50%;
249
268
  left: 50%;
250
- max-width: 392px;
269
+ border-radius: 50%;
270
+ width: 192px;
271
+ height: 192px;
272
+ background-image: var(--vp-home-hero-image-background-image);
273
+ filter: var(--vp-home-hero-image-filter);
251
274
  transform: translate(-50%, -50%);
252
275
  }
253
276
 
254
- .image-src.light { opacity: 1; }
255
- .image-src.dark { opacity: 0; }
256
-
257
- .dark .image-src.light { opacity: 0; }
258
- .dark .image-src.dark { opacity: 1; }
259
-
260
277
  @media (min-width: 640px) {
261
- .image-src {
262
- max-width: 512px;
263
- transform: translate(-50%, -50%);
278
+ .image-bg {
279
+ width: 256px;
280
+ height: 256px;
264
281
  }
265
282
  }
266
283
 
267
284
  @media (min-width: 960px) {
268
- .image {
269
- order: 2;
270
- margin: -8px 0;
271
- width: calc(100% / 3);
272
- min-height: 100%;
285
+ .image-bg {
286
+ width: 320px;
287
+ height: 320px;
273
288
  }
289
+ }
274
290
 
275
- .image-container {
276
- width: 100%;
277
- height: 100%;
291
+ .image-src {
292
+ position: absolute;
293
+ top: 50%;
294
+ left: 50%;
295
+ max-width: 192px;
296
+ transform: translate(-50%, -50%);
297
+ }
298
+
299
+ @media (min-width: 640px) {
300
+ .image-src {
301
+ max-width: 256px;
278
302
  }
303
+ }
279
304
 
305
+ @media (min-width: 960px) {
280
306
  .image-src {
281
- max-width: 640px;
282
- transform: translate(calc(-50% - 32px), calc(-50% - 32px));
307
+ max-width: 320px;
283
308
  }
284
309
  }
285
310
  </style>
@@ -347,4 +347,7 @@
347
347
  :root {
348
348
  --vp-home-hero-name-color: var(--vp-c-brand);
349
349
  --vp-home-hero-name-background: transparent;
350
+
351
+ --vp-home-hero-image-background-image: none;
352
+ --vp-home-hero-image-filter: none;
350
353
  }
package/dist/node/cli.js CHANGED
@@ -266,7 +266,7 @@ function isNumber (x) {
266
266
  return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
267
267
  }
268
268
 
269
- var version = "1.0.0-draft.7";
269
+ var version = "1.0.0-draft.8";
270
270
 
271
271
  const argv = minimist(process.argv.slice(2));
272
272
  console.log(c.cyan(`vitepress v${version}`));
@@ -268,7 +268,7 @@ function isNumber (x) {
268
268
  return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
269
269
  }
270
270
 
271
- var version = "1.0.0-draft.7";
271
+ var version = "1.0.0-draft.8";
272
272
 
273
273
  const argv = minimist(process.argv.slice(2));
274
274
  console.log(serve.c.cyan(`vitepress v${version}`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitepress",
3
- "version": "1.0.0-draft.7",
3
+ "version": "1.0.0-draft.8",
4
4
  "description": "Vite & Vue powered static site generator",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@7.0.1",