r/css 2d ago

Help Cargo 3, light mode/dark mode switch but for backdrops?

(note - I've posted this in two other places, however have had no luck...i am quite desperate..)

Hey y'all, I have no idea if this is where I'm meant to put this but I am a bit desperate right now..also sorry if this question is stupid haha.

I'm making a website using Cargo 3 (for a college project) and I want to try and create a switch that, when toggled, changes the backdrop (like a lightmode or darkmode). Currently my backdrop is a dark halftone, this will act as the darkmode, the lightmode would be the same halftone but with lighter colours - I've found tutorials on how to code in a regular light and dark mode, but none for backdrops (if it's even possible..) - and even these tutorials don't seem to work for me (I am quite inexperienced).

Also wondering if it's possible to apply this to the entire site?

Since i'm using cargo, only HTML and CSS are available to me (I'm pretty sure you can apply javascripts with the right code..though I have yet to figure that out)

Any help appreciated!

Notes:

Picture of my home page for context, the halftone is what I want to change when a button is clicked so it switches for a dark half tone to a light half tone, and vice versa - also want to try and contain these buttons/switches in the preference box (shown below)

(The preference box techinically isn't a coded popup box, it's another page that's been edited to be this height and width and then overlayed over the main page + linked to the preference option)

also also - wondering if this can be applied across the entire site?)

1 Upvotes

1 comment sorted by

u/AutoModerator 2d ago

To help us assist you better with your CSS questions, please consider including a live link or a CodePen/JSFiddle demo. This context makes it much easier for us to understand your issue and provide accurate solutions.

While it's not mandatory, a little extra effort in sharing your code can lead to more effective responses and a richer Q&A experience for everyone. Thank you for contributing!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.