🎨 Styling Setup

We will use Tailwind CSS and free Flowbite component libary for fast development.

Install dependencies:

Terminal window
npx astro add tailwind
npm install flowbite
npm i -D flowbite-typography
npm i -D tailwind-scrollbar

Β 

Update a file:

tailwind.config.mjs
/* eslint-disable global-require */
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
//
'./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}',
'./node_modules/flowbite/**/*.js',
],
darkMode: 'class',
theme: {
extend: {
colors: {
primary: {
50: '#eff6ff',
100: '#dbeafe',
200: '#bfdbfe',
300: '#93c5fd',
400: '#60a5fa',
500: '#3b82f6',
600: '#2563eb',
700: '#1d4ed8',
800: '#1e40af',
900: '#1e3a8a',
},
},
fontFamily: {
sans: [
'Inter',
'ui-sans-serif',
'system-ui',
'-apple-system',
'system-ui',
'Segoe UI',
'Roboto',
'Helvetica Neue',
'Arial',
'Noto Sans',
'sans-serif',
'Apple Color Emoji',
'Segoe UI Emoji',
'Segoe UI Symbol',
'Noto Color Emoji',
],
body: [
'Inter',
'ui-sans-serif',
'system-ui',
'-apple-system',
'system-ui',
'Segoe UI',
'Roboto',
'Helvetica Neue',
'Arial',
'Noto Sans',
'sans-serif',
'Apple Color Emoji',
'Segoe UI Emoji',
'Segoe UI Symbol',
'Noto Color Emoji',
],
mono: [
'ui-monospace',
'SFMono-Regular',
'Menlo',
'Monaco',
'Consolas',
'Liberation Mono',
'Courier New',
'monospace',
],
},
transitionProperty: {
width: 'width',
},
textDecoration: ['active'],
minWidth: {
kanban: '28rem',
},
},
},
safelist: [
// In Markdown (README…)
'justify-evenly',
'overflow-hidden',
'rounded-md',
// From the Hugo Dashboard
'w-64',
'w-1/2',
'rounded-l-lg',
'rounded-r-lg',
'bg-gray-200',
'grid-cols-4',
'grid-cols-7',
'h-6',
'leading-6',
'h-9',
'leading-9',
'shadow-lg',
'bg-opacity-50',
'dark:bg-opacity-80',
// For Astro one
'grid',
],
plugins: [
//
require('flowbite/plugin'),
require('flowbite-typography'),
require('tailwind-scrollbar')({ nocompatible: true }),
],
};

Questions? Let's chat

© 2019 - 2024 β€” Made in πŸ‡¬πŸ‡§ β€” Need Help? Contact [email protected]