Auto-format CSS (pretty-print) sometimes not activated
Categories
(DevTools :: Style Editor, defect, P3)
Tracking
(Not tracked)
People
(Reporter: bugzilla.mozilla.reg, Unassigned)
References
(Blocks 2 open bugs)
Details
What were you doing?
It looks like minified JavaScript and CSS files are prettified automatically under Firefox devtools "Debugger" and "Style Editor" tabs, though sometimes CSS files aren't.
There is a prettify button for JavaScript "Debugger" tab, but the CSS "Style Editor" doesn't have this button. It would be nice if the Pretty-print button ({}
) was also present for CSS, to be able to force the prettification.
https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_to/Pretty-print_a_minified_file
Steps to reproduce:
- Go to 9 Frequently Asked Questions About Drupal 7 End of Life
- Open Firefox Developer Tools by pressing F12
- Open "Style Editor" tab and select one of the minified files, called something like https://evolvingweb.ca/sites/default/files/css/css_qkLw-ypd8IVtP6-cRYafRvyL3kVihApYx2epdKqNEOc.css
- See that is not prettified, but shown in one long line
- See that there is no Pretty-print button at the bottom
Is it maybe because the string .min
isn't present in the file name?
What should have happened?
CSS should have been prettified, or the Pretty-print button ({}
) shown, as an alternative to re-format the code.
Actual result:
Nothing happens.
Comment 1•3 years ago
|
||
Thanks for filing. I imagine the logic is at https://searchfox.org/mozilla-central/rev/1659f76981610c1b06437e0a34c0c232b48f4c93/devtools/shared/inspector/css-logic.js#229-233.
We'll need to check if that logic deserves to be updated or if we should just surface this to the user, and remove the "automated" pretty-printing.
I would rather go for the second option here.
Reporter | ||
Comment 2•3 years ago
|
||
Thanks for responding to this so quickly.
We'll need to check if that logic deserves to be updated or if we should just surface this to the user, and remove the "automated" pretty-printing.
I would rather go for the second option here.
Right, there are pros and cons for auto-formatting. When it works it's great to immediately be able to read the code. On the other hand, sometimes the detection fails, and then you'd need a way to activate pretty-print ...
If skipping auto-detection and showing the pretty-print button by default is the simplest and fastest solution to build and roll out, I vote for that.
Comment 3•3 years ago
|
||
Let's try to both expose the feature and improve the automated pretty printing behavior.
Updated•3 years ago
|
Updated•1 year ago
|
Description
•