Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Deprecated selector warning for unmodified styles.less file #6869

Closed
tylersticka opened this issue May 20, 2015 · 16 comments
Closed

Deprecated selector warning for unmodified styles.less file #6869

tylersticka opened this issue May 20, 2015 · 16 comments

Comments

@tylersticka
Copy link

Howdy!

This issue cropped up (or at least I noticed it) around 0.199, but it remains in 0.200.

I have one deprecation warning (which sticks around even in safe mode):

your local styles.less file
  /Users/tylersticka/Dropbox (Personal)/Atom/styles.less
  Style elements within text editors using the atom-text-editor::shadow selector or the .atom-text-editor.less file extension. If you want to target overlay elements, target them directly or as descendants of atom-overlay elements.

If I click that error, I am taken to what appears to be an empty file:

screen shot 2015-05-20 at 9 49 07 am

If I go to the Atom menu and select "Open Your Stylesheet," this is what it looks like:

/*
 * Your Stylesheet
 *
 * This stylesheet is loaded when Atom starts up and is reloaded automatically
 * when it is changed.
 *
 * If you are unfamiliar with LESS, you can read more about it here:
 * http://www.lesscss.org
 */

.tree-view {

}

atom-text-editor {

}

atom-text-editor .cursor {

}

I thought maybe I had inherited this stylesheet from an older version, so I tried commenting out everything within it... but the deprecation warning remains.

(Apologies if this issue is duplicated, I swear I searched for it before creating a this one!)

Edit: I should also mention that I have my .atom directory symbolically linked to Dropbox (if you're wondering why my paths aren't simply /Users/tylersticka/.atom).

@50Wliu
Copy link
Contributor

50Wliu commented May 20, 2015

Looks like the problem here is that it's including the %20 in the path instead of changing it to a space.

@50Wliu 50Wliu added the bug label May 20, 2015
@ajgreenb
Copy link

Actually, what fixed this for me was adding ::shadow after the second atom-text-editor selector. With that update, your stylesheet should look like the new default that ships with Atom.

@tylersticka
Copy link
Author

Pasting the raw stylesheet @ajgreenb linked to into my personal styles.less resolves the deprecation warning (at least for me). (Though I'm still confused why commenting the styles out entirely didn't do the same!)

@ajgreenb
Copy link

Yeah, commenting out didn't work for me either. Weird!

@kdemarest
Copy link

For those seeing this June 5, 2015 and after, here is a valid styles.less file. If anyone knows a better solution, please contribute!

/*
 * Your Stylesheet
 *
 * This stylesheet is loaded when Atom starts up and is reloaded automatically
 * when it is changed.
 *
 * If you are unfamiliar with LESS, you can read more about it here:
 * http://www.lesscss.org
 */

.tree-view {

}

atom-text-editor::shadow {

}

atom-text-editor .cursor {

}

Revised based on 50wliu's feedback (he has 8 commits to Atom)

@azat-co
Copy link

azat-co commented Jun 24, 2015

This worked for me

/*
 * Your Stylesheet
 *
 * This stylesheet is loaded when Atom starts up and is reloaded automatically
 * when it is changed.
 *
 * If you are unfamiliar with LESS, you can read more about it here:
 * http://www.lesscss.org
 */

.tree-view {

}

.atom-text-editor {

}

atom-text-editor::shadow .cursor {

}

@50Wliu
Copy link
Contributor

50Wliu commented Jun 24, 2015

Please use atom-text-editor, not .atom-text-editor.

@paultibbetts
Copy link

I've just updated to version 1.0.0 and this is still happening.

/*
 * Your Stylesheet
 *
 * This stylesheet is loaded when Atom starts up and is reloaded automatically
 * when it is changed.
 *
 * If you are unfamiliar with LESS, you can read more about it here:
 * http://www.lesscss.org
 */

.tree-view {

}

atom-text-editor::shadow {

}

atom-text-editor .cursor {

}

and

/*
 * Your Stylesheet
 *
 * This stylesheet is loaded when Atom starts up and is reloaded automatically
 * when it is changed.
 *
 * If you are unfamiliar with LESS, you can read more about it here:
 * http://www.lesscss.org
 */

.tree-view {

}

.atom-text-editor {

}

atom-text-editor::shadow .cursor {

}

both work for me.

@kdemarest
Copy link

Dear Atom Developers,

Nobody should have to tweak their install simply to upgrade. This is a serious issue. I'm not sure why you aren't giving it priority. Perhaps it is super rare?

Ken

@EvHaus
Copy link

EvHaus commented Jun 26, 2015

I just installed Atom for the first time (never had it before) and I have these messages as well on a clean install of 1.0.

@benogle
Copy link
Contributor

benogle commented Jun 30, 2015

@globexdesigns can you paste in your styles.less? The styles.less generated from the current master seems to have the correct selectors.

Nobody should have to tweak their install simply to upgrade.

What do you propose? Should we rewrite the styles.less, risking getting it wrong?

@kdemarest
Copy link

I'll confess that I only poorly understand the problem, but I was imagining something happening at install time like "does styles.less contain certain required elements? If not, make them." but I could be way off base.

@benogle
Copy link
Contributor

benogle commented Jun 30, 2015

Basically what happened is this:

The editor contents are now beneath the shadow-dom to avoid pollution from the ui. So things like atom-text-editor .cursor no longer work because .cursor is not a child of atom-text-editor; it's in the shadow dom.

People who downloaded atom before the shadow dom conversion have selectors targeting the non-shadow-dom editor in their styles.less, but of course, they no longer work in the shadow-dom world.

So we wrote a selector linter to catch the cases where these selectors will not work, and they are reported in the status bar by deprecation cop.

This warning is not fatal. The worst thing that happens is that your user styles that modify things in the editor do not work. In the case here where everyone's user styles are empty, it's a non issue.

Also note the correct form is this:

.tree-view {
}

atom-text-editor {
}

atom-text-editor::shadow .cursor {
}

::shadow is only necessary when you are breaking through the shadow boundary and styling something inside the editor (cursors, selections, decorations, etc).

@Ehekatl
Copy link

Ehekatl commented Jul 16, 2015

+1,
This happens on windows if the user name contain space ( and it will be replace to %20)

@stale stale bot added the stale label Jul 15, 2017
@stale
Copy link

stale bot commented Jul 15, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot closed this as completed Aug 14, 2017
@lock
Copy link

lock bot commented Mar 31, 2018

This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

@lock lock bot locked and limited conversation to collaborators Mar 31, 2018
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

9 participants