I’m trying to manage dark/light mode via 2 local libraries “lib-portfolio-dark“ and “lib-portfolio-light“. Had to do it locally as they will NOT update to the latest changes when using the remote workspace. I’ve built a layout of an app i’m happy with for now in dark mode and I want to view it in light. My dark library has ~30 color variables and nothing else in it, my light has nothing
Tried using the plugin “colors manager“ to export/import the colors from dark lib to light, but that plugin seems to be broken now and the import doesn’t work (export does)
So I deleted the near empty light lib, made a copy of the dark, renamed it light, and tweaked a few colors. Now everything is broken. Despite having everything enabled in sketch settings, it won’t let me pick the light library when replacing
If I open the replace menu, by default the destination library shows all of my libs. If I open the target library, it shows dark as available and light as unavailable (it is enabled in settings). If I select dark as target, all my libs disappear from the destination
I’ve killed, reopened, disabled/enabled libraries, deleted “light“, recreated, etc. I can’t find a way to get this menu to sync back up and let me replace them
Any way to flush the memory of this? or any ideas what I can do
I’ve read your description carefully, and there’s something I’d like to know. You said:
Did you use the File > Duplicate option to make that copy? If you didn’t, that could explain the issue. That option will grant the new Library a different internal ID. Therefore, it should detect it as a different document and allow the Replace tool to flag it as available.
Could you try this way and let me know if that works? If it doesn’t, I would like to test this myself if you don’t mind. It’s not the same case as this recent one, but the same response applies, since I will need:
A copy of the old Library (dark).
A copy of the new Library (light).
A copy of the document where you want to replace the Library.
I didn’t know this option existed under “File“. I had tried to duplicate it by right clicking on it inside sketch which gives no such option. I really think this should be added there, as you can duplicate a page by right clicking and selecting duplicate
Also while the functionality is now fixed, it still says “lib-portfolio-light“ is unavailable inside the replace library menu. But it does work, I just tested switching back and forth and it allowed me to select the “unavailable“ library and it worked to revert it. I’ve tried restarting sketch to see if something in RAM would clear but it didn’t help
Apologies its not the “unavailable“ one that works, when I switch to light, the first drop down gives me 2 options of the same name. One available and one unavailable
So its just that the unavailable one is stuck and I can’t delete it
After some tests, I think this light library appears as Unavailable because some components still point to the Libraries you created in previous attempts. If you keep running the replacement tool repeatedly and always select that Library, it should eventually disappear once the components are fully replaced.
This is probably related to all the copies you created that share the same internal document ID, and how the replacement tool expects to find only one.
I had tried doing that already and it didn’t work. I just tried it another 10 times, opening every page and doing it incase its on an old piece of something. Also tried switching to the functional light and then back to the broken one then back to dark etc. Nope doesn’t work, the unavailable one is still there
@Simon shared his documents with us and we were able to find the root cause of the issue: a Color Variable referencing another Library (with the same name, but different ID). We were able to fix the issue and have now shared the documents back with him.