Maybe a silly question, but how do I set the light mode instead of dark mode in the new Swift 5.8 documentation?
If you're talking about the HTML rendered pages, you need to scroll all the way to the bottom, and you should see a toggle that lets you select the mode. For example, I've got a work-in-progress GitHub hosted set of pages at Documentation, and if you scroll to the bottom there, you should see something akin to this:
If you're talking about documentation that's displayed within Xcode, that choice floats with the system settings from Appearance.
Does that answer what you're asking?
Thank you very much for your answer. My question concerns the new Swift online book, updated to version 5.8, e.g. the 'Language Guide'. I only see it in "dark mode" and at the bottom of the webpage I have no option to change to "light mode", as I can do on other swift.org pages and in the Apple documentation.
Ah, got it. I just looked on
https://docs.swift.org/swift-book/documentation/the-swift-programming-language/, which I'm assuming is the site you're talking about.
For me it's showing default as "light", but like you I don't see a toggle control. I'm not sure what's controlling the choice or if there's a manual control to toggle it. The site is using a custom header and footer though, which may be obscuring it. (ref: swift-book/footer.html at main · apple/swift-book · GitHub)
I've not been tracking the progress on publishing TSPL with DocC, so I'm not sure what might be effecting the choice of light-mode vs. dark-mode for TSPL. Anyone in the @swift-documentation-workgroup have more insight here?
Perhaps @Alex_Martini might have some insight here?
I think your system appearance settings (and
prefers-color-scheme as a result) determine whether you're seeing light or dark mode docs right now. Same as the 'auto' setting would give you on DocC builds without a custom footer.
We use (mostly) the same header and footer as the swift.org DocC docs, which have the same issue. It's probably worth filing a bug that customizing the footer means losing the appearance picker. Maybe start with a bug on DocC render and if it turns out that it's really the responsibility of people who add custom footers to implement the appearance picking behavior, we could follow that advice.
For TSPL at least, the custom footer is useful since it gives space for the CC-BY-4.0 license attribution and matches some other docs on the site.
I followed your instructions. Thank you very much. In the meantime, I downloaded all the chapters in pdf, so I can read them in "light mode" anyway
Hi @alebmp , Thank you for your post. Where may I download all the chapters in PDF so that I can read them in Light Mode, please? (I am a fan of Light Mode for the Language Guide because I was following the colors for the different code keyword categories, and now the colors are different in Dark Mode and throwing me off.) I hope they fix the bug and allow the Language Guide to be viewable in Light Mode as well as Dark Mode.
Hello, I simply printed out the various web pages, indicating in the output the PDF format. I found no other way to get Swift version 5.8 in light mode.
It works! Thank you very much.