brackets-archive / bracketsIssues

Archive of issues in brackets.
0 stars 0 forks source link

[CLOSED] Live CSS with Attribute Selectors #1876

Open core-ai-bot opened 3 years ago

core-ai-bot commented 3 years ago

Issue by Spica2 Wednesday Oct 24, 2012 at 07:52 GMT Originally opened as https://github.com/adobe/brackets/issues/1927


Live coding for selectors e.g. input[type="submit"] is not implemented

core-ai-bot commented 3 years ago

Comment by RaymondLim Thursday Oct 25, 2012 at 18:12 GMT


@Spica2 Not sure I understand your feature request. Are you asking something in Code Hints, or something related to CSS Live preview?

Your example seems to be a piece of JavaScript code that can be used with jQuery as in $("input[type=submit]").

core-ai-bot commented 3 years ago

Comment by peterflynn Thursday Oct 25, 2012 at 19:46 GMT


I can confirm that Live Preview works just fine with selectors of this form.

But I notice that@Spica2 says "live coding", so I'm wondering if there's some confusion with Zen Coding? That's not supported in Brackets yet, although some people are working on an extension that adds support.

core-ai-bot commented 3 years ago

Comment by Spica2 Friday Oct 26, 2012 at 06:52 GMT


Sorry for the confusion. I mean the CSS live preview. I have some inputs that I want to style by attribute selectors, e.g. input[type="submit"] in the css file. But I do not get any preview with command E while working on the input in the html with cursor placed on the attribute.

core-ai-bot commented 3 years ago

Comment by GarthDB Friday Oct 26, 2012 at 13:38 GMT


Cmd+e is the command for inline editor. CSS live development is viewing any changes live in the code in the browser.

So it isn't showing attribute selectors in the inline editor?

On Thursday, October 25, 2012, Spica2 wrote:

Sorry for the confusion. I mean the CSS live preview. I have some inputs that I want to style by attribute selectors, e.g. input[type="submit"] in the css file. But I do not get any preview with command E while working on the input in the html with cursor placed on the attribute.

— Reply to this email directly or view it on GitHubhttps://github.com/adobe/brackets/issues/1927#issuecomment-9804239.

core-ai-bot commented 3 years ago

Comment by Spica2 Friday Oct 26, 2012 at 13:43 GMT


Again sorry, not used yet to propper feature names. Just begun using brackets. I mean the inline editor. Definetly Cmd+e.

core-ai-bot commented 3 years ago

Comment by GarthDB Friday Oct 26, 2012 at 13:52 GMT


No problem, just making sure we're talking about the same thing.

On Oct 26, 2012, at 6:43 AM, Spica2 notifications@github.com wrote:

Again sorry, not used yet to propper feature names. Just begun using brackets. I mean the inline editor. Definetly Cmd+e.

— Reply to this email directly or view it on GitHub.

core-ai-bot commented 3 years ago

Comment by RaymondLim Friday Oct 26, 2012 at 14:17 GMT


input[type="submit"] is working for me. Can you tell us what you have in your html file and where you place the cursor or the selection in your html file when you press Cmd+E? And just in case what you have in your css file also.

core-ai-bot commented 3 years ago

Comment by Spica2 Friday Oct 26, 2012 at 15:18 GMT


<style type="text/css">
input {border:1px solid black;}
input[type="submit"] {background:white;}
input.button {padding:10em;}
</style>
<input type="submit" value="submit" class="button">

Maybe I were expecting a different behaviour. Cursor in the class puts the class style in the inline editor. Putting cursor in value or type gives nothing. Cursor in tag gives the tag selector style, and at the right the list of all 3 styles. I were expecting to get the attribute style in first place and already placed in the editor instead of the tag style.

core-ai-bot commented 3 years ago

Comment by njx Friday Oct 26, 2012 at 16:47 GMT


Hi@Spica2 -- our heuristics for which rules to show you are very simplistic right now, and (as you noted) are sensitive to exactly which attribute you're in. Basically, if you're in a class or id attribute, we show any rules that might affect that class or id; if you're in a tag name, we show any rules that might affect that tag. We don't take the cascade into account or do true selector matching.

We have an item in our icebox to improve this: https://trello.com/c/SdihjjmS -- please feel free to vote it up on Trello. I think we need to move it up on our backlog since our current heuristics definitely feel a bit too simple...although we also have to be careful not to narrow the list of rules too much, since (at least when not in live development) we don't have the true context of which rules apply.

core-ai-bot commented 3 years ago

Comment by njx Friday Oct 26, 2012 at 16:47 GMT


Closing since this is in the icebox. I'll send mail to@adrocknaphobia to consider prioritizing this somewhere on the backlog.