DEV Community

Cover image for How i use global script in my components sapper-svelte?
tlaxcalajuan
tlaxcalajuan

Posted on

How i use global script in my components sapper-svelte?

Top comments (2)

Collapse
 
giorgosk profile image
Giorgos Kontopoulos πŸ‘€

If you are referring to global css script see how it is used in a sapper template
github.com/sveltejs/sapper-template (github.com/sveltejs/sapper-templat...)

or you can use global scoped styles within any of the svelte files by using the :global function like so

<style>
    :global(p) {
        margin-bottom: 1 rem;
    }
</style>
Enter fullscreen mode Exit fullscreen mode
Collapse
 
giorgosk profile image
Giorgos Kontopoulos πŸ‘€

Describe what you want to do with more details and perhaps someone can jump in and help.