Let’s add some styles to your Svelte component.
Styles are scoped in Svelte, meaning, all the selectors will only apply to the elements within the Svelte component.
This means
1) You don’t have to worry adding a style will break the style of elements outside of this component
2) Svelte will warn you if your selector does not match any elements within this component
Also, @keyframes animations are scoped too!
Of course there’s always a way to disable the scoped style behaviour if you choose not to scope your selector or @keyframes.
Introduction 00:00
How styles are scoped 00:54
Svelte warns for unused selectors 03:38
How scoped styles work 04:32
Scoped @keyframes 06:59
Disable scoped style behaviour 09:16
---
💻 REPL
📚 Related Resources
Svelte
Svelte REPL
Svelte Tutorial
🥰 Support me
🔗 Want to learn more from me
3 views
444
123
9 months ago 01:16:00 1
Часть 1. Делаем чат на Svelte. NodeJs. GraphQL и Websockets. Верстка.
10 months ago 00:05:01 1
1999 Jaguar XJR For Sale Gateway Classic Cars Orlando #1869
11 months ago 02:54:25 1
Web Development In 2023 - A Practical Guide
2 years ago 00:20:58 1
Система нотификаций с Redux Thunk
2 years ago 00:18:23 1
Что такое КОМПОЗИЦИЯ в Redux Thunk?
2 years ago 00:12:05 1
Что такое Redux Thunk?
2 years ago 01:05:03 1
Как быстро начать программировать?
3 years ago 00:19:42 3
gQuery 101
3 years ago 00:05:20 1
How To Build a LEGO Sphere
4 years ago 00:29:30 1
Svelte 101: svelte options
4 years ago 00:04:07 1
Svelte 101: svelte:body
4 years ago 00:08:16 1
Svelte 101: svelte:window
4 years ago 00:09:38 1
Svelte 101: svelte:head
4 years ago 00:06:17 1
Svelte 101: svelte:self
4 years ago 00:34:50 1
Svelte 101: Lazy Component
4 years ago 00:09:22 1
Svelte 101: svelte:component
4 years ago 00:25:56 1
Svelte 101: $$props and $$restProps
4 years ago 00:34:37 7
Svelte 101: Tabs
4 years ago 00:27:21 1
Svelte 101: Infinite List
4 years ago 00:09:29 1
Svelte 101: $$slots
4 years ago 00:16:56 1
Svelte 101: Slots Forwarding
4 years ago 00:09:29 1
Svelte 101: Passing data across slot
4 years ago 00:13:09 5
Svelte 101: Slot to compose components
4 years ago 00:13:26 1
Svelte 101: Recreate elements and components when value changes with {#key} block