p6l.richard
p6l.richard
Explore posts from servers
TTCTheo's Typesafe Cult
Created by p6l.richard on 11/12/2022 in #questions
[Tailwind&Prisma] How can you tie a tailwind color configuration to a prisma enumâť“
Do you know if there's a way for me to obtain the hex value at runtime?
console.log({ col: fullConfig.theme?.textColor.mauveA[9] }); // "var(--mauveA9)"
console.log({ col: fullConfig.theme?.textColor.mauveA[9] }); // "var(--mauveA9)"
Instead of the variable string, I'd need the hex value. :/
29 replies
TTCTheo's Typesafe Cult
Created by p6l.richard on 11/12/2022 in #questions
[Tailwind&Prisma] How can you tie a tailwind color configuration to a prisma enumâť“
fair
29 replies
TTCTheo's Typesafe Cult
Created by p6l.richard on 11/12/2022 in #questions
[Tailwind&Prisma] How can you tie a tailwind color configuration to a prisma enumâť“
I think this could be what I was looking for. 🙌
29 replies
TTCTheo's Typesafe Cult
Created by p6l.richard on 11/12/2022 in #questions
[Tailwind&Prisma] How can you tie a tailwind color configuration to a prisma enumâť“
For clarification: you mean redixColors[c.name] right?
29 replies
TTCTheo's Typesafe Cult
Created by p6l.richard on 11/12/2022 in #questions
[Tailwind&Prisma] How can you tie a tailwind color configuration to a prisma enumâť“
Oh interesting
29 replies
TTCTheo's Typesafe Cult
Created by p6l.richard on 11/12/2022 in #questions
[Tailwind&Prisma] How can you tie a tailwind color configuration to a prisma enumâť“
I haven't worked with css variables a lot, so I'm a bit ignorant of the benefit.
29 replies
TTCTheo's Typesafe Cult
Created by p6l.richard on 11/12/2022 in #questions
[Tailwind&Prisma] How can you tie a tailwind color configuration to a prisma enumâť“
What's your recommendation for storing the color hex code in the database? In it's own table?
model User {
id String @id @default(cuid())
color Color
}

model Color {
id String @id @default(cuid())
hexCode String
colorVariable ColorVariable
}

/// all the color strings from e.g radix-colors or whatev
enum ColorVariable {
mauveA
mauveDarkA
red
redDark
}
model User {
id String @id @default(cuid())
color Color
}

model Color {
id String @id @default(cuid())
hexCode String
colorVariable ColorVariable
}

/// all the color strings from e.g radix-colors or whatev
enum ColorVariable {
mauveA
mauveDarkA
red
redDark
}
I don't quite understand why I would store the hexCode in the database as well. Like, wouldn't the colorVariable (or however you'd define this) be enough and then simply use the class names for applying the color?
29 replies
TTCTheo's Typesafe Cult
Created by p6l.richard on 11/12/2022 in #questions
[Tailwind&Prisma] How can you tie a tailwind color configuration to a prisma enumâť“
Okay
29 replies
TTCTheo's Typesafe Cult
Created by p6l.richard on 11/12/2022 in #questions
[Tailwind&Prisma] How can you tie a tailwind color configuration to a prisma enumâť“
const radixColors = require("@radix-ui/colors");

module.exports = {
plugins: [
require("windy-radix-palette")({
colors: {
mauveA: radixColors.mauveA,
mauveDarkA: radixColors.mauveDarkA,
red: radixColors.red,
redDark: radixColors.redDark,
},
}),
],
};
const radixColors = require("@radix-ui/colors");

module.exports = {
plugins: [
require("windy-radix-palette")({
colors: {
mauveA: radixColors.mauveA,
mauveDarkA: radixColors.mauveDarkA,
red: radixColors.red,
redDark: radixColors.redDark,
},
}),
],
};
29 replies
TTCTheo's Typesafe Cult
Created by p6l.richard on 11/12/2022 in #questions
[Tailwind&Prisma] How can you tie a tailwind color configuration to a prisma enumâť“
But what if I don't want to define the primary, secondary etc. myself but use something predefined, like radix-colors instead? https://github.com/brattonross/windy-radix-palette
29 replies
TTCTheo's Typesafe Cult
Created by p6l.richard on 10/2/2022 in #questions
Is there a way to add only a specific addon to an already existing ct3a app?
Yep, I just ended up adding it manually. Thanks. 🙂
6 replies