Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert "background" to a drawable, not a style #496

Open
noahgibbs opened this issue Dec 12, 2023 · 0 comments
Open

Convert "background" to a drawable, not a style #496

noahgibbs opened this issue Dec 12, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers KWoC-2023 IIT Kharagpur Winter of Code 2023 - good for new contributors

Comments

@noahgibbs
Copy link
Collaborator

noahgibbs commented Dec 12, 2023

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:

Shoes.app(width: 600, height: 50) do
  para "This is hidden under the background"
  background yellow
  para "This shows through on top"
end
Screenshot 2023-12-12 at 13 16 18

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:

background "#EEC".."#996", :curve => 5, :margin => 2

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.

@noahgibbs noahgibbs added enhancement New feature or request good first issue Good for newcomers KWoC-2023 IIT Kharagpur Winter of Code 2023 - good for new contributors labels Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers KWoC-2023 IIT Kharagpur Winter of Code 2023 - good for new contributors
Projects
None yet
Development

No branches or pull requests

1 participant