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

Shadow option is broken #46

Open
davidjb99 opened this issue Apr 1, 2021 · 3 comments
Open

Shadow option is broken #46

davidjb99 opened this issue Apr 1, 2021 · 3 comments
Assignees
Labels
bug Something isn't working Canvas Issues related to the funk Canvas good first issue Good for newcomers

Comments

@davidjb99
Copy link
Contributor

@andressotomayorb commented on Wed Mar 10 2021

As a user when I try to add shadow to an element it is not reflected on the editor, but if I go to the preview, there it is visible.

Screen.Recording.2021-03-10.at.20.08.44.mov
@davidjb99 davidjb99 added bug Something isn't working Canvas Issues related to the funk Canvas labels Apr 1, 2021
@janwirth janwirth added the good first issue Good for newcomers label Apr 6, 2021
@janwirth
Copy link
Contributor

janwirth commented Apr 6, 2021

Problem Overview
The problem here is that funk uses shadows to draw outlines around elements (the HUD). The user-defined shadows are incorrectly overridden by the funk HUD-shadows.

Solution
When adding a custom shadow, the HUD shadows should disappear.

  1. Replace shadow rendering with function that outputs a Maybe String
  2. override the HUD shadows if we have Just shadowString.

Development Handoff
Relevant code sections

Acceptance criteria

  • write e2e test that validates the behavior (shadow being rendered in calculatedStyles)
  • fix the behavior

Archive: Discussion & Proposed solutions

  • @davidjb99 Should the HUD shadows disappear or stay when the user added a custom shadow? I suggest the outline disappears once the user adds a custom shadow because: 1. the element should then still be distinguishable from the background 2. the HUD introduces noise when trying to design shadows.

  • A: replace shadow rendering with renderer that outputs a Maybe String, then override the HUD shadows if we have Just shadowString

  • B: Change shadows field type to Element.Attribute msg. Problem: this will not allow stacking multiple shadows and limit design options down the line

@janwirth
Copy link
Contributor

janwirth commented Apr 6, 2021

Blocked by #50

@davidjb99
Copy link
Contributor Author

I think hiding the shadow in the HUD as you suggest is fine when a user adds a shadow to an element.

stacking shadows would be good to have at some point so I would go with option A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Canvas Issues related to the funk Canvas good first issue Good for newcomers
Development

No branches or pull requests

2 participants