Hi, today I was looking in the forum to this topic
https://forum.lazarus.freepascal.org/index.php/topic,45503.msg322025.html#msg322025And I liked the idea of CSS and custom controls, so decided to play a bit with BGRABitmap and JSON, to make styling from text files easy to read and use.
Instead of CSS, I choose JSON, because FPC already has an easy to use JSON unit.
This is the project home:
https://github.com/bgrabitmap/BGRAJSONStylesAnd attached how it looks like.
Here a sample file:
{
"width": "100%",
"height": "100%",
"border-width": "10",
"background-color": "rgba(128, 64, 72, 0.1)",
"border-color": "rgba(0,0,0,0.7)",
"border-x-radius": "20px",
"border-y-radius": "20px",
"border-top-left-style": "rounded",
"border-top-right-style": "rounded",
"border-bottom-left-style": "bevel",
"border-bottom-right-style": "square"
}
Is just another BGRABitmap test, because I can't say if I will continue it or not, but to say that BGRA has something special, that is the bevel style, in CSS I looked that is harder to do and needs some tricks. Here with a simple setting works out of the box.