vuetify-nuxt-module icon indicating copy to clipboard operation
vuetify-nuxt-module copied to clipboard

How to avoid style src attr ?

Open GreyXor opened this issue 2 years ago • 3 comments

Hello, I'm using this module with another one, nuxt-security, that allow me to generate CSP and nonce to make my website more secure. The CSP and nonce only work on styles added in <style /> but can't work in a style-src-attr, as for example :

<div class="v-application v-theme--light v-layout v-layout--full-height v-locale--is-ltr" style="z-index:1000;">

on the other hand, this one work:

<style id="vuetify-theme-stylesheet">:root {
      --v-theme-background: 255,255,255;
      --v-theme-background-overlay-multiplier: 1;
      --v-theme-surface: 255,255,255;
...

How do I get rid of style as an attribute and use it only in style tags?

GreyXor avatar Jul 20 '23 06:07 GreyXor

We need to add the cspNonce entry in the theme, you can try generating the cspNonce, add a Nuxt Plugin, register vuetify:before-create hook and apply the cspNonce to the theme.

Check CSP Nonce section: https://vuetifyjs.com/en/features/theme/

I Will try to include nuxt security module integration, IIRC that module will not work on my Windows laptop.

userquin avatar Jul 20 '23 08:07 userquin

@GreyXor yes, is it working?

userquin avatar Jul 20 '23 08:07 userquin

Not yet, I try to figure out how to set the cspNonce vuetify setting

GreyXor avatar Jul 20 '23 09:07 GreyXor