Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Styling subcomponents based on import #7582

Copy link
Copy link
Open
@dxlbnl

Description

@dxlbnl
Issue body actions

Describe the problem

I'd like to be able to override some styles (margins, paddings, colors) for a component I import in a higher order component.

Describe the proposed solution

Styled components allow for higher level components to override styles (as long as they all are styled components).
I think we could add something similar to svelte, since we know what generated classname a component has on compiletime, so we'd be able to replace the selector with the proper classname.

<style>
import Link from './Link.svelte'
</style>

<Link ... />

<style>
  {Link}:hover {
    fill: rebeccapurple;
  </style>

Alternatives considered

Passing custom property solutions are available, but that would require the imported component to expose all the possible values.

Importance

would make my life easier

Metadata

Metadata

Assignees

No one assigned

    Labels

    cssStuff related to Svelte's built-in CSS handlingStuff related to Svelte's built-in CSS handling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.