mirror of
https://github.com/RGBCube/serenity
synced 2025-07-03 05:42:06 +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:
parent
7557251fac
commit
0f42908073
5 changed files with 14 additions and 10 deletions
|
@ -46,7 +46,7 @@ void LayoutText::render_fragment(RenderingContext& context, const LineBoxFragmen
|
|||
if (background_color.has_value() && background_color.value()->is_color())
|
||||
painter.fill_rect(enclosing_int_rect(fragment.rect()), background_color.value()->to_color(document()));
|
||||
|
||||
auto color = style().color_or_fallback(CSS::PropertyID::Color, document(), Color::Black);
|
||||
auto color = style().color_or_fallback(CSS::PropertyID::Color, document(), context.palette().base_text());
|
||||
auto text_decoration = style().string_or_fallback(CSS::PropertyID::TextDecoration, "none");
|
||||
|
||||
if (document().inspected_node() == &node())
|
||||
|
@ -146,7 +146,7 @@ void LayoutText::split_into_lines(LayoutBlock& container)
|
|||
if (style().string_or_fallback(CSS::PropertyID::WhiteSpace, "normal") == "pre") {
|
||||
split_preformatted_into_lines(container);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Collapse whitespace into single spaces
|
||||
auto utf8_view = Utf8View(node().data());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue