git init
- Add a
.gitignore
for_sites/
andnode_modules/
npm init -y
npm install --save-dev @11ty/eleventy
- Add a simple
.eleventy.js
config file - Add a simple
index.html
page npm install --save-dev tailwindcss@latest postcss@latest postcss-cli@latest autoprefixer@latest
npx tailwindcss init --package
- Add a
tailwind.css
with@tailwind
entries - Add
mode
andpurge
totailwind.config.js
- Add scripts to package.json
"build": "rm -rf ./_site && npm run build:eleventy & npm run build:tailwind",
"build:eleventy": "npx @11ty/eleventy",
"build:tailwind": "TAILWIND_MODE=build NODE_ENV=production postcss ./tailwind.css --output ./_site/default.css",
"dev": "rm -rf ./_site && npm run dev:eleventy & npm run dev:tailwind",
"dev:eleventy": "npx @11ty/eleventy --serve",
"dev:tailwind": "TAILWIND_MODE=watch NODE_ENV=development postcss ./tailwind.css --output ./_site/default.css --watch"
npm run dev
- Builds a minimal Tailwind CSS file and saves it to
./_site/default.css
- Builds a minimal Tailwind CSS file and saves it to
- Add the class
text-red-200
to thebody
inindex.html
and save.- The class
text-red-200
is added to the CSS, saved to./_site/default.css
and the browser refreshes.
- The class
- Changed the class of the
body
fromtext-red-200
totext-green-200
inindex.html
and save- The class
text-green-200
is added to the CSS and saved to./_site/default.css
but the classtext-red-200
is not removed and the browser refreshes.
- The class
- Add
h1 { @apply text-7xl font-bold; }
totailwind.css
- The class
h1
is added to the CSS and saved to./_site/default.css
but the browser does not refresh. This is expected as the changes totailwind.css
and the generated./_site/default.css
file are not being watched by Eleventy. A manual browser refresh will show the change.
- The class
11ty-tailwind's Introduction
11ty-tailwind's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.