Nathan Sobo
7dd67caf57
Remove ‘group’ parameter to addStyleSheet in favor of ‘priority’
2015-01-07 09:51:42 -07:00
Nathan Sobo
4c74b07b22
Order style elements by priority
2015-01-06 19:14:54 -07:00
Nathan Sobo
299ea18c58
Don’t try to upgrade CSS rules with no selector text
...
Fixes #4469
2014-12-09 13:41:33 -07:00
Nathan Sobo
7f326421d7
Upgrade existing selectors after attaching atom-styles element
...
Style elements don’t have a .sheet property until they are actually
attached to the DOM.
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com >
2014-11-13 16:04:57 -08:00
Nathan Sobo
441dcfb56a
Add specs for atom-text-editor shadow DOM selector upgrades
...
And cover one more case with `.editor` plus pseudo-classes
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com >
2014-11-13 16:04:57 -08:00
Nathan Sobo
42d9ef397d
Automatically upgrade syntax themes for shadow DOM compatibility
...
If a given selector in a stylesheet targeting the atom-text-editor
context references `.editor` or `.editor-colors`, we automatically
replace these with the appropriate `:host` pseudo-class expressions.
If the selector already contains the :host pseudo-class, we perform no
upgrade.
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com >
2014-11-13 16:04:57 -08:00
Max Brunsfeld
98d602628a
Render all stylesheets in atom-styles elements without contexts
...
Signed-off-by: Nathan Sobo <nathan@github.com >
2014-11-07 12:56:32 -08:00
Nathan Sobo
5f4fb23057
Initialize atom-styles element in editor shadow dom before measuring
2014-11-04 16:37:22 -07:00
Nathan Sobo
22f6268116
Assign StylesElement::context on attachment
2014-11-04 16:37:21 -07:00
Nathan Sobo
2b218d2e01
Only update atom-styles children on context attribute change if attached
2014-11-04 16:37:21 -07:00
Nathan Sobo
3b6189e94b
Create WeakMap on element creation to support ‘context’ attribute change
2014-11-04 16:37:21 -07:00
Nathan Sobo
4e8e5a84c4
Support context attribute in <atom-styles>
2014-11-04 16:37:20 -07:00
Nathan Sobo
a8b9e1b790
Handle style element updates in StylesElement
2014-10-15 15:14:13 -06:00
Nathan Sobo
be51ccf786
Add StylesElement::onDidAdd/RemoveStyleElement
2014-10-15 15:14:13 -06:00
Nathan Sobo
65e077abd1
Use StyleManager and StylesElement to manage all stylesheet elements
...
For now, loading remains in the theme manager, but all application of
stylesheets is routed through atom.styles.
2014-10-15 15:14:13 -06:00
Nathan Sobo
79598aaae9
Add StyleElement
...
This will be used to handle stylesheet rendering when we move management
of loading stylesheets to the StyleManager instead of the theme manager.
This sets us up for being able to render specific stylesheets in shadow
roots in addition to just having global stylesheets.
2014-10-15 15:14:13 -06:00