From c02c23cb7fe84ed76b008f7bdca8b6bea0634b87 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Wed, 20 Apr 2022 01:02:35 +0200 Subject: [PATCH] Use root properties instead of the * selector This works around https://github.com/vizia/vizia/issues/131, which was the reason why the vizia update was reverted. --- nih_plug_vizia/assets/theme.css | 6 ------ nih_plug_vizia/src/lib.rs | 3 +++ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/nih_plug_vizia/assets/theme.css b/nih_plug_vizia/assets/theme.css index 7c1b01dd..5464f257 100644 --- a/nih_plug_vizia/assets/theme.css +++ b/nih_plug_vizia/assets/theme.css @@ -1,11 +1,5 @@ /* Overrides for default VIZIA widgets */ -* { - color: #0a0a0a; - /* VIZIA uses points instead of pixels, this is 20px */ - font-size: 15; -} - scrollview > vstack { /* Normally the scroll bar overlaps with the content, so we'll add a little offset to prevent that */ child-right: 15px; diff --git a/nih_plug_vizia/src/lib.rs b/nih_plug_vizia/src/lib.rs index feaf0cc4..397ebf84 100644 --- a/nih_plug_vizia/src/lib.rs +++ b/nih_plug_vizia/src/lib.rs @@ -167,6 +167,9 @@ impl Editor for ViziaEditor { // TOOD: `:root { background-color: #fafafa; }` in a stylesheet doesn't work Entity::root().set_background_color(cx, Color::rgb(250, 250, 250)); + Entity::root().set_color(cx, Color::rgb(10, 10, 10)); + // VIZIA uses points instead of pixels, this is 20px + Entity::root().set_font_size(cx, 15.0); cx.add_theme(include_str!("../assets/theme.css")); // There doesn't seem to be any way to bundle styles with a widget, so we'll always