Development
FlatifyCSS is written in Sass, which is compiled to CSS & JavaScript using Gulp. This page covers the development process.
Code standards
To keep things clean and organized, I follow the Code Guide rules for development.
Setup
I use Bun for this project. Run bun install in the root directory of FlatifyCSS, then bun run build compiles the FlatifyCSS stylesheet and JavaScript file. Npm and Yarn work too, there is just no lockfile for them.
Sass
In the root directory of FlatifyCSS, there is a /scss directory, which contains the Sass files used to build the FlatifyCSS stylesheet.
The flatify.scss file is the main file, extend the base stylesheet from there.
Afterward to write your code to extend the current features, create a file e.g. _my-file.scss and import it into the flatify.scss file.
JavaScript
JavaScript is the same as Sass, in the /js directory use the flatify.js file to extend features, it uses Webpack so it is possible to use the import and export feature of ES6.
Gulp tasks
Inside the gulpfile.js all tasks are defined, you can use these tasks to compile files or watch for changes automatically.
gulp
Compiles the scss and js files into /dist with production settings. This is the default task, the same as gulp build, and it does not touch the version.
It also writes flatify-rtl.css and its friends as copies of the main files, so old links from version 1 still get the current CSS. These copies will be removed in version 3.
gulp watch
Use this task to watch for changes in the scss and js directories to compile them, note that this task use development settings to speed up the compile process, so generated files are not safe for product usage.
gulp release
Bumps the version in package.json, scss/flatify.scss and js/flatify.js with patch type, then builds everything. It does not commit or tag, check the changes and do it yourself.
You can use the --ver parameter to set the desired version or use --type to change the bump version type. For example: --ver "1.0.0" or --type "minor". The default bump version type is patch.
gulp prerelease
Same as release, but bumps a prerelease version like 2.0.1-0.
Documentation website
The website lives in the /website directory and is built with Docusaurus. The pages you are reading are in /website/docs.
cd website
bun install
bun start
It is hosted on Vercel with website as the root directory, bun run build builds it into website/build.