diff --git a/src/defaults.ts b/src/defaults.ts index 52c117a3..8e73f864 100644 --- a/src/defaults.ts +++ b/src/defaults.ts @@ -23,7 +23,9 @@ export const defaultOptions = { colors: undefined, transitions: true }, - csp: false + csp: { + nonce: false + } } export const resolveColors = (colors?: string[]) => { diff --git a/src/module.ts b/src/module.ts index 54f647d5..9f6de75a 100644 --- a/src/module.ts +++ b/src/module.ts @@ -30,10 +30,18 @@ export interface ModuleOptions { /** * Configure Content Security Policy for Nuxt UI - * @defaultValue `false` + * @defaultValue `{ nonce: false }` * @link https://ui.nuxt.com/getting-started/installation/nuxt#csp */ - csp?: boolean + csp?: { + /** + * Enable nonce for inline styles. + * Set to `true` to automatically generate and use a nonce. + * Provide a string to use a specific nonce. + * @defaultValue `false` + */ + nonce?: boolean | string + } /** * Customize how the theme is generated