Commit graph

7 commits

Author SHA1 Message Date
Jorik Schellekens
6cf9166c4a Use variables for the rem values.
It's become obvious that these random floating points everywhere
are unwieldy. Now they're all in one place with some fairly logical
variable names which will help out in design->implementation phase.
2020-03-31 15:26:23 +01:00
Jorik Schellekens
da34e6241d Make all 'font-size's and 'line-height's rem
Font size of the whole app would ideally be controlled by a single
value. This value is currently hard coded using the :root CSS selector.
It is the intention to make this value configurable within riot. In the
interim all font-sizes have been converted to rem by the simple process
of regex. Replacing px values with their equivalent rem values assuming
a font size of 15px and then rounded to three decimal places, which was
the base at the time of this transformation.

I'm expecting another commit cleaning up rem values but I thought it
best to leave that to review.

This commit doesn't address any scaling issues. I thought it better to
land this unwieldy, mechanical, invisible change before the others
otherwise the pr would be impossible to review thoroughly.
2020-03-30 18:23:46 +01:00
J. Ryan Stinnett
dd94bf799d Improve interactive tooltip hover behaviour
This gives the interactive tooltip a more natural hover behaviour by removing
the full screen div behind it. This allows the target button to keep its hover
state, for example.

This also removes the click to close behaviour, which was too easy to trigger
accidentally.

Fixes https://github.com/vector-im/riot-web/issues/10179
Fixes https://github.com/vector-im/riot-web/issues/10222
Fixes https://github.com/vector-im/riot-web/issues/10225
2019-07-01 18:00:59 +01:00
J. Ryan Stinnett
80d73d8430 Add optional rounded chevron for tooltip
We'd like to have a rounded point on the chevron for an extra level of polish.
This implements that look for browsers that support `clip-path`.

Part of https://github.com/vector-im/riot-web/issues/9716
2019-06-21 15:10:17 +01:00
J. Ryan Stinnett
3bd247ebaa Tweak interactive tooltip to match design
This tweaks the tooltip to match the color, spacing, etc. seen in the designs.

Part of https://github.com/vector-im/riot-web/issues/9753
Part of https://github.com/vector-im/riot-web/issues/9716
2019-06-21 15:10:08 +01:00
J. Ryan Stinnett
32bf4588dd Center tooltip along top or bottom of target
This adjusts the positioning to work more the way we want:

* Tooltip is position on the top or bottom edge of the target depending on where
  space is available
* Tooltip and chevron are centered

In addition, more bits borrowed from `ContextualMenu` are not needed, so they
have been removed for simplicity.

Part of https://github.com/vector-im/riot-web/issues/9753
Part of https://github.com/vector-im/riot-web/issues/9716
2019-06-21 15:04:19 +01:00
J. Ryan Stinnett
6dcdad028e Clone ContextualMenu to InteractiveTooltip
As part of reactions and editing work, we're adding a new style of tooltip that
allows interacting with the content of the tooltip.  `ContextualMenu` is closest
out of the things we have today, but it doesn't position in quite the way we
want and it's already quite complex.

To get started, let's first clone that to a new `InteractiveTooltip`.

Part of https://github.com/vector-im/riot-web/issues/9753
Part of https://github.com/vector-im/riot-web/issues/9716
2019-06-21 15:04:19 +01:00