Gulp based starter template for better front-end coding with TailwindCSS and Pug & SCSS preprocessors
@font-face
declarations.Make sure you have NodeJS and Yarn installed
$ yarn add --globall gulp bem-tools-core bem-tools-create
$ git clone https://github.com/joseffie/gulp-joseffie-tailwind-pack.git my-project
$ yarn
$ yarn run dev
yarn run dev
- launches watcher and server.yarn run build
- compiles and optimises project.yarn run zip
- build and archives project.yarn run deploy
- builds project and pushes to GitHub repo in gh-pages
branch.yarn run build:fonts
- compiles an local fonts located in src/assets/fonts
.yarn run build:sprites
- compiles an SVG icons located in src/assets/icons
into SVG sprites.Some characters used in Tailwind classes are not supported by Pug when writing classes with a dot .
:
:
used for utilities to style elements. This problem was fixed by changing the separator in tailwind.config.cjs
from colon :
to underscore _
.//- not supported, the code will return an error
element.font-gray-900.hover:font-blue-500
//- write
element.font-gray-900.hover_font-blue-500
[
and ]
characters used to write arbitrary values. You will have to write classes for arbitrary values in the class
attribute.//- not supported, the code will return an error
element.max-w-lg.mx-auto.px-[25px]
//- write
element.max-w-lg.mx-auto(class='px-[25px]')
/
character, which is used in fractional values, and with !
character which is used for important defining.//- not supported, the code will return an error
element.w-1/2
element.!text-blue-100
//- write
element(class='w-1/2')
element(class='!text-blue-100')
Create empty component by name in src/components
folder.
By default generates only *.pug
, *.scss
and *.js
files.
$ bem create component-name
If you need to create only one file type, use the -T
flag:
$ bem create component-name -T pug
If you need to remove one or more default file types, use the -n
flag:
$ bem create component-name -n js
If you need to add another file type to your component folder, use the -t
flag:
$ bem create component-name -t md
You can also combine flags:
$ bem create component-name -n js -t yml
Ivan Gavrilich (joseffie) © 2022 - today The MIT License