@@ -15,8 +15,11 @@ import type { ArtConfig, NavItem, ProjectItem } from './types'
1515import type { CollectionEntry } from './types/content'
1616import type { Appearance } from './utils/appearance'
1717import path from 'node:path'
18+ import { fileURLToPath } from 'node:url'
1819import { defu } from 'defu'
1920
21+ const _dirname = path . dirname ( fileURLToPath ( import . meta. url ) )
22+
2023type GlobOptions = Parameters < typeof glob > [ 0 ]
2124
2225export function getDefaultConfig ( userConfig : Config , astroConfig : AstroConfig ) : Config {
@@ -127,6 +130,21 @@ export function getDefaultConfig(userConfig: Config, astroConfig: AstroConfig):
127130 viewTransition : {
128131 enable : true ,
129132 } ,
133+ postcss : {
134+ postcssGlobalData : {
135+ files : [
136+ {
137+ file : path . resolve ( _dirname , './styles/global-data.css' ) ,
138+ remove : false ,
139+ position : 'prepend' ,
140+ } ,
141+ ] ,
142+ } ,
143+ postcssPresetEnv : {
144+ stage : 2 ,
145+ minimumVendorImplementations : 2 ,
146+ } ,
147+ } ,
130148 integrations : {
131149 nprogress : {
132150 showSpinner : false ,
@@ -482,6 +500,13 @@ export interface Config {
482500 */
483501 enable ?: boolean
484502 }
503+ /**
504+ * Built-in PostCSS plugins configuration options
505+ */
506+ postcss ?: {
507+ postcssGlobalData ?: import ( '@byronogis/postcss-global-data' ) . pluginOptions
508+ postcssPresetEnv ?: import ( 'postcss-preset-env' ) . pluginOptions
509+ }
485510 /**
486511 * Integrations configuration, you can configure or disable built-in integrations here.
487512 */
@@ -572,6 +597,9 @@ export type ResolvedConfig = SetRequiredDeep<
572597 | 'components.NavbarBrand'
573598 | 'viewTransition'
574599 | 'viewTransition.enable'
600+ | 'postcss'
601+ | 'postcss.postcssGlobalData'
602+ | 'postcss.postcssPresetEnv'
575603 | 'integrations'
576604 | 'integrations.nprogress'
577605 | 'integrations.sitemap'
0 commit comments