Open Bug 1800085 (dt-css-explainers) Opened 3 years ago Updated 17 days ago

[META] Experiment with a "computation explainer" tooltip in the rule view (aka CSS explainers)

Categories

(DevTools :: Inspector: Rules, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: nchevobbe, Unassigned)

References

(Depends on 8 open bugs)

Details

(Keywords: meta)

Attachments

(1 file)

It might be useful for users to know the computation that happens when using relative units in property values. Here's a few example

  • % size would indicate the parent size that is used
  • em size would indicate the font-size of the parent element
  • rem size would indicate the font-size of the root
  • vmin/vmax would show the viewport inline and block size and indicate which one was picked
  • container queries relative units would indicate the query container and its size (see Bug 1799657)

This could go into the "Layout" panel, but might be more discoverable directly in the rule view, next to the unit.

We could show the computation for a given size, even if it's not the final computed size used in the element (e.g. in margin: calc(50vw - 10%) , we could have explainer for both the 50vw and 10%)

It could also play well if we ever do something similar to show computation result of calc

I came across this post about % and what it refers to in different contexts: https://wattenberger.com/blog/css-percents https://2019.wattenberger.com/blog/css-percents
Having those information directly in the rule view would be really nice for users

Summary: [META] Experiment with a "size computation explainer" tooltip in the rule view → [META] Experiment with a "computation explainer" tooltip in the rule view
See Also: → 1898261

This could be useful for relative color syntax too: Bug 1898261

Depends on: 1916151

(In reply to Nicolas Chevobbe [:nchevobbe] from comment #1)

I came across this post about % and what it refers to in different contexts: https://wattenberger.com/blog/css-percents
Having those information directly in the rule view would be really nice for users

That link no longer works. The updated URL is https://2019.wattenberger.com/blog/css-percents

(In reply to Bramus from comment #3)

(In reply to Nicolas Chevobbe [:nchevobbe] from comment #1)

I came across this post about % and what it refers to in different contexts: https://wattenberger.com/blog/css-percents
Having those information directly in the rule view would be really nice for users

That link no longer works. The updated URL is https://2019.wattenberger.com/blog/css-percents

thanks bramus for spotting this, I updated my comment 👍

Depends on: 1930741

Chrome added some version of this lately

Depends on: 1423701
Depends on: 1985842
Priority: -- → P3
Depends on: 1733928
Alias: dt-css-explainers
Summary: [META] Experiment with a "computation explainer" tooltip in the rule view → [META] Experiment with a "computation explainer" tooltip in the rule view (aka CSS explainers)
Depends on: 2006562
Depends on: 2018605
Depends on: 2006565
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: