

Alternate solution: This one doesn’t need the replacing of the [
variable blocks in the chat options, and you won’t need to change the CSS styles for both the light and dark mode configurations. All you need is to create a list which consists of color palettes for both light and dark mode for your generator: ]
colorVars
light
bgColor = #f9f9f9
messageBgColor = #f8f8f8
textColor = #191713
borderColor = #c1bcb9
inputColor = #efefef
dark
bgColor = #1e1f20
messageBgColor = #070707
textColor = #e6e8ec
borderColor = #313638
inputColor = #101010ad
And then we need an additional function since we’re going to spam a lot of adapting-with-the-mode checks inside the variable blocks:
adaptWithMode(v) =>
return colorVars[isDarkMode ? "dark" : "light"][v];
And then in your style configs, still in list code, modify it so that the background
, border
and color
properties reference those list variables with that function, pretty much like this:
DefautlmessageBubbleStyle = font-family: "Work Sans"; font-size: 13.5px; background: [adaptWithMode("bgColor")]; color: [adaptWithMode("textColor")]; border-radius: 10px; padding: 10px; margin: 10px; margin-block: 25px; border: 1px solid [adaptWithMode("borderColor")]; margin: 0;
DefautmessageFeedStyle = background-color: [adaptWithMode("messageBgColor")]; background-size: contain, cover; background-repeat: no-repeat; background-position: center, center; overflow-x: auto; display: flex; flex-direction: column; gap: 10px; padding: 10px;
DefautinputAreaStyle = font-family: "Work Sans"; background: [adaptWithMode("inputColor")]; color: [adaptWithMode("textColor")]; padding: 10px; resize: none; border: 0;
DefautsubmitButtonStyle = font-family: "Work Sans"; font-size: 13.5px; background: [adaptWithMode("inputColor")]; color: [adaptWithMode("textColor")]; height: 50px; border: none; user-select: none; flex-grow: 1;
DefaultcontainerStyle = width: 100%; height: 100%;
DefautfullscreenButtonStyle = "Work Sans"; font-size: 13.5px; border: none; background: [adaptWithMode("inputColor")]; color: [adaptWithMode("textColor")]; cursor: pointer; user-select: none;
DefautsettingsButtonStyle = "Work Sans"; font-size: 13.5px; border: none; background: [adaptWithMode("inputColor")]; color: [adaptWithMode("textColor")]; cursor: pointer; user-select: none;
The last thing to do is to add the isDarkMode
, reloadChatFrames()
function and then assign the dark mode button as I’ve said before and you’re done!
This will forever be recorded as one of the most exciting events to participate in for my whole life. I’ve never been this happy and excited before. It is fun and intriguing just to be able to explore and draw a bunch of pixels into a public canvas just like grabbing squares (pixels) and putting it into a giant block of land (the canvas) to draw art with.
Great job! 😃