-
Notifications
You must be signed in to change notification settings - Fork 715
[css-nesting] Suggest a way to inspect CSS nesting in browser DevTools #8236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I would be fantastic if for CSS Nesting, the CSSOM is also updated with awareness of nesting. This hasn't happened with layers and it makes creating devtools/introspection tooling outside of a browsers internals significantly more complex. In terms of display, deciding which part of the nesting context (e.g. sibling nested selectors) to show and when is going to be the biggest puzzle, though I'm not convinced that there's going to be one ideal way that all devtools teams agree on (and having a few different representations that can converge over time is probably a good thing). |
I agree that tooling support is important. Chrome DevTools team is planning to work on tooling support for CSS nesting in 2023. I don't think there is a need for all DevTools teams to agree on the same UX pattern. Competition breeds innovation :) However, I think interoperability with CSSOM is a completely different issue. |
Sure, competition helps move forward, and I don't think we need to agree on what to do. |
Yes, of course. I just wanted to avoid design-by-committee for something somewhat subjective and user-facing as developer tooling UX. Collecting requirements together makes a lot of sense. |
I like @denk0403's suggestions but regarding the Styles/Rules panel, I wonder whether completely desugaring actually helps debugging the selectors. To avoid indentation hell within the panel, this might be ok, though there should at least be a popup showing the original selector structure on hover. On the other hand, the Sources/Style Editor panel (and also IDEs) should provide a way to display the desugared selectors. This could also be a popup on hovering the inner selectors. In addition to displaying the parent selectors for the Sebastian |
I don't mind the discussion going on here, but this is definitely out of scope for the spec itself, so I'm going to tag it as such and close it. Feel free to continue using this to discuss the tooling issue, if it's useful. |
CSS nesting is going to be such a major change to the way we write CSS. In fact, so much that the way we display it in our browser DevTools might need to change too!
The adoption of the feature will not only be driven by its implementation in browser, but also by tooling support to some extent. Code editors, obviously, will need to understand nesting, and help find errors and offer syntax highlighting and code completion. But browser developer tools will also need to display the new syntax to let users inspect their webpages and debug potential problems.
Of course, this isn't something that the CSS WG needs to specify, but I do believe that on top of designing this feature for the best authoring experience, some thoughts should be given to the debugging experience too.
Relatedly, I posted last year about how specs could suggest ways in which UAs could expose more debugging information to end users. This isn't exactly the same here. But the idea comes from the same need of thinking about how end users will inspect and debug web pages written with CSS nesting.
I would love it if various DevTools teams and CSSWG people could discuss and agree on the best way to represent nested rules in DevTools, in a way to makes it easy for people to learn how nesting even works, and reports errors (such as missing
&
signs).Pinging a few DevTools peeps here: @janodvarko @nchevobbe @Kilian @hashseed @codepo8.
The text was updated successfully, but these errors were encountered: