nebula-syntax-atom icon indicating copy to clipboard operation
nebula-syntax-atom copied to clipboard

Deprecated selector in `nebula-syntax/index.less`

Open goronfreeman opened this issue 8 years ago • 10 comments

In nebula-syntax/index.less:

Starting from Atom v1.13.0, the contents of atom-text-editor elements are no longer encapsulated within a shadow DOM boundary. This means you should stop using :host and ::shadow pseudo-selectors, and prepend all your syntax selectors with syntax--. To prevent breakage with existing style sheets, Atom will automatically upgrade the following selectors:

  • atom-text-editor.editor .linter-highlight.error .region, .linter-highlight.error .region => atom-text-editor.editor .linter-highlight.syntax--error .region, .linter-highlight.syntax--error .region

  • atom-text-editor.editor .linter-highlight.warning .region, .linter-highlight.warning .region => atom-text-editor.editor .linter-highlight.syntax--warning .region, .linter-highlight.syntax--warning .region

  • atom-text-editor.editor .linter-highlight.trace .region, .linter-highlight.trace .region, atom-text-editor.editor .linter-highlight.info .region, .linter-highlight.info .region => atom-text-editor.editor .linter-highlight.syntax--trace .region, .linter-highlight.syntax--trace .region, atom-text-editor.editor .linter-highlight.syntax--info .region, .linter-highlight.syntax--info .region

Automatic translation of selectors will be removed in a few release cycles to minimize startup time. Please, make sure to upgrade the above selectors as soon as possible.

goronfreeman avatar Jan 31 '17 05:01 goronfreeman

This was a regression bug due to styles added in #1. Has been fixed and released with 0.4.1.

tjkohli avatar Jan 31 '17 23:01 tjkohli

What? These classes (syntax--error etc.) don't even exist. On the newest version of Atom and linter, the HTML for linter highlights looks like this:

<div class="highlights">
  <div class="highlight linter-highlight error">
    <div class="region" style="..."></div>
  </div>
</div>

So with those changes the highlighting no longer works. Please revert!

jgierer12 avatar Feb 01 '17 07:02 jgierer12

@jgierer12 Hmm. So to make them work, Nebula Syntax will have a deprecated warning? What's the permanent solution to this?

Isn't it a problem with the Linter?

tjkohli avatar Feb 01 '17 15:02 tjkohli

Update: I reverted the change back to:

&.error .region {
	.highlight-underline(@background-color-error; transparent);
}
&.warning .region {
	.highlight-underline(@background-color-warning);
}
&.trace .region, &.info .region {
	.highlight-underline(@background-color-info);
}

and it still does NOT seem to work for me.

I believe it's because the Linter has not yet been updated. See this issue

tjkohli avatar Feb 01 '17 17:02 tjkohli

Yeah but I don't even get why Atom reports it as deprecated.

atom-text-editor.editor .linter-highlight.error .region, .linter-highlight.error .region

No :host or ::shadow in there

Edit: OK, after some research I think the best solution would be to move the whole linter highlighting code to nebula-ui instead, since Atom doesn't do the automatic prefixing with syntax-- in UI themes... Really sorry to cause so much trouble with my PR 🙈

jgierer12 avatar Feb 01 '17 17:02 jgierer12

I could temporarily fix the issue by moving Linter to UI, but that's not a proper solution. I'd recommend bugging the Linter developer(s) because the fact that they're writing deprecated classes is their issue, not ours.

When they update their package with the syntax--* selectors, I'll gladly reactivate the Linter support. But for now, it's not viable. Rolling it back with 0.5.2. Sorry, guys. You'll have to deal with the ugly dotted lines of the Linter until they get their act together.

Update: I filed an issue. Comment + add thumbs up to it!

tjkohli avatar Feb 01 '17 22:02 tjkohli

I just hit the report issue button in Atom, and didn't think it would cause such a big discussion, haha! Sorry if this caused you any troubles. I gave the issue you filed a +1.

goronfreeman avatar Feb 02 '17 00:02 goronfreeman

@goronfreeman No trouble at all! This is how stuff gets done. We appreciate your input.

tjkohli avatar Feb 02 '17 00:02 tjkohli

@tjkohli Let me know if there's any way I can help out with the linter CSS fixes. I'd be happy to contribute. You got me to change my UI and syntax theme for the first time in over a year.

goronfreeman avatar Feb 02 '17 00:02 goronfreeman

@goronfreeman Will definitely let you know. For now, I ask that if you like this theme and want it to keep floating, spread the word! The more people have it, the better it's going to get for everyone.

tjkohli avatar Feb 02 '17 13:02 tjkohli