I want to use styles from within the xml and outside css file. But it does not seem to work
application.xml has got this tag <assets path="assets/styles" rename="styles" />
So Toolkit.styleSheet.parse takes actual css, ie, the contents of your css file, its mainly used to insert “bits of css” in code. What i think you want is to setup a module.xml and use styles there, you can read more about them here: https://github.com/haxeui/haxeui-guides/blob/master/001-Guides/000-Modules.md#themes - let me know if something isnt clear.
That all said, i wonder if a Toolkit.styleSheet.parseFromResource(...) might be a nice addition.
Ok. Thanks for the guide. The styles seem to work now.
I am trying to create a responsive layout. It works using html. But how to make it work using HaxeUI? In this case, how can I make the blocks one above another when screen size is small in width?
So, first thing i want to mention is that haxeui css != w3c css… haxeui is quite specialized for haxeui, and therefore loads (and loads) of things are missing (and haxeui css has quite a few things that arent in “normal” css). One example of such a thing is flexbox. That doesnt exist in haxeui css (at all).
Thanks.
The code you shared works fine on the Haxeui builder link.
But when I test on my localserver it just shows a single yellow block with red border.
Even when I made width=10% , it only shows a single yellow block.
In the above code using the layout attribute along with media-query did work on the browser test, ie simply by changing the browser window width by dragging.
But it seems to fail on the mobile device. There is a way out with css that heavily relies on css’ flex.
Since haxeui does not use flex, is their any solution for this?
How to force blocks to stack when the width is narrow?