Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying SvelteKit Up and Running
  • Table Of Contents Toc
  • Feedback & Rating feedback
SvelteKit Up and Running

SvelteKit Up and Running

By : Dylan Hildenbrand
4.4 (11)
close
close
SvelteKit Up and Running

SvelteKit Up and Running

4.4 (11)
By: Dylan Hildenbrand

Overview of this book

The JavaScript ecosystem has grown vast, complex, and daunting for newcomers. Fortunately, SvelteKit has emerged, simplifying the process of building JavaScript-based web applications. This book aims to demystify SvelteKit, making it as approachable as it makes web app development. With SvelteKit Up and Running you’ll be introduced to the philosophy and technologies underlying SvelteKit. First, you’ll follow a standard educational programming approach, progressing to a 'Hello World' application. Next, you’ll explore the fundamental routing techniques, data loading management, and user submission, all through real-world scenarios commonly encountered in day-to-day development, before discovering various adapters employed by SvelteKit to seamlessly integrate with diverse environments. You’ll also delve into advanced concepts like dynamic route management, error handling, and leveraging SvelteKit to optimize SEO and accessibility. By the end of this book, you’ll have mastered SvelteKit and will be well-equipped to navigate the complexities of web app development.
Table of Contents (19 chapters)
close
close
1
Part 1 – Getting Started with SvelteKit
5
Part 2 – Core Concepts
10
Part 3 – Supplemental Concepts

Additional Information

We now know how we can import static files, but there are a few details to keep in mind when doing so. Here’s a breakdown of the various items we still need to cover:

  • Images versus Styles
  • Customizing Imports
  • File Paths
  • SvelteKit Configuration Options
  • Vite Configuration Options

Now let’s go over some important information about what went on behind the scenes with each of our imports.

Images versus Styles

When we imported an image in Chapter 2, we received the URL, which we then referenced in the src attribute of an <img> tag. When we imported the CSS file, we only needed to import it to apply the styles. This is because Vite is pre-configured to automatically inject the styles from CSS files into the component performing the import. Hence why the import was performed in the root +layout.svelte file. Vite also supports CSS @import and url() statements as well as CSS modules. CSS modules can be useful for...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY