unisonweb / codebase-ui

Unison Codebase UI
https://share.unison-lang.org
MIT License
46 stars 7 forks source link

Support all tooltip positions #250

Closed hagl closed 3 years ago

hagl commented 3 years ago

Overview

For issue #200 I'd need tooltips with Position.RightOf, but so far only Position.Below was properly supported in the tooltip.css. This PR adds support for Above, RightOf, LeftOf and Arrow.Start and Arrow.End

image

Interesting/controversial decisions

I used a slightly tooltip-arrow-edge-offset for LeftOf and RightOf position than for Above and Below for the common usecase that a tooltip is attached to a span or link.

Loose ends

Arrow.Middle is still not supported

hagl commented 3 years ago

Btw, have you considered using some tool like https://package.elm-lang.org/packages/kalutheo/elm-ui-explorer/latest/ to work on and test UI components?

hojberg commented 3 years ago

@hagl I didn't know of that tool, looks very cool and useful! I've used storybook in the past with great success and it seems like a good idea to do something similar in the future with elm-ui-explorer.

hagl commented 3 years ago

Thanks! I also haven't used elm-ui-explorer myself, but used Storybook at work in a React/Typescript project and found it quite helpful. I can give it a try to set it up when I've finished #200