starlight-theme-nova 0.7.4 → 0.8.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.
package/lib/styles.gen.css
CHANGED
|
@@ -100,7 +100,8 @@
|
|
|
100
100
|
/* layer: shortcuts */
|
|
101
101
|
.nova-code-copy-button-icon-check{--nova-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");-webkit-mask:var(--nova-icon) no-repeat;mask:var(--nova-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;display:block;width:100%;height:100%;}
|
|
102
102
|
.nova-code-copy-button-icon-clipboard{--nova-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Crect width='8' height='4' x='8' y='2' rx='1' ry='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--nova-icon) no-repeat;mask:var(--nova-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;display:block;width:100%;height:100%;}
|
|
103
|
-
.nova-link-button-icon{--nova-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='
|
|
103
|
+
.nova-link-button-icon-left{--nova-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m12 19l-7-7l7-7m7 7H5'/%3E%3C/svg%3E");-webkit-mask:var(--nova-icon) no-repeat;mask:var(--nova-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;width:1.25rem;height:1.25rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;}
|
|
104
|
+
.nova-link-button-icon-right{--nova-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 12h14m-7-7l7 7l-7 7'/%3E%3C/svg%3E");-webkit-mask:var(--nova-icon) no-repeat;mask:var(--nova-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;width:1.25rem;height:1.25rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;}
|
|
104
105
|
.nova-link-card-icon{--nova-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 12h14m-7-7l7 7l-7 7'/%3E%3C/svg%3E");-webkit-mask:var(--nova-icon) no-repeat;mask:var(--nova-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;margin-left:0.5rem;width:1.25rem;height:1.25rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;}
|
|
105
106
|
.nova-pagination-link-icon-left{--nova-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m15 18l-6-6l6-6'/%3E%3C/svg%3E");-webkit-mask:var(--nova-icon) no-repeat;mask:var(--nova-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}
|
|
106
107
|
.nova-pagination-link-icon-right{--nova-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m9 18l6-6l-6-6'/%3E%3C/svg%3E");-webkit-mask:var(--nova-icon) no-repeat;mask:var(--nova-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1em;height:1em;}
|
|
@@ -130,10 +131,11 @@ div[data-nova-code-container][data-nova-code-title] .nova-code-title{display:blo
|
|
|
130
131
|
.nova-pagination-divider{flex:1 1 0%;}
|
|
131
132
|
.nova-pagination-link[rel="next"]{flex-direction:row;}
|
|
132
133
|
.nova-pagination-link[rel="prev"]{flex-direction:row-reverse;}
|
|
133
|
-
.nova-link-button:hover .nova-link-button-icon,
|
|
134
|
+
.nova-link-button:hover .nova-link-button-icon-left,
|
|
135
|
+
.nova-pagination-link:hover .nova-pagination-link-icon-left{--nova-translate-x:-0.25rem;transform:translateX(var(--nova-translate-x)) translateY(var(--nova-translate-y)) translateZ(var(--nova-translate-z)) rotate(var(--nova-rotate)) rotateX(var(--nova-rotate-x)) rotateY(var(--nova-rotate-y)) rotateZ(var(--nova-rotate-z)) skewX(var(--nova-skew-x)) skewY(var(--nova-skew-y)) scaleX(var(--nova-scale-x)) scaleY(var(--nova-scale-y)) scaleZ(var(--nova-scale-z));}
|
|
136
|
+
.nova-link-button:hover .nova-link-button-icon-right,
|
|
134
137
|
.nova-link-card:hover .nova-link-card-icon,
|
|
135
138
|
.nova-pagination-link:hover .nova-pagination-link-icon-right{--nova-translate-x:0.25rem;transform:translateX(var(--nova-translate-x)) translateY(var(--nova-translate-y)) translateZ(var(--nova-translate-z)) rotate(var(--nova-rotate)) rotateX(var(--nova-rotate-x)) rotateY(var(--nova-rotate-y)) rotateZ(var(--nova-rotate-z)) skewX(var(--nova-skew-x)) skewY(var(--nova-skew-y)) scaleX(var(--nova-scale-x)) scaleY(var(--nova-scale-y)) scaleZ(var(--nova-scale-z));}
|
|
136
|
-
.nova-pagination-link:hover .nova-pagination-link-icon-left{--nova-translate-x:-0.25rem;transform:translateX(var(--nova-translate-x)) translateY(var(--nova-translate-y)) translateZ(var(--nova-translate-z)) rotate(var(--nova-rotate)) rotateX(var(--nova-rotate-x)) rotateY(var(--nova-rotate-y)) rotateZ(var(--nova-rotate-z)) skewX(var(--nova-skew-x)) skewY(var(--nova-skew-y)) scaleX(var(--nova-scale-x)) scaleY(var(--nova-scale-y)) scaleZ(var(--nova-scale-z));}
|
|
137
139
|
.nova-code-copy-button:active{--nova-scale-x:0.9;--nova-scale-y:0.9;transform:translateX(var(--nova-translate-x)) translateY(var(--nova-translate-y)) translateZ(var(--nova-translate-z)) rotate(var(--nova-rotate)) rotateX(var(--nova-rotate-x)) rotateY(var(--nova-rotate-y)) rotateZ(var(--nova-rotate-z)) skewX(var(--nova-skew-x)) skewY(var(--nova-skew-y)) scaleX(var(--nova-scale-x)) scaleY(var(--nova-scale-y)) scaleZ(var(--nova-scale-z));}
|
|
138
140
|
.nova-link-button:active{--nova-scale-x:0.97;--nova-scale-y:0.97;transform:translateX(var(--nova-translate-x)) translateY(var(--nova-translate-y)) translateZ(var(--nova-translate-z)) rotate(var(--nova-rotate)) rotateX(var(--nova-rotate-x)) rotateY(var(--nova-rotate-y)) rotateZ(var(--nova-rotate-z)) skewX(var(--nova-skew-x)) skewY(var(--nova-skew-y)) scaleX(var(--nova-scale-x)) scaleY(var(--nova-scale-y)) scaleZ(var(--nova-scale-z));}
|
|
139
141
|
.nova-link-card:active{--nova-scale-x:0.99;--nova-scale-y:0.99;transform:translateX(var(--nova-translate-x)) translateY(var(--nova-translate-y)) translateZ(var(--nova-translate-z)) rotate(var(--nova-rotate)) rotateX(var(--nova-rotate-x)) rotateY(var(--nova-rotate-y)) rotateZ(var(--nova-rotate-z)) skewX(var(--nova-skew-x)) skewY(var(--nova-skew-y)) scaleX(var(--nova-scale-x)) scaleY(var(--nova-scale-y)) scaleZ(var(--nova-scale-z));}
|
package/package.json
CHANGED
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
import { Image } from 'astro:assets'
|
|
3
3
|
import { PAGE_TITLE_ID } from '../constants'
|
|
4
4
|
import LinkButton from './LinkButton.astro'
|
|
5
|
+
import type { StarlightRouteEntryData } from '../content'
|
|
6
|
+
|
|
7
|
+
const data = Astro.locals.starlightRoute.entry.data as StarlightRouteEntryData
|
|
5
8
|
|
|
6
|
-
const { data } = Astro.locals.starlightRoute.entry
|
|
7
9
|
const { title = data.title, tagline, image, actions = [] } = data.hero || {}
|
|
8
10
|
|
|
9
11
|
const imageAttrs = {
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
---
|
|
2
|
+
import type { StarlightIcon } from '@astrojs/starlight/types'
|
|
2
3
|
import type { HTMLAttributes } from 'astro/types'
|
|
4
|
+
import LinkButtonIcon from './LinkButtonIcon.astro'
|
|
3
5
|
|
|
4
6
|
interface Props extends Omit<HTMLAttributes<'a'>, 'href'> {
|
|
5
7
|
href: string | URL
|
|
8
|
+
icon?: StarlightIcon | undefined
|
|
9
|
+
iconPlacement?: 'start' | 'end' | undefined
|
|
6
10
|
variant?: 'primary' | 'secondary' | 'minimal'
|
|
7
11
|
}
|
|
8
12
|
|
|
9
|
-
const {
|
|
13
|
+
const {
|
|
14
|
+
class: className,
|
|
15
|
+
icon,
|
|
16
|
+
iconPlacement = 'end',
|
|
17
|
+
variant = 'primary',
|
|
18
|
+
...attrs
|
|
19
|
+
} = Astro.props
|
|
10
20
|
---
|
|
11
21
|
|
|
12
22
|
<span class="not-content">
|
|
@@ -22,7 +32,8 @@ const { class: className, variant = 'primary', ...attrs } = Astro.props
|
|
|
22
32
|
]}
|
|
23
33
|
{...attrs}
|
|
24
34
|
>
|
|
25
|
-
<
|
|
26
|
-
<
|
|
35
|
+
{icon && iconPlacement === 'start' && <LinkButtonIcon icon={icon} />}
|
|
36
|
+
<slot />
|
|
37
|
+
{icon && iconPlacement === 'end' && <LinkButtonIcon icon={icon} />}
|
|
27
38
|
</a>
|
|
28
39
|
</span>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { Icon } from '@astrojs/starlight/components'
|
|
3
|
+
import type { StarlightIcon } from '@astrojs/starlight/types'
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
icon: StarlightIcon
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const { icon } = Astro.props
|
|
10
|
+
|
|
11
|
+
let className = ''
|
|
12
|
+
|
|
13
|
+
if (icon === 'right-arrow') {
|
|
14
|
+
className = 'nova-link-button-icon-right'
|
|
15
|
+
} else if (icon === 'left-arrow') {
|
|
16
|
+
className = 'nova-link-button-icon-left'
|
|
17
|
+
}
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
{className ? <div class={className} /> : <Icon name={icon} size="1.25rem" />}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { docsLoader } from '@astrojs/starlight/loaders'
|
|
2
|
+
import { docsSchema } from '@astrojs/starlight/schema'
|
|
3
|
+
import { defineCollection } from 'astro:content'
|
|
4
|
+
|
|
5
|
+
export const collections = {
|
|
6
|
+
docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),
|
|
7
|
+
}
|
package/src/content.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file contains some types by simplifying and modifying the generated
|
|
3
|
+
* files `.astro/content.d.ts`.
|
|
4
|
+
*
|
|
5
|
+
* Normally, Astro will generate a `.astro/content.d.ts` file for an Astro app
|
|
6
|
+
* project. However, since starlight-theme-nova is a library instead of an app,
|
|
7
|
+
* we don't have those auto-generated files.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
declare module 'astro:content' {
|
|
11
|
+
export interface RenderResult {
|
|
12
|
+
Content: import('astro/runtime/server/index.js').AstroComponentFactory
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type ContentConfig = typeof import('./content.config.js')
|
|
17
|
+
|
|
18
|
+
type ReturnTypeOrOriginal<T> = T extends (...args: any[]) => infer R ? R : T
|
|
19
|
+
|
|
20
|
+
export type StarlightRouteEntryData = import('astro/zod').infer<
|
|
21
|
+
ReturnTypeOrOriginal<Required<ContentConfig['collections']['docs']>['schema']>
|
|
22
|
+
>
|
package/src/types.d.ts
CHANGED