Skip to content

Support global styles - Allow multiple top-level style tag declarations with different attributes #2762

Closed
@btakita

Description

@btakita

There are a couple of plugins that support globally scoped style tags.

https://www.npmjs.com/package/svelte-preprocess-css-global

https://www.npmjs.com/package/@ctx-core/sass

This naturally leads to the pattern to have both a global & a non-global style block for a component.

<style type=text/scss global>
</style>
<style type=text/scss>
</style>
<style type=text/css>
</style>

Unfortunately, Svelte gives an error You can only have one top-level <style> tag per component. Since there is some usage of global style tags, along with a rfc, it's time to modify this requirement if there are <style> tags with different attributes.

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