Commit Graph
5 Commits
Author SHA1 Message Date
Sigurd Schneider b15de2ee0a Fix height of icon component
The new icon component used a display: inline-block span in its
shadow DOM to display the icon as background of said span. The
problem is that inline elements have two heights: a line box
and a content box. The content box is correctly sized, but the
line height is dependent on other factors (some outside of the
actual component) such as font selection and line leight. This
resulted in the icon component getting a /different/ height that
what was specified. See the screenshots at here for an example:
https://imgur.com/a/reKweWU
This alignment problem was mitigated in the code-base by all kinds
of paddings and margin setting (some of which are undone in this CL).

This CL changes the span in the shadow DOM that has the actual
icon as background to a div by setting the display: block style.
This ensures that the height of the icon component is computed
as intended, and in turn, a bunch of "correction" values in a
bunch of places can be removed.

Screenshot: https://imgur.com/a/reKweWU
Bug: chromium:1126031
Change-Id: Ibe26f81817e0ef6e9564553ace070e61d75006c4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2629550
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-01-15 13:14:40 +00:00
Jack Franklin 2ef817b901 Migrate icon_component, issue_survey_link, layout_pane docs
Bug: 1144106
Change-Id: I759055cb0790556243e49a6bfb7c6eae5738ee9d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2617710
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-01-08 11:19:37 +00:00
Simon Zünd 5ed854f3f2 Move Icon component from 'elements' to 'ui/components' module
R=jacktfranklin@chromium.org

Change-Id: I49997ec89954ebcf84931af355942f5196ff190f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2581932
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-12-10 11:09:48 +00:00
Alex Rudenko 982cb54086 Improvements for the Icon component
- removed mentions of someIcon in the code.
- unified the source for styles and (subjective) made the data flow
more top-down.
- added support for changing the icon color via CSS as I have started
to use it and it is not always possible to change it via JS + it feels
like setting the color can be done without a rerender.

Follow-ups:
- explicit API for masked and background image components
- setting colors only via CSS?

Change-Id: I3b15dc3a1b1039a59fd5e2c5e8d2136e696f7989
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2489422
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-10-22 16:10:30 +00:00
Kateryna Prokopenko 704e6d67c1 Icon component
Add a new web-component to simplify adding new/working with icons in DevTools

Bug: chromium:1126031
Change-Id: I37462cad34dae443ea2949fc8f736aa1614b3aa8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2401167
Commit-Queue: Kateryna Prokopenko <kprokopenko@google.com>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
2020-10-14 15:04:42 +00:00