Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Quick Edit on HTML tags opens wrong CSS class #2977

Closed
phish108 opened this issue Feb 27, 2013 · 3 comments
Closed

Quick Edit on HTML tags opens wrong CSS class #2977

phish108 opened this issue Feb 27, 2013 · 3 comments

Comments

@phish108
Copy link

If I do quick edit on a HTML tag that has no class, but a CSS class for the tag with a class exists in the CSS, Quick Edit opens the definition of that class even if it is not applicable.

Example

p.hello {
   border: 1px solid red;
}
<p class="hello">
...
</p>

<p>
...
</p>

If I quick edit the second tag I get the CSS definition for "p.hello".

If there is a class defined for the p tag present quick edit works correctly.

@peterflynn
Copy link
Member

This is part of the set of issues tracked by our CSS Quick Edit: Improved Heuristics user story.

Currently, our matching doesn't try to be overly smart. If your cursor is on a "p" tag we'll show all rules that match "p" regardless of what CSS classes the rule and/or the tag you're on may have. (Sometimes CSS rules can get added/removed dynamically at runtime, so it's useful to have this option even in the future). If your cursor is on a class attribute, we'll show only rules that match that class, however.

@phish108
Copy link
Author

Thank you for the clarification, Peter,

I looked at the heuristics user story and I cannot see how this issue is included apart maybe from using code intelligence.

The problem with the current behavior is that the user is unaware that the presented style does not match, so when one starts editing things may break in other locations of the project.

I added a criteria to the Heuristics story as my user story when trying brackets.

@njx
Copy link
Contributor

njx commented May 21, 2013

Thanks for the report. Added a link to this issue from the backlog card so that we can consider it when we get to revisiting the CSS Quick Edit heuristics. Closing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants