New (page-per-artifact) standard library doc examples are now editable and runnable

Nick Sabalausky (Abscissa) via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Sat Feb 18 17:42:03 PST 2017


On 02/18/2017 11:48 AM, Seb wrote:
> On Friday, 17 February 2017 at 16:07:37 UTC, Nick Sabalausky (Abscissa)
> wrote:
>> 1. This is pretty awesome.
>
> Thanks a lot :)
>
>> 2. Looks like someone forgot to set a foreground text color for the
>> output even though the background is set to white. This makes the
>> output text invisible for those using eye-friendly light-on-dark systems.
>
> I am not sure I follow. Do you use a custom color scheme or plugin that
> sets the body background color to black?

Dark system color scheme, nothing mucking with website CSSes or 
anything. Somewhat bizarrely/irritatingly, there are certain cases 
(<input> and <textarea> to my knowledge, maybe others) where browsers 
inherit default color settings from the OS[1] instead of from a built-in 
browser-default CSS.

Since my OS is set up to default to (near-)white text on a (near-)black 
background, the browser decides "Oh, ok, I'll use white text on a black 
background for inputs and textareas." But then the site's CSS tells it 
to use a white background. And says nothing about text color. Browser 
says: "Ok! So, white text (system textbox default) on a white background 
(website CSS)!!"

[1] Browsers taking theme defaults from the OS was appropriate behavior 
back in HTML1 when the whole web was actually designed from the 
ground-up to automatically adapt to the machine being used. But not so 
much now that every site/page in the world uses its own theme and 
formatting system[2], and even the browser's own default css *mostly* 
(with, of course, these broken exceptions) separates itself from the OS, 
leaving occasionally broken readability.

[2] The site-chosen formatting system occasionally being one that 
attempts to partially adapt to the local machine, to varying degrees of 
success. Thanks, legacy of HTML2/4!

Did I mention I hate web browsers? ;)

> What exactly would be the best way for you to resolve your problem?
> Maybe you can even submit a PR yourself? - the CSS is here:
>
> https://github.com/dlang/dlang.org/blob/master/css/style.css#L1611

I'm working out building the site locally right now so I can test 
(building it seems to be taking awhile), but:

Looks like the site is mostly using #333 for text color. You could just 
toss in "color: #333;" right next to "background: white;" for the 
d_code_output sections (might not matter for the div version, but 
wouldn't hurt either.) That should work.

Or it might be better to just toss this in around the top of the CSS:

--------------------------
input, textarea {
     background-color: white;
     color: #333;
}
--------------------------



More information about the Digitalmars-d-announce mailing list