Skip to content
This repository was archived by the owner on Apr 19, 2021. It is now read-only.

Repository files navigation

🌐 Sapper with PostCSS project base

❓ What is this?

This is an extension to the official Sapper Rollup template with support for PostCSS inside Svelte components. You are also recommended to check out @nhristov's similar template.

If you're looking for something with much, much more bundled in, check out my opinionated project base.

📋 Copy

Choose either to clone or fork depending on your preference.

🐑 Clone

git clone https://github.com/babichjacob/sapper-postcss-template

🍴 Fork

Click the Use this template button on this project's GitHub page.

⬇️ Install Dependencies

You need to be using version 12 or higher of Node.

cd sapper-postcss-template
npm install  # pnpm also works

🛠 Usage

🧪 Development

npm run dev

🔨 Building for Production

If you do not need to include heavy Babel transforms and polyfills to support old browsers on your site, then remove the --legacy flag in the build package script to lighten it up.

npm run prod

📦 Exporting a Static Site

If you do not need to include heavy Babel transforms and polyfills to support old browsers on your site, then remove the --legacy flag in the export package script to lighten it up.

npm run export

⚙ Configuration

💨 Optionally removing Tailwind CSS

  1. Remove all Tailwind imports in the src/global.pcss file
  2. Remove these lines in postcss.config.js:
    1. import tailwindcss from "tailwindcss";
    2. import * as tailwindcssConfig from "./tailwind.config";
    3. tailwindcss(tailwindcssConfig),
  3. Delete the tailwind.config.js file
  4. Uninstall the tailwindcss and @tailwindcss/ui packages

⚡ Web app

Many of the fields in static/manifest.json (short_name, name, description, categories, theme_color, and background_color) are filled with demonstrative values that won't match your site. Similarly, you've got to take new screenshots to replace the included static/screenshot-1.png file. If you want, you can add app shortcut definitions for "add to home screen" on Android. Once you change theme_color, update the meta name="theme-color" tag in src/template.html to match.

The Apple touch icon, favicon, and logo- files (also all in the static directory) are created by placing the logo within a "safe area" centered circle that takes up 80% of the canvas's dimension. For instance, the constraining circle in logo-512.png is 512 × 0.80 = 409.6 ≈ 410 pixels wide and tall.

🗺 Source maps

This project base comes with source maps enabled during development and disabled during production (and exports) for the best compromise between performance and developer experience. You can change this behavior through the sourcemap variable in rollup.config.js.

😵 Help! I have a question

Create an issue and I'll try to help.

😡 Fix! There is something that needs improvement

Create an issue or pull request and I'll try to fix.

I'm sorry, because of my skill level and the fragility of (the combination of) some of these tools, there are likely to be problems in this project. Thank you for bringing them to my attention or fixing them for me.

📄 License

MIT


This README was generated with ❤️ by readme-md-generator

About

A template that includes Sapper for Svelte and PostCSS preprocessing with Tailwind CSS

Topics

Resources

Stars

79 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages