GtkSharp
GtkSharp copied to clipboard
Why can't I use Percentage values for my CSS Properties
``I am currently making a Programming Language in C# using ANTLr and am now building a UI Framework for it.
Problem
I wanna allow my users to have nearly 100% coverage of CSS in my language, and responsive UI Design is very heavily based on using responsive values. Currently, though, neither Percentage-based values nor VW/VH values work. is there a fix for this? The error message suggests that percentage values were implemented at some point but are now deprecated:
Gtk-WARNING **: 15:42:35.020: Theme parsing error: <data>:4:14: Not using units is deprecated. Assuming 'px'.
Question
Is there a solution and/or hack to use those responsive values?
Code
This is how I implemented CSS loading (using an XML Parser):
var provider = new CssProvider();
var data = File.ReadAllText((node.Attributes is { } a && a["src"] is { } src && File.Exists(src.InnerText)) ? src.InnerText : throw new Exception());
provider.LoadFromData(data);
window.Add(app);
StyleContext.AddProviderForScreen(Gdk.Screen.Default, provider, 800);