#useHead.bodyAttrs.class is adding class instead of replacing

2 messages · Page 1 of 1 (latest)

rough cosmos
#

i was from version 3.0.0-rc.14 and upgraded to 3.5.1 (latest)
the useHead() at bodyAttrs.class, It doesnt replace the class but instead its adding class,

        useHead({
          bodyAttrs: {
            class: theme.value ? "dark" : "sun"
          }
        });

how do i fix this so i can replace the body class instead of adding new one?

digital thorn
#

You need to use a computed getter (or just a computed)

useHead({
  bodyAttrs: {
    class: () => theme.value ? "dark" : "sun"
   }
});