Skip to content

Support for components being able to impact css scope #4661

Closed
@bmlyon

Description

@bmlyon

This issue relates to #901, which was closed in favor of sveltejs/rfcs#13, which does not address multiple problems mentioned in 901.

Problem statement

It is currently not possible in Svelte for styles within a component to impact areas outside of the component.

This impacts, among other things:

  • The ability for nested components to have styles related to the nesting.
  • The ability to have component styles be related to placement, ie if both components are on the page, style them differently.
  • The ability for stylesheets to easily impact groupings of components (ie this is my "navigation" stylesheet).
  • The ability to DRY style (I can't reuse certain styles because components can't impact eachother).
  • The ability to opt-in or opt-out of style encapsulation at any given time.
  • The ability to use the first letter in the CSS acronym, the cascade.
  • The ability to insert svelte into a legacy application with preexisting CSS.

Examples of how other frameworks work around this problem

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