Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extensible Scoped Styles #1

Open
pemrouz opened this issue Aug 22, 2015 · 2 comments
Open

Extensible Scoped Styles #1

pemrouz opened this issue Aug 22, 2015 · 2 comments

Comments

@pemrouz
Copy link
Contributor

pemrouz commented Aug 22, 2015

@3liv / @gangji91, if you fancy taking a stab, here's the approach I was thinking towards extensible styling we briefly touched on.

This module already enables scoped styles using the syntax [css="some.css"]. Given that the /deep/ combinator is now being removed, and a component often declares it's own base styles, we need a way to allow an application to extend that. The simplest thing to do would be to extend this module to allow multiple scoped styles via [css="some.css some-modifiers.css"], which (in a non-shadow DOM browser) would result in the following:

<component css="some.css some-modifiers.css">
  <style resource="some.css">...</style>
  <style resource="some-modifiers.css">...</style>
@pemrouz
Copy link
Contributor Author

pemrouz commented Aug 27, 2015

Related: /deep/ will be deprecated in Chrome 45, so this is quite important to do asap.

@pemrouz
Copy link
Contributor Author

pemrouz commented Sep 21, 2015

An alternative would be to support the standard @import syntax. A component stylesheet could reference other common reusable stylesheet(s) and Ripple could go through the trouble of prepending them all as <style> tags until @import in Shadow DOM is natively supported by browsers.

I think we may need both options for multiple component stylesheets: configuration via the [css] attribute for application developers and @import for component developers, since using the [css] would unnecessarily leak internal implementation details beyond the Shadow DOM boundary .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant