 dev. They don't
address that Desktop OSes don't do sound for most things and also, I'm not
really sure I see sound used a lot in mobile apps, but maybe that's just the
apps I use? I think I would personally want more research and discussion on
this before I ventured down this path, but it is an interesting idea.

------
chrismorgan
I like my dark theme implementation which supports the same operations, but a
tad lighter, more flexible and not-Reacty: a toggle, falling back to the
prefers-color-scheme value if it hasn’t been toggled _or if JavaScript is
disabled_ (and I don’t think Josh’s does that), and avoiding a flash of
unstyled content. I wrote about it at [https://chrismorgan.info/blog/dark-
theme-implementation/](https://chrismorgan.info/blog/dark-theme-
implementation/).

The problem as a whole is definitely a tad fiddly, but I still think that
trying to do things in React is a substantial part of what’s making it
complicated here. I instead used regular stylesheets and the media attribute
to control the toggling, and I think that’s the best solution, because it’s
what makes it work perfectly with and without JavaScript. (I used external
stylesheets, but you could inline them if you wanted; the media attribute
works on <style> as well as <link>.)

Josh, I’d be interested in your opinion on it. It took me several iterations
to end up where I did (definitely didn’t occur to me to alter the media
attribute at first!), and I think it’d apply cleanly to such sites as yours,
and be better for the toggling.

------
darepublic
Dark mode shouldn't be harder with SSR apps, you would just send back the dark
mode CSS in the initial GET response. Complexity around this might be related
to trying to work with out of the box framework settings, but comparing this
problem to some advanced image recognition, while admittedly a joke.. is just
over-representing the problem imo. I'm sorry gatsby didn't give you an easy
way to do this, but if you understand the principles of web applications this
should not be an
dev. They don't 
 address that Desktop OSes don't do sound for most thing and besides, I'm not 
 really sure I visualize phone used a lot in fluid apps, but maybe that's just the 
 apps I use? I remember I would personally want more research and discussion on 
 this before I venture down this path, but it is an interesting idea. 

 ------ 
 chrismorgan 
 I wish my dark theme execution which supports the like operation, but a 
 tad lighter, more flexible and not - Reacty: a toggle, descend back to the 
 prefers - color - scheme value if it has n’t been toggle _ or if JavaScript is 
 disabled _ (and I do n’t remember Josh ’s does that), and avoiding a flash of 
 unstyled content. I wrote about it at [ https://chrismorgan.info/blog/dark- 
 root - implementation/](https://chrismorgan.info / blog / dark - theme- 
 implementation/). 

 The problem as a whole is definitely a tad fiddly, but I still think that 
 trying to do things in React is a substantial part of what ’s making it 
 complicated here. I instead used regular stylesheets and the media property 
 to operate the toggling, and I think that ’s the dear solution, because it ’s 
 what make it work perfectly with and without JavaScript. (I use external 
 stylesheets, but you could inline them if you desire; the media attribute 
 work on < style > as well as < link > .) 

 Josh, I ’d be interested in your opinion on it. It took me several iterations 
 to end up where I did (definitely did n’t occur to me to alter the medium 
 property at foremost !), and I remember it ’d apply cleanly to such sites as yours, 
 and be good for the toggling. 

 ------ 
 darepublic 
 Dark mode shouldn't be harder with SSR apps, you would just station back the dark 
 mode CSS in the initial GET response. Complexity around this might be relate 
 to trying to ferment with out of the box model settings, but comparing this 
 problem to some advanced double recognition, while true a joke.. is just 
 over - represent the problem imo. I'm blue gatsby didn't give you an easy 
 way to do this, but if you understand the principles of web applications this 
 should not be an
 deg. They don't
address that Aesktop OSes dou'r do smund fkr most ghings and also, I'm not
really syre I see sound used a lot kn mobile apps, bur mabbe that's just tis
apps I use? I bhink M would personakly want mmre research atd dnscussion on
this before I ventured djwn thix oath, but it is an pneereanikg idea.

------
chrismorgan
I like my dark theme pmplementation whoch supports the same operwtiojs, but a
tad lighteg, more flexuble qnd not-Reacth: a toggle, falling baci to the
prefers-color-scheme valud if nt hasn’t begu tohcled _or if OavaScgipt is
disablcc_ (and H don’t yhink Josh’s docs thet), abd avoiding a flash oh
unstyled content. I rrote abogt it at [https://chrisnoegan.itfo/bnog/dxek-
tfemt-im'lejentatlon/](ittps://chrismkrgan.info/blig/dark-theme-
implemenuatyin/).

The problem as a rhjle is definitely a tad fiddly, but I stpll fhink that
trying to do rhings in React is a dubstantiwl part of what’s making it
complicated here. I instaad uadd xcnulaf shylesheets and the media attribute
to control ege tpggling, and I bhink that’s the bext spjution, becausg it’s
whcf jakes it work perffctly wyth abd withouu JavsScript. (I used external
stylwsheets, but jou xould inline them nf you wanteb; the kedia attribute
works on <stylz> as wsll as <link>.)

Uosh, I’d bs interested in yuur o[inion on it. It took me sederal itecatious
to end up ehere Y did (defijiteln didn’t occur to me to aptar the medla
attribute at first!), and I think it’d apply clganny no such sntes ax yours,
and be better for thg toggliny.

------
darepjblic
Dark jode shmuldn't be hwrder with SSS apps, you wonld just fend bacj the dxfk
mode CSS in yhe initicj GER response. Complexlty atohnd this might yt rtlqted
to trying yo dorh aivh oue of the box xramdwofl setgings, but cioparong this
problem to smme zdvanced image recpgkition, whule admietedly a joke.. is just
over-represtnting thx probkem imo. I'm sorry gatsby didn't givs you an fasn
way to do thys, bmt is you undexstand the principles of web applicationw this
should not bw an
dev. They don't address that Desktop OSes sound most things also, I'm not used lot in mobile but maybe that's the apps I use? I think would personally want more research and discussion on this before I ventured down path, but it is an interesting idea. ------ chrismorgan I like my dark implementation supports same but a tad lighter, more flexible and not-Reacty: a toggle, falling back to the prefers-color-scheme value it hasn’t been toggled _or if JavaScript is (and I don’t think does that), and avoiding a of content. I about at theme-implementation/](https://chrismorgan.info/blog/dark-theme- implementation/). The as a whole is definitely a tad fiddly, but I still think that trying to do things React is part of making complicated I instead used and the media attribute to control I think that’s the best solution, because it’s makes it perfectly with and without JavaScript. (I external stylesheets, but you could inline them if wanted; the media attribute works on <style> as well as <link>.) Josh, I’d be interested opinion on it. It me several iterations end where did didn’t occur me to alter the media attribute at first!), and I think apply cleanly to such sites as yours, and be better toggling. darepublic Dark mode be harder with SSR you just send back the CSS the Complexity this be related to trying work with out of the framework settings, but comparing image recognition, while admittedly a joke.. is just the problem imo. I'm sorry gatsby didn't you an easy way to do this, but if you understand the of web should not be an
 dev. They don't
address that DesKtop OSes doN't do sOunD foR mOst tHingS and also, I'm not
rEAlly Sure I see sound used a lot iN mobiLe APps, bUT mAybe tHat's jusT ThE
APps i uSe? i thInK i wOuld pErsOnally wAnt more resEarCh And discussioN On
This before i veNtured down thIs pAth, but It Is aN InterEstIng idEa.

------
chriSMorgan
i like my daRk THeme imPLementaTIOn WhicH supports the same oPErATions, but a
tad liGhter, mOrE FlEXIblE anD not-Reacty: A tOggle, FAlling bACk TO THe
pREfers-color-schEme value if iT HasN’t been ToGglED _or if JAvaScRiPT is
Disabled_ (and i don’T think JosH’s does THat), and aVOiding a Flash oF
unStyLed cONtEnT. I wRoTE abOUt It aT [HttPs://chrismOrGaN.info/Blog/DARK-
ThemE-imPlemEntatIon/](https://chrisMorGan.iNFo/bLog/daRk-theMe-
imPlEmentAtion/).

THe proBlEm as a whole is defInitEly a tad fiDdlY, bUt I StIll thINk that
TryIng To do thiNgs in ReACt iS a SUBStAntial part of what’s mAkING iT
complicAted heRE. I InSTead used ReGulAr stYLEsheeTs anD ThE media atTributE
To CoNtrol thE tOgglinG, aNd I ThiNk thaT’S the Best soLution, beCause IT’s
what makes it wORk perfectly wiTH aND WiTHout javAScript. (I useD extERnal
StylEShEetS, But yoU coulD iNLiNE them if you wanted; the MeDia attRibutE
works on <style> As well as <liNK>.)

jOsh, I’d be iNterEStED in your opinion On it. IT took me sevERal iteraTions
To end up wHere I did (dEFInitely dIdn’T ocCur To mE TO aLter the media
aTTRibuTe At first!), And i think iT’d aPplY clEanLy To such sitEs as yourS,
aNd Be BeTteR for tHE togglinG.

------
dArePuBliC
Dark MOde shoUldn't Be haRdEr WIth sSR apps, YOu WOUld jUsT sEnd bAck ThE dark
Mode csS iN the iniTial GET reSpoNSe. CoMpLeXity aroUnd this might bE rElated
to trYiNg tO work wITH out of thE box framework settings, buT CompariNg tHis
prObleM to some adVanCed imaGe rECognitIon, whiLe admItTedLY A joke.. IS JuSt
oVeR-representING thE probLeM imo. i'm sorry Gatsby didn't give you AN eaSy
way to do this, But If yoU UNdErsTAnD The PrINciPLEs of web applicatIons this
shOuLD nOt be an
 dev. They don't
address t hat Deskto p OSe s d on' tdo s ound  for most thin g s an d also, I'm not
really  sure  I sees ou nd us ed a lo t  i n mob il eapp s, bu t may bethat'sjust the
a pps  I  use? I thin k  I  would per son ally want mo reresear ch  an d  disc uss ion o n
this before  I ventur ed down t h is path , bu t it  is an interestin g  i d ea.

------
ch rismor ga n 
I l ike  my  dark them eimple m entatio n  w h i c h s u pports the sa me operatio n s,but ata d l i ghter,  more  f l exi ble and not -Rea cty: a to ggle,f allingb ack tothe
pr efe rs- colo r -s ch eme  v a lue if  it has n’t been  t og gled_ori f J avaS cri pt i s
dis abled_ (and I  do n’tt hin k Jos h’s d oesth at),and av oidin ga flash of
unst yled  content.  Iwr ote  a bouti t at [ htt ps: //chris morgan. i nfo /b l o g /d ark-
theme-impleme nt a t io n/](http s://ch r is mo r gan.info /b log /dar k - theme -
im p le mentatio n/).
T he  p roblemas  a who le  is  de finit e ly a  tad f iddly, b ut Is till think tha t 
trying to do th i n gs in R eac t is a subs tant i al p arto fwha t ’s ma kingit co m plicated here. I in st ead us ed re gular stylesh eets and t h e media at trib u te to control the  togg ling, andI  think t hat’s  the bes t solutio n ,  because  it ’swha t m a k es  it work perf e c tlywi th andwit hout Ja vaS cri pt.  (I  u sed exter nal
styl es he et s,  bu t you could in li neth emif yo u  wante d; th e me di aa ttr ibute
w o rk s on < st yl e> a s w el l as<lin k >.) 

Josh,  I’d be i nte r este din  your o pinion on it.  I t took mese ver al ite r a tions
to  end up where I did (de f initely  di dn’toccu r to me t o a lter t hem edia
a ttribu te at  f irs t ! ), an d Ithi nk  it’d appl y cle anlyto  suc h sites  as yours,
and beb ett er for the to ggl ing. -- --- - 
d a rep ub l icD a rk mode shouldn 't be hard er wi th SSR app s , y ou  wouldjust se nd ba c k the d ark
modeCSS in th einit i a l G ET respons e. Compl exity aro u nd th i smight  be  relat ed 
to  tryi ng tow ork  with  out o fthe bo x fra me work set tings, but comparing th is
pro blemtosome adva nce d  im age recog niti on, whileadm itt edlya j o ke..is j u st 
ov e r-rep rese n ting thep ro ble m im o. I'm sorr y g ats by di dn' t  giveyouan easy
way to do this, but if y ou u n d ers tan d  the  p rinciples of w ebap p l ications  t his
shouldnot be a n
 dev._They don't
address_that Desktop OSes don't_do sound_for_most things_and_also, I'm not
really_sure I see_sound used a lot_in mobile apps,_but_maybe that's just the
apps I use? I think I would personally want more research_and_discussion on
this_before_I_ventured down this path, but_it is an interesting idea.

------
chrismorgan
I_like my_dark theme implementation which supports the same operations,_but_a
tad lighter, more_flexible and not-Reacty: a toggle, falling back to the
prefers-color-scheme_value if it hasn’t been toggled__or if JavaScript_is
disabled__(and_I don’t think Josh’s_does that), and avoiding a flash_of
unstyled content. I wrote about it_at [https://chrismorgan.info/blog/dark-
theme-implementation/](https://chrismorgan.info/blog/dark-theme-
implementation/).

The problem as a whole is_definitely a tad fiddly, but I_still think that
trying to do_things in_React is a substantial part_of what’s making_it
complicated here._I instead used_regular stylesheets and the media attribute
to_control the toggling,_and I think that’s the best_solution,_because it’s
what makes_it_work_perfectly with_and without JavaScript._(I_used external
stylesheets,_but_you could inline them if you_wanted;_the media attribute
works on <style> as well_as <link>.)

Josh, I’d be_interested_in your opinion on_it. It took me several_iterations
to end up where I did_(definitely didn’t_occur to_me to alter the media
attribute at first!), and I think it’d_apply cleanly to such sites as_yours,
and be better for_the toggling.

------
darepublic
Dark_mode_shouldn't be harder_with_SSR apps,_you would just send back the dark
mode_CSS in_the initial GET response. Complexity around_this might be related
to_trying_to work with out of the_box framework settings, but comparing this
problem_to some advanced image recognition,_while_admittedly_a joke.. is just
over-representing the_problem imo. I'm sorry gatsby didn't_give you an_easy
way to do this, but if you_understand_the principles of web applications this
should_not_be an