Mirror

Volodymyr Tkach eeb9330624 Update README.md 2 years ago
.cache 5c41da64c8 Create .keep 2 years ago
css 4f1384e239 Fix, remove duplicated props 2 years ago
test 1599ffc24f Add some examples to test files 2 years ago
.gitignore 986e6165e3 Update .gitignore 2 years ago
LICENSE 7072494e1b Initial commit 2 years ago
Makefile 99fc01dbb0 Submakefile 2 years ago
README.md eeb9330624 Update README.md 2 years ago
assets.makefile 46341d080d Update assets.makefile 2 years ago
assets.sh 3ee7831c18 Create cache dir if not exists 2 years ago

README.md

assets

Collection of web assets for reuse in other projects

How to use

Install yui-compressor tool:

sudo apt-get install yui-compressor

Include to your main makefile:

.assets.makefile:
    curl -fsSL -o $@ https://raw.githubusercontent.com/vladimirok5959/assets/main/assets.makefile

include .assets.makefile

Add to gitignore file:

/.cache/
.*.makefile
assets.sh

Keep your CSS and JS files with *.dev.css and *.dev.js suffix. Run make assets command to process all finded files

You can include CSS or JS files from internet into local file by import() command inside CSS or JS file. Check /test/ directory and /test/test.dev.css file. For example:

/* import(https://path/to/file/reset.css) */
/* import(https://path/to/file/controls/checkbox/ios.css) */

.example {
    background-color: red;
}

In the result you will get combined and minified CSS file without .dev. suffix. And the same works for JS files. Note: for reducing http requests /.cache/ directory is used. Run make assets-clear-cache for clearing cached files