Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oncomouse/extract-tachyons
Accelerate your Tachyons websites! Read HTML files, extract a list of CSS classes, and create a custom distribution of Tachyons with only the classes you are actually using.
https://github.com/oncomouse/extract-tachyons
postcss tachyons tachyons-css
Last synced: about 2 months ago
JSON representation
Accelerate your Tachyons websites! Read HTML files, extract a list of CSS classes, and create a custom distribution of Tachyons with only the classes you are actually using.
- Host: GitHub
- URL: https://github.com/oncomouse/extract-tachyons
- Owner: oncomouse
- Created: 2018-08-14T17:08:54.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-09T10:42:06.000Z (about 2 years ago)
- Last Synced: 2024-04-14T23:15:43.809Z (9 months ago)
- Topics: postcss, tachyons, tachyons-css
- Language: CSS
- Homepage:
- Size: 339 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Extract Tachyons
Build the custom [Tachyons](http://tachyons.io/) that *your project* needs!
Tachyons is an amazing system of functional CSS classes, and even though it's extremely focused, the whole package still adds ~14KB of gzipped CSS to a project. Wouldn't it be nice to have a custom Tachyons bundle that only uses the classes your project is actually using?
Enter **Extract Tachyons**.
Extract Tachyons is a command line tool that reads HTML files, extracts the CSS classes in them, and builds a custom Tachyons file that only contains the classes you are actually using. Processing your files this way will *dramatically* reduce file sizes in projects that use Tachyons!
## Installation
To install, run `yarn add -D @oncomouse/extract-tachyons` or `npm install -D @oncomouse/extract-tachyons` in a Node.js project.
## Usage
From the command line: `npx extract-tachyons [--compress] [--output ] build/**/*.html`
* `--compress` will shrink the output with [CSSNano](https://cssnano.co/).
* `--output ` will write the output to `` (default is to print to STDOUT)
* `--always ` will always include the classes in ``
* `` is comma separated: `black,hover-black` or `orange, ms-3`
* `--never ` will never include the classes in ``
* `` is comma separated: `black,hover-black` or `orange, ms-3`## Note
It's probably a good idea to only use the output of Extract Tachyons in production. You never know when you will need to add new classes to your project!