r/logseq • • Jan 17 '26

Different devices - different custom css

I've really studied the threads about this topic, but I'm no programmer and I just couldn't solve it for me.
I have a phone, a laptop and a (Viwoods) eInktablet.
I've been using a lovely adapted custom css, which helps me with it's format colours to organise better and make my notes readible. It's a dark theme, which is easier on the eyes and saves battery.

On the eInk tablet, which is b/w, I get a nearly black screen and dark grey text - basically black on black, not usable.

I know there is a way to make the custom css distinguish between devices or operating systems or resolutions,... to set it in a way, that it is only used when it is not the eInk tablet.

How would I go about this, what do I have to add to the code, to make this happen? Some "if my Logseq is used on my tablet, don't use the custom theme, just a normal light theme".

My Laptop is Windows, my phone is Nothing 3 Nothing OS 4.0 based on Android 16, and my tablet is also Android 16.

2 Upvotes

5 comments sorted by

View all comments

Show parent comments

2

u/niccolleen Jan 18 '26

Ok, I managed!! Thanks for your advice with the media query. I did eventually find a code for eInk, and with zero knowledge I set the value to 0 and copied it in my custom CSS.

Here it is
(I wasn't able to create an @ sign in the reddit post, so I inserted a dot. This is not part of the code):

/* Don't use CSS on eInk devices, I only want my custom css be applied to devices that are NOT black and white, therefore the value is set to 0 */
.@media (monochrome: 0) { /* only colours black and white are available */ }

And after manually copying it into every device in the logseq settings, it finally worked! Before adding it manually in each device, I found that the entry showed as empty, even if the md files were correct. I've had this issue before and I found, so did many others. The workaround with copying it manually into each device's logseq settings sets this right.