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

User Styles not loading with shadow DOM #4962

Closed
sangregoriopaolo opened this issue Jan 9, 2015 · 13 comments
Closed

User Styles not loading with shadow DOM #4962

sangregoriopaolo opened this issue Jan 9, 2015 · 13 comments

Comments

@sangregoriopaolo
Copy link

After the last release of yesterday, my stylesheet (that was working before) is not loading anymore.

@benogle
Copy link
Contributor

benogle commented Jan 9, 2015

If you disable the shadow DOM in the settings and reload the editor, does it work again?

Can you paste in your stylesheet?

@sangregoriopaolo
Copy link
Author

Hi, disabling the shadow dom and restarting atom fixes the issue! thanks!

Here is my stylesheet, anyway:

atom-text-editor .selection .region {
  background-color:#333;
}

atom-text-editor .invisible-character {
  color:#555;
}

.editor.is-focused .selection .region {
  background-color:#333;
}

.editor {
  background:#111;
}

.tree-view {

}

atom-text-editor {

}

atom-text-editor .cursor {

}

@benogle
Copy link
Contributor

benogle commented Jan 9, 2015

You need to update your sheet for the shadow DOM change. You should be able to get away with changing it to this:

atom-text-editor::shadow .selection .region {
  background-color:#333;
}

atom-text-editor::shadow .invisible-character {
  color:#555;
}

atom-text-editor.is-focused::shadow .selection .region {
  background-color:#333;
}

.editor {
  background:#111;
}

Check out this document: https://atom.io/docs/latest/upgrading/upgrading-your-ui-theme

@benogle
Copy link
Contributor

benogle commented Jan 9, 2015

@nathansobo are we autoconverting the user's sheet? Can we? Or can we detect that they have improper styles and pop up a notification when the shadow DOM is enabled?

@benogle benogle changed the title Custom stylesheet is not loading after last update User Styles not loading with shadow DOM Jan 9, 2015
@sangregoriopaolo
Copy link
Author

Great, it worked! Sorry for not being able to find that document by myself!

@benogle
Copy link
Contributor

benogle commented Jan 9, 2015

No prob, we should be better about notifying you that you need to make changes.

@nathansobo
Copy link
Contributor

@benogle We could scan for .editor and atom-text-editor selectors that have descendants without a ::shadow and warn...

@benogle
Copy link
Contributor

benogle commented Jan 9, 2015

That would be nice. Then I can write up a doc specific to the user sheet (basically trimmed down version of that doc above), and we can link to it in the doc. I think a notification rather than dep cop would be the best thing for the user sheet as the user can fix it.

@andrewpbrett
Copy link

Thanks for pointing in the right direction. FWIW this issues page was the first place I looked. A notification would be great!

@Zren
Copy link

Zren commented Jan 13, 2015

The default stylesheet should be updated. I don't believe the atom-text-editor .cursor {} rule will work.

Eg:

/*
 * 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 {

}

/*
 * The editor itself uses a shadow DOM so rules must start with
 * atom-text-editor::shadow or they will be ignored.
 */
atom-text-editor::shadow {
  .cursor {

  }
}

@nathansobo
Copy link
Contributor

@Zren Thanks for pointing that out. Updated via ab45885.

@benogle
Copy link
Contributor

benogle commented Jan 19, 2015

Closing in favor of #5149 for a message.

@lock
Copy link

lock bot commented Jan 23, 2019

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 as resolved and limited conversation to collaborators Jan 23, 2019
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

5 participants