becem-gharbi / nuxt-naiveui

Unofficial Naive UI module for Nuxt
https://nuxt-naiveui.bg.tn
MIT License
163 stars 20 forks source link

generateColorThemes get wrong color #66

Closed transtone closed 7 months ago

transtone commented 7 months ago

v1.12.1 the primary color is not primary, but primaryHover.

image

becem-gharbi commented 7 months ago

Thanks for noticing this issue, the main color is the sixth in palette with index 5 not 6 😅

transtone commented 7 months ago

Thanks for noticing this issue, the main color is the sixth in palette with index 5 not 6 😅

how to set the sixth color?

set primary get primaryHover, it's weird and confused.

================

we can use themeOverrides just in n-config-provider. App.vue :

<template>
  <div class="vue-app min-h-full">
    <n-config-provider :locale="zhCN" :date-locale="dateZhCN" :theme-overrides="themeOverrides" abstract>
      <n-dialog-provider>
        <NuxtLayout>
          <NuxtPage />
        </NuxtLayout>
      </n-dialog-provider>
    </n-config-provider>
  </div>
</template>

<script setup>
import { generate } from '@ant-design/colors'
import { zhCN, dateZhCN, NConfigProvider } from 'naive-ui'

const themeOverrides = computed(() => {
  // const colors = generate('#1890ff', { theme: 'dark', backgroundColor: '#141414', });
  const primary = generate('#0064c8')
  return {
    common: {
      primaryColor: primary[5],
      primaryColorHover: primary[4],
      primaryColorPressed: primary[6],
      primaryColorSuppl: primary[7],
      // fontSize: '12px',
      // fontSizeSmall: '12px',
      // fontSizeMedium: '12px',
      // borderRadius: '2px',
      // heightMedium: '32px',
      // heightTiny: '24px',
    },
  }
})
</script>
becem-gharbi commented 7 months ago

how to set the sixth color?

Fixed on v1.12.2