Dark Mode in combination of Noir (primary) + Soho (Surfaces) #2992
Replies: 4 comments
-
And I've have already set my |
Beta Was this translation helpful? Give feedback.
-
Hello @amanov-begli. It’s fantastic to see you’ve been using primevue for so long! Regarding your question, the issue with your custom preset not working is likely due to a few missing layers. The preset you chose is called Noir, which PrimeVue provides as a base template. I used this preset as a starting point and added the specific surface layer you requested. import { definePreset } from '@primevue/themes';
import Aura from '@primevue/themes/aura';
const Noir = definePreset(Aura, {
semantic: {
primary: {
50: '{surface.50}',
100: '{surface.100}',
200: '{surface.200}',
300: '{surface.300}',
400: '{surface.400}',
500: '{surface.500}',
600: '{surface.600}',
700: '{surface.700}',
800: '{surface.800}',
900: '{surface.900}',
950: '{surface.950}',
},
colorScheme: {
light: {
primary: {
color: '{primary.950}',
contrastColor: '#ffffff',
hoverColor: '{primary.900}',
activeColor: '{primary.800}',
},
highlight: {
background: '{primary.950}',
focusBackground: '{primary.700}',
color: '#ffffff',
focusColor: '#ffffff',
},
surface: {
0: '#ffffff',
50: '#f4f4f4',
100: '#e8e9e9',
200: '#d2d2d4',
300: '#bbbcbe',
400: '#a5a5a9',
500: '#8e8f93',
600: '#77787d',
700: '#616268',
800: '#4a4b52',
900: '#34343d',
950: '#1d1e27',
},
},
dark: {
primary: {
color: '{primary.50}',
contrastColor: '{primary.950}',
hoverColor: '{primary.100}',
activeColor: '{primary.200}',
},
highlight: {
background: '{primary.50}',
focusBackground: '{primary.300}',
color: '{primary.950}',
focusColor: '{primary.950}',
},
surface: {
0: '#ffffff',
50: '#f4f4f4',
100: '#e8e9e9',
200: '#d2d2d4',
300: '#bbbcbe',
400: '#a5a5a9',
500: '#8e8f93',
600: '#77787d',
700: '#616268',
800: '#4a4b52',
900: '#34343d',
950: '#1d1e27',
},
},
},
},
});
export default Noir; Hope this helps. Let me know if you have any questions 😁 |
Beta Was this translation helpful? Give feedback.
-
Hi @j0rgedev, thank you very much for your reply and please excuse me, that I am answering only now. Was on sick leave till today. Meanwhile I've created my own definePreset file and I will post it here as well. If there is something needed to be done, to close this topic, I can do it. My issue is resolved. Thanks again for your time! |
Beta Was this translation helpful? Give feedback.
-
import { createApp } from 'vue';
import App from './App.vue';
import router from './router';
import './styles/main.css';
// PrimeVue imports
import { definePreset } from '@primevue/themes';
import Aura from '@primevue/themes/aura';
import PrimeVue from 'primevue/config';
import Ripple from 'primevue/ripple';
// Variables and Function
const app = createApp(App);
const Noir = definePreset(Aura, {
// components: {
// button: {
// colorScheme: {
// dark: {
// primaryBackground: '{surface.50}',
// },
// },
// },
// checkbox: {
// colorScheme: {
// dark: {
// checkedBackground: '{surface.50}',
// checkedHoverBackground: '{surface.50}',
// },
// },
// },
// },
semantic: {
colorScheme: {
// for future light mode switcher
light: {},
dark: {
primary: {
0: '#ffffff',
50: '#f4f4f4',
100: '#e8e9e9',
200: '#d2d2d4',
300: '#bbbcbe',
400: '#a5a5a9',
500: '#8e8f93',
600: '#77787d',
700: '#616268',
800: '#4a4b52',
900: '#34343d',
950: '#1d1e27',
},
surface: {
0: '#ffffff',
50: '#f4f4f4',
100: '#e8e9e9',
200: '#d2d2d4',
300: '#bbbcbe',
400: '#a5a5a9',
500: '#8e8f93',
600: '#77787d',
700: '#616268',
800: '#4a4b52',
900: '#34343d',
950: '#1d1e27',
},
},
},
},
});
app.use(PrimeVue, {
theme: {
preset: Noir,
options: {
prefix: 'p',
darkModeSelector: '.my-app-dark',
},
},
ripple: true,
});
app.directive('ripple', Ripple);
app.use(router);
app.mount('#app'); |
Beta Was this translation helpful? Give feedback.
-
Hi Dear PrimeVue Team, I am a big fan of your work since 3 years already. A while ago I've started to create a nice app and right now decided to use Design tokens as a fundament for my app. Right now I am running into an issue of not getting proppert colors (surfaces, primary). Any support will be appreciated.
Here is how my login from PrimeBlocks looks like:
And here is how I would like to make it look:
My
main.ts
file looks like this:There is nothing in my
main.css
file beside imports. Here is the entire content of it:After pasting the code from the PirmeBlocks this Form does not get the correct colors I want to have. What I am missing or doing wrong. Any help will be more than appreciated
I would like to have this color palette. Attention on focus rings!
Thank you!
Be well
Begli!
Beta Was this translation helpful? Give feedback.
All reactions