1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:27:44 +00:00

LibHTML: Respect the system theme

LibHTML will now use the palette colors for the default document background and
the text. As always, a page can override this default styling with CSS if it
really wants a specific color or style.

Fixes https://github.com/SerenityOS/serenity/issues/963
This commit is contained in:
Sergey Bugaev 2020-01-05 00:09:35 +03:00 committed by Andreas Kling
parent 7557251fac
commit 0f42908073
5 changed files with 14 additions and 10 deletions

View file

@ -15,5 +15,6 @@ void LayoutListItemMarker::render(RenderingContext& context)
Rect bullet_rect { 0, 0, 4, 4 };
bullet_rect.center_within(enclosing_int_rect(rect()));
// FIXME: It would be nicer to not have to go via the parent here to get our inherited style.
context.painter().fill_rect(bullet_rect, parent()->style().color_or_fallback(CSS::PropertyID::Color, document(), Color::Black));
auto color = parent()->style().color_or_fallback(CSS::PropertyID::Color, document(), context.palette().base_text());
context.painter().fill_rect(bullet_rect, color);
}