https://github.com/rafalkaron/importaint
Compile a CSS file with imports into a resolved CSS file without imports.
https://github.com/rafalkaron/importaint
automation css imports monolith optimization python
Last synced: 2 months ago
JSON representation
Compile a CSS file with imports into a resolved CSS file without imports.
- Host: GitHub
- URL: https://github.com/rafalkaron/importaint
- Owner: rafalkaron
- License: mit
- Created: 2020-08-01T07:20:41.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-21T18:59:50.000Z (over 3 years ago)
- Last Synced: 2025-02-17T07:43:39.616Z (over 1 year ago)
- Topics: automation, css, imports, monolith, optimization, python
- Language: Python
- Homepage:
- Size: 63.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# importaint
Compile a CSS file with imports into a resolved CSS file without imports.
## Before you begin
1. Download the latest **importaint** version. See [Download](https://github.com/rafalkaron/importaint/releases/latest).
1. Unzip **importaint**.
## Usage
1. In a terminal app, run **important** followed by the local path or URL to the CSS file that you want to compile.
**NOTE:** You can pass the following optional arguments to control the **importaint** behavior.
* `--output` or `-out` - define the output directory
* `--minify` or `-m` - minify the resolved CSS
* `--remove_comments` or `-rc` - remove `/* comments */` from the resolved CSS
* `--copy` or `-c` - copy the resolved CSS output to system clipboard
2. If needed, accept any security prompt. For more information, see [Accepting macOS Security Prompts](https://github.com/rafalkaron/importaint/wiki/Accepting-macOS-Security-Prompts) or [Accepting Windows Security Prompts](https://github.com/rafalkaron/importaint/wiki/Accepting-Windows-Security-Prompts).
## Examples
### Local File - compiled without comments
```shell
importaint "C:\GitHub\styling\style.css" --remove_comments
```
#### Result
In the original CSS file directory, a new resolved CSS file without `/* comments */` is created: `C:\GitHub\styling\style_compiled.css`
### Remote File - compiled, minified, and copied to clipboard
```shell
importaint "https://mysite.com/styles/style.css" --minify --copy
```
#### Result
In the local directory that you are prompted about:
* The remote unresolved CSS file is downloaded
* A new resolved and minified CSS file is created
### Remote file - compiled and saved to a custom output folder
```shell
importaint "https://mysite.com/styles/style.css" -out "C:\MyStyles\StyleA"
```
#### Result
In the output directory that you provided (`C:\MyStyles\StyleA`)
* The remote unresolved CSS file is downloaded
* A new resolved CSS file is created