Convert "background" to a drawable, not a style #496
Labels
enhancement
New feature or request
good first issue
Good for newcomers
KWoC-2023
IIT Kharagpur Winter of Code 2023 - good for new contributors
This would be a pretty big first issue -- but also a fun and useful one. There are a lot of steps here, but they're not hard steps. Feel free to ask for help if you take this on!
In Shoes3, "background" isn't a style on Stack or Flow. It's an object of its own. If you add it after text, it will cover it:
So when converted to HTML, the background is just a colored div. Note that it's possible to have a gradient as the background. From example examples/legacy/simple/simple-calc:
For this bug, we will need a "background" Drawable, both in lacci/lib/shoes/drawables and in lib/scarpe/wv. We should get rid of the "background" style on slot objects (like stacks and flows). You can find code for rendering a gradient to HTML in method background_style in scarpe-components/lib/scarpe/components/calzini/slots.rb -- Calzini is also where code to render the Background drawable to HTML should live. The rendering code should go away in calzini/slots.rb and instead be in whichever Calzini file you add background_element to.
The background should mostly be a div which defaults to height: 100% and width: 100%, though you can also explicitly set height and width on a background.
Right now it looks like image backgrounds aren't working properly. You don't need to fix them for this -- just keep the existing functionality, and move it into a drawable.
The text was updated successfully, but these errors were encountered: