Skip to content

MikevPeeren/sveltekit-typescript-tailwindcss-sass-starter

Repository files navigation

SvelteKit TypeScript TailwindCSS & Sass Starter

A modern starter template for building web applications with SvelteKit, TypeScript, TailwindCSS, and Sass. This template provides a robust foundation for your next project with best practices and modern tooling.

✨ Why Choose This Starter?

  • πŸš€ Modern Stack: Built with the latest versions of SvelteKit, TypeScript, and TailwindCSS
  • 🎨 Styling Flexibility: Combine TailwindCSS utilities with Sass for powerful styling
  • πŸ§ͺ Testing Ready: Includes both E2E and unit testing setup out of the box
  • πŸ“ Code Quality: Pre-configured with ESLint, Prettier, and TypeScript
  • πŸ”„ Git Hooks: Husky and lint-staged ensure code quality on every commit
  • πŸ“± Responsive: Built with mobile-first design principles
  • ⚑️ Performance: Optimized for fast loading and smooth interactions

πŸš€ Features

  • ⚑️ SvelteKit - The official application framework for Svelte
  • 🎨 TailwindCSS v4 - A utility-first CSS framework
  • πŸ“˜ TypeScript - Type-safe JavaScript
  • 🎨 Sass - CSS extension language
  • πŸ§ͺ Playwright - End-to-end testing
  • πŸ§ͺ Vitest - Unit testing
  • πŸ“ ESLint - Code linting
  • πŸ¦‹ Prettier - Code formatting
  • 🐢 Husky - Git hooks
  • 🧹 Lint Staged - Run linters on staged files

πŸš€ Quick Start

Deploy with Vercel

πŸ› οΈ Installation

# Clone the repository git clone git@github.com:MikevPeeren/sveltekit-typescript-tailwindcss-sass-starter.git # or npx degit git@github.com:MikevPeeren/sveltekit-typescript-tailwindcss-sass-starter.git # Install dependencies yarn install # or npm install

πŸš€ Development

Start the development server:

yarn dev # or npm run dev

Open http://localhost:3000 to view your application.

πŸ“ Available Scripts

  • yarn dev - Start development server
  • yarn build - Build for production
  • yarn preview - Preview production build
  • yarn test - Run Playwright end-to-end tests
  • yarn test:unit - Run Vitest unit tests
  • yarn check - Type-check your code
  • yarn check:watch - Type-check your code in watch mode
  • yarn lint - Lint your code
  • yarn format - Format your code

πŸ“ Project Structure

β”œβ”€β”€ src/ β”‚ β”œβ”€β”€ routes/ # SvelteKit routes β”‚ β”œβ”€β”€ app.html # HTML template β”‚ β”œβ”€β”€ app.scss # Global styles β”‚ └── app.d.ts # TypeScript declarations β”œβ”€β”€ static/ # Static assets β”œβ”€β”€ tests/ # Test files └── public/ # Public assets 

πŸ§ͺ Testing

This starter includes both end-to-end and unit testing setup:

  • End-to-end Testing: Uses Playwright for browser testing
  • Unit Testing: Uses Vitest for component and utility testing

Run tests with:

# Run end-to-end tests yarn test # Run unit tests yarn test:unit

🎨 Styling

This starter combines the power of TailwindCSS with Sass:

  • Use TailwindCSS utility classes directly in your components
  • Create custom styles with Sass in src/app.scss
  • Leverage TailwindCSS's responsive design utilities
  • Use Sass variables and mixins for complex styling needs

πŸ”§ Configuration

The project includes several configuration files:

  • tailwind.config.js - TailwindCSS configuration
  • tsconfig.json - TypeScript configuration
  • svelte.config.js - SvelteKit configuration
  • .eslintrc.cjs - ESLint configuration
  • .prettierrc - Prettier configuration

πŸ“š Learn More

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • SvelteKit team for the amazing framework
  • TailwindCSS team for the utility-first CSS framework
  • All contributors who have helped improve this starter