Skip to content

Extensible Scoped Styles #1

Open

Description

@pemrouz

@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>

Activity

  1. pemrouz commented on Aug 27, 2015

    @pemrouz
    ContributorAuthor

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

  2. pemrouz commented on Sep 21, 2015

    @pemrouz
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions