PicoCSS + TailwindCSS
September 8, 2024
I just found the easiest way to build good-looking webpages without having to think about styles.
Basically, you use PicoCSS for the good-looking styles, then TailwindCSS for layout. And also a nice font like IBM Plex Sans. This combination is super productive and easy to get started:
- Run
npx @svelte-add/tailwindcss@latest
- Add following to
src/app.css
:
@import "tailwindcss/base";
@import "tailwindcss/components";
@import "tailwindcss/utilities";
@import url("https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.classless.min.css");
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&display=swap");
@layer components {
.custom {
@apply [&>*]:m-0;
}
}
:root {
--pico-font-family-sans-serif: "IBM Plex Sans", sans-serif;
}
The .custom
class is for when you want to disable default margins in some sections. Otherwise just write regular HTML.