~sircmpwn/sr.ht-discuss

9 3

Dark theme for sr.ht

Marius Orcsik
Details
Message ID
<20190208130523.tb5gtfp2j2p75wh2@gabriel>
Sender timestamp
1549631123
DKIM signature
pass
Download raw message
Hi everyone,

In the FOSDEM discussion there was a mention of a dark theme.

I already have something that could work for sr.ht in this regard and I
am curious if the approach I'm using is OK with Drew and everyone else.

There is a small javascript snippet that checks if a cookie is set and
applies a class on the :root node.

Based on said class the background, text and link colours changes.

Currently all these steps are being done in javascript, but because I
know of Drew's dislike of it, the cookie read/set/unset can be moved to
a python element, but it would lose the instant, "no reload needed" feel.

Let me know which should be the way I continue with.

A demo can be viewed here[1] and it contains all the relevant
elements.

[1] https://littr.me/example

PS. Please keep me in CC as I'm not subscribed to this mailing list.

--
/Marius Orcsik
Details
Message ID
<MDyUcPUbVXAYpTC0XSkSuCoOP8TD5Y-bBgv6u7FTCZyOvE1wUKHoQcnMfBTRNyWBN7NZfJjtK5Ia8AhkJsernk--r_ueE7UHpx033wF-AwI=@emersion.fr>
In-Reply-To
<20190208130523.tb5gtfp2j2p75wh2@gabriel> (view parent)
Sender timestamp
1549631518
DKIM signature
pass
Download raw message
Maybe this could be submitted as a style on userstyles.org?
Details
Message ID
<20190208131443.GA3151@homura.localdomain>
In-Reply-To
<20190208130523.tb5gtfp2j2p75wh2@gabriel> (view parent)
Sender timestamp
1549631683
DKIM signature
pass
Download raw message
What was discussed at FOSDEM was upstreaming a dark theme if browsers
added a feature for users to express their preference with (I think some
kind of @media query was mentioned). Until that's implemented and well
supported, I agree with Simon - the best approach is a user style.
Details
Message ID
<eXvG7-ew41gqggmw5J-0FKfRCEE7qaT8LYd4UcjHAGxcQ68fARqYL2J1akp2iwXq63Y0i8q5BmdkZony0XmnZdE86IpTo_Z5HyiA_yXP68A=@emersion.fr>
In-Reply-To
<20190208131443.GA3151@homura.localdomain> (view parent)
Sender timestamp
1549631983
DKIM signature
pass
Download raw message
On Friday, February 8, 2019 2:14 PM, Drew DeVault <sir@cmpwn.com> wrote:
> I think some kind of @media query was mentioned

This has not yet been standardized, and is only implemented in Safari
Technical Preview.

For reference:

https://caniuse.com/#search=prefers-color-scheme
https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme
Details
Message ID
<56a0d9b4-7cc6-b052-1112-e77ac1c998ed@interia.pl>
In-Reply-To
<20190208131443.GA3151@homura.localdomain> (view parent)
Sender timestamp
1549632480
DKIM signature
pass
Download raw message
W dniu 08.02.2019 o 14:14, Drew DeVault pisze:
> What was discussed at FOSDEM was upstreaming a dark theme if browsers
> added a feature for users to express their preference with (I think some
> kind of @media query was mentioned). Until that's implemented and well
> supported, I agree with Simon - the best approach is a user style.

Wouldn't alternative stylesheets[1] be a good intermediate solution?

[1]: https://www.w3.org/Style/Examples/007/alternatives.en.html
Details
Message ID
<20190208133441.GC3151@homura.localdomain>
In-Reply-To
<56a0d9b4-7cc6-b052-1112-e77ac1c998ed@interia.pl> (view parent)
Sender timestamp
1549632882
DKIM signature
pass
Download raw message
On 2019-02-08  2:28 PM, Wolf480pl wrote:
> Wouldn't alternative stylesheets[1] be a good intermediate solution?
> 
> [1]: https://www.w3.org/Style/Examples/007/alternatives.en.html

Okay, I'll spill the beans. Lack of browser support is a convenient
excuse for something I don't want to maintain upstream right now. I want
to incubate a dark theme as a third-party userstyle for a while so I can
keep my eye on it and feel out how much work it seems to be to maintain
it before I bring it upstream.
Details
Message ID
<20190208152611.GA16679@conduit.artd.pw>
In-Reply-To
<MDyUcPUbVXAYpTC0XSkSuCoOP8TD5Y-bBgv6u7FTCZyOvE1wUKHoQcnMfBTRNyWBN7NZfJjtK5Ia8AhkJsernk--r_ueE7UHpx033wF-AwI=@emersion.fr> (view parent)
Sender timestamp
1549639572
DKIM signature
pass
Download raw message
On Fri, Feb 08, 2019 at 01:11:58PM +0000, Simon Ser wrote:
> Maybe this could be submitted as a style on userstyles.org?

I haven't submitted it on userstyles (given Stylish's track record, I
don't plan to, though someone else can if they want), but I've drafted
up a dark mode UserCSS file: https://hg.sr.ht/~pmc/srht-dark

--
pmc
Details
Message ID
<aPD-1DKiXLzr1GCv4vcB7iaMTDg5QDtuaOEwrK9YK14T_rwHkBSX8YaaiMWsqHFzOPVTRuDmM382uO19GokabsLzpxdPWpuHE2IVgWfo9Mg=@emersion.fr>
In-Reply-To
<20190208152611.GA16679@conduit.artd.pw> (view parent)
Sender timestamp
1549639784
DKIM signature
pass
Download raw message
On Friday, February 8, 2019 4:26 PM, Zebulon McCorkle <piperswe@gmail.com> wrote:
> I haven't submitted it on userstyles (given Stylish's track record, I
> don't plan to, though someone else can if they want), but I've drafted
> up a dark mode UserCSS file: https://hg.sr.ht/~pmc/srht-dark

userstyles.org can be used with better extensions, like Stylus. But
yeah, a Git repo works great too.
dev
Details
Message ID
<f7d6e910-c446-9fe4-2690-d82879eb1f5b@pixelpioneers.org>
In-Reply-To
<20190208131443.GA3151@homura.localdomain> (view parent)
Sender timestamp
1549810842
DKIM signature
missing
Download raw message
When/if you guys implement this, I would love it if you live streamed 
it. I'm interested in how something like that is done! So, just let me 
know if you happen to! Also, is there a discord/irc for sourcehut?
Details
Message ID
<20190210153839.GA10536@groucho.local>
In-Reply-To
<f7d6e910-c446-9fe4-2690-d82879eb1f5b@pixelpioneers.org> (view parent)
Sender timestamp
1549813119
DKIM signature
pass
Download raw message
On Sun, Feb 10, 2019 at 03:00:42PM +0000, dev wrote:
> Also, is there a discord/irc for sourcehut?

Yes, there's an IRC channel #sr.ht on freenode.

-- 
Ivan