A starter project that GETs you up and running with Gulp (v4), ES6 JavaScript modules, and TailwindCSS (v3).
Great as a kickstart template for trying out TailwindCSS, quickly generating simple sites, mocking up design components or wireframes, or working on SPAs.
- Sass compilation (in SCSS format, so you can use CSS directly if you prefer) with autoprefixing, minification and sourcemaps, using modern Dart Sass.
- Responsive image file and markup generation (
<picture>
sets withwebp
andavif
formats), automatically. - Modern (2022) HTML5 boilerplate, heavily commented to guide you in your work.
- HTML and Javascript minification.
- Cache-busting of CSS, JS and image assets.
- All the usual Tailwind 3 stuff, including Just-In-Time mode and CSS purging by default. (If you weren't around for the history of TailwindCSS, just know that these are both Good Thingsβ’.) The Tailwind typography plugin is also included.
- Live browser reloading.
- ES6 modules and syntax, so this starter project is easy to extend and adapt as you see fit.
- Bonus: Prettier is integrated and runs on every
commmit using Husky and Pretty Quick. You can run it on all files at any time
by using
npm run format
. - Bonus: Optional automatic publishing to GitHub Pages each time you push to
main
. - Bonus: Optional accessibility checking with pa11y.
Prerequisite: Node v.14.8.0 or above
-
Clone or fork this project
-
Run
npm install
gulp
or npm start
After the site is built, your default web browser will open with the index file
and automatically reload whenever project files change. (If you don't want a
browser to open automatically, use gulp --noop
.)
gulp --prod
or npm run prod
On production builds all CSS, JS and image files are renamed by appending random
strings, and references to those files in HTML, JS and CSS files are
automatically rewritten. If you don't need cache-busting, you can turn it off by
setting the cacheBusting
option in config.js
to false
.
A GitHub build action will publish your project to GitHub Pages on every push. We use it to build the GET page itself!
A GitHub accessibility action will check your project for common a11y issues when you push to your repo. You may want to replace this with accessibility checking in your build process to ensure issues are addressed earlier in your development cycle.
There are other workflows with internal_
prefixes that
are used to manage the GET project itself. These can be safely removed, or you
can use them as templates for your own workflows.
With all workflows, edit or remove the files as necessary to fit your own project and process!
config.js
contains path and project configuration -- edit this to suit your needs.tailwind.config.cjs
contains TailwindCSS configuration.docs
contains GET's internal documentation. You can remove or change these for your own project as you like.src
contains the files you'll be working with:src/fonts
contain local font files; note related configuration intailwind.config.cjs
.src/img
contains images which will be minified in builds.src/js
contains site scripts which will be minified, and contains subdirectories for drop-in library scripts and vendor scripts.src/root
contains files you want copied to the root of your build directory, likerobots.txt
orCNAME
.src/styles
contains Sass files that generate minified CSS.
Build processes will generate files in dist
, which is ignored by git.
If you aren't using GitHub for your project development, you can remove this directory entirely.
If you are using GitHub, you can remove files directly under .github
(e.g.
CODEOWNERS
), or edit them to align with your own
project.
Within the workflows
directory, actions that begin with internal_
are part
of GET's project management, and can be removed if you don't want them to run in
your own GitHub repo.
You may want to edit the name, description, author, and URLs listed in this file
to match your own project. Run npm i
to update package-lock.json
to match.
foo.jpg
and foo.gif
) will clobber each
other. In larger projects, a more efficient and robust templating system would
make much more sense -- for instance see how a Hugo theme I've contributed to
handles it.
To turn off GET's image and markup generation, set modernImages
to false
in
config.js
. Images will still be minified, but alternate formats
and markup will not be created.
Tailwind provides an option for
targeting styles for when dark mode is enabled
on a user's system using the dark:
prefix, and this has been turned on in the
Tailwind configuration.
Tailwind provides an option for
targeting styles for print-only styles
on a user's system using the print:
prefix, and this has been turned on in the
Tailwind configuration.
Tailwind has
experimental support for language direction modifiers
using rtl:
and ltr:
prefixes (only those, at the moment). To help support
this, dir="ltr"
is already set on the sample HTML file; change as needed to
set the overall language direction for the page.
Ask a support question on GitHub if you're stuck.
- π Add a GitHub Star to the project.
- Tweet about GET on Twitter).
- Consider sponsoring rootwork, GET's developer, and have your name or logo included here!
- Blog about the project. We love reviews, and are eager to hear ways we could make things even better.
- Contribute!
First off, thanks for taking the time to contribute! Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make will benefit everybody else and are greatly appreciated.
Please read our contribution guidelines, and thank you for being involved!
Legalese: GET is provided "as is" without any warranty. Use at your own risk.
For more information and to report security issues, please refer to our security documentation.
Work
funded in part by Multi-Etch,
LLC.
Consider sponsoring rootwork, GET's developer, and have your name or logo included here!
GET originally inspired by https://github.com/stefansdev/creativdepot and https://github.com/lazymozek/gulp-with-tailwindcss
The big three components are, of course:
- https://github.com/gulpjs/gulp
- https://github.com/babel/babel
- https://github.com/tailwindlabs/tailwindcss
Other projects GET leverages:
- https://github.com/eslint/eslint
- https://github.com/typicode/husky
- https://github.com/prettier/prettier
- https://github.com/azz/pretty-quick
- https://github.com/Browsersync/browser-sync
- https://github.com/lovell/sharp
- https://github.com/khalyomede/gulp-sharp-responsive
- https://github.com/terser/terser
- https://github.com/sass/sass
- https://github.com/postcss/postcss
- https://github.com/postcss/autoprefixer
- https://github.com/gulp-sourcemaps/gulp-sourcemaps
- https://github.com/scniro/gulp-clean-css
- https://github.com/contra/gulp-concat
- https://github.com/jonschlinkert/gulp-htmlmin
- https://github.com/eneko89/cachekill
- https://github.com/robrich/gulp-if
- https://github.com/lazd/gulp-replace
- https://github.com/dec0dOS/amazing-github-template
- https://github.com/yargs/yargs
- https://github.com/sindresorhus/log-symbols
Thank you open source!