-
Notifications
You must be signed in to change notification settings - Fork 7.7k
CSS code hints in 'style' attribute value context #13270
Conversation
Sorry but I don't have enough interest in this feature to review it. |
@humphd Can you please have a look at this PR? |
src/language/CSSUtils.js
Outdated
// and in attribute value state of a tag with attribute name style | ||
if (ctx.token.state.htmlState && (!ctx.token.state.localMode || ctx.token.state.localMode.name !== "css")) { | ||
|
||
// tagInfo is required to aquire the style attr value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: indent level
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indent
@swmitra it would be beneficial to have some unit tests for the new functionality. This is complex and might break accidentally. |
Sure @ingorichter. I will add some functional tests in this PR and ping you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change set LGTM with a small nit.
However it doesn't seem to handle multiline styles yet:
<div style="background-color: red; // works here
color: white; // doesn't work here>Foo</div>
It would be also great if it worked on JSX context (<div style={{backgroundColor: red}}
>Hey`) but that's more a feature request :)
src/language/CSSUtils.js
Outdated
// and in attribute value state of a tag with attribute name style | ||
if (ctx.token.state.htmlState && (!ctx.token.state.localMode || ctx.token.state.localMode.name !== "css")) { | ||
|
||
// tagInfo is required to aquire the style attr value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indent
@ingorichter I have added some unit tests in my last commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- checked the code, seems good
- checked the unit tests, present & passing
- tested the feature manually, working fine
I'm too late :-/ |
This PR enables Brackets to provide CSS code hints property-value code hints while editing 'style' attribute value in 'html' mode. The implementation contains minor tweaks to the CSSUtils module to recognize this as 'css' context as CodeMirror doesn't understand the 'style' attribute value as 'css' context.
Adding @ingorichter @petetnt @zaggino and @ficristo for review, but others can also join 馃憤