適用 windows
mkdir 0925
cd 0925
npm init -y
npm install -D tailwindcss@latest
npx tailwindcss init --full //完整版 ( 新手推薦 )
npx tailwindcss init //空的
//styles.css
@tailwind base;
@tailwind components;
@tailwind utilities;
Learn More →
npx tailwindcss build styles.css -o tailwind.css
// index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="tailwind.css">
</head>
<body>
...
</body>
</html>
npm install tailwindcss@latest postcss@latest autoprefixer@latest
// postcss.config.js
module.exports = {
plugins: [
require('tailwindcss'),
require('autoprefixer'),
]
}
Learn More →
Learn More →
// tailwind.config.js
module.exports = {
purge: {
enabled: true, // 開關壓縮功能,建議開發時設置false,只在生產時設置成true
content: ['./*.html'], // 需要偵測的檔案
},
// ...
}
npx tailwindcss build styles.css -o tailwind.css
// tailwind.config.js
module.exports = {
theme: {
screens: {
'tablet': '640px',
// => @media (min-width: 640px) { ... }
'laptop': '1024px',
// => @media (min-width: 1024px) { ... }
'desktop': '1280px',
// => @media (min-width: 1280px) { ... }
},
}
}
npx tailwindcss build styles.css -o tailwind.css
// styles.css
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer base {
h1 {
@apply text-2xl;
}
h2 {
@apply text-xl;
}
}
npx tailwindcss build styles.css -o tailwind.css
// styles.css
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer utilities {
@variants responsive,hover {
.scroll-snap-none {
scroll-snap-type: none;
}
.scroll-snap-x {
scroll-snap-type: x;
}
.scroll-snap-y {
scroll-snap-type: y;
}
}
}
npx tailwindcss build styles.css -o tailwind.css
//styles.css
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer components {
@variants hover {
.btn-blue {
@apply py-2 px-4 bg-blue-500 text-white font-semibold rounded-lg shadow-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-400 focus:ring-opacity-75;
}
}
}
npx tailwindcss build styles.css -o tailwind.css
// tailwind.config.js
module.exports = {
variants: {
extend: {
backgroundColor: ['active'],
// ...
borderColor: ['focus-visible', 'first'],
// ...
textColor: ['visited'],
}
},
}
npx tailwindcss build styles.css -o tailwind.css
透過這次兩位Dcard工程師的經驗分享,了解到從在學階段,再到找工作階段,到最後當上工程師之後,有許多值得我們注意的地方,以下列出我覺得重要的知識點。 應徵軟體工程師職位最重要的是有作品集,沒有作品,履歷再漂亮也沒用。 要花時間寫 side project,嘗試和練習感興趣的新技術。 寫程式要考慮擴展性和維護性,讓他人接下來要修改或繼續寫都能很輕鬆。 英文程度很重要,而很多外商是用英文面試。 加入技術社群,交流彼此的想法與技術。
Apr 8, 2022自動排版 Alt + Shift + F 複製上一行 Alt + Shift + ↑ 當前行移動到上一行 Alt + ↑ 刪除當前行 Ctrl + Shift + K 當前行上新增一行 Ctrl + Shift + Enter 當前行下新增一行 Ctrl + Enter 新增檔案 Ctrl + N 關閉目前檔案 Ctrl + W 切換分頁 Ctrl +Tab (Ctrl + Shift + Tab)
Mar 28, 2022記錄用 懶加載路由 // 靜態加載 { path: '/dashboard', name: 'dashboard', component: dashboard },
Jan 4, 20221. 避免表格換行 table tr th { white-space: nowrap; } 2. inline-block + vertical-align 垂直置中 適用行內元素 ( inline , inline-block ),搭配偽元素 <div class="container"> <div class="item"></div>
Nov 15, 2021or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up