Skip to content

Commit

Permalink
1.0.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
vsalvino committed Mar 4, 2021
1 parent 5cd72da commit b3c0268
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 26 deletions.
73 changes: 48 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,17 @@ In your Django HTML template, reference the CSS file as normal:

✨✨ **Congratulations, you are now a Django + Sass developer!** ✨✨

Now you can commit those CSS files to version control, or run `collectstatic` and deploy them as normal.
Now you can commit those CSS files to version control, or run `collectstatic`
and deploy them as normal.

For an example project layout, see `testproject/` in this repository.


Watch Mode
----------

To have `django-sass` watch files and recompile them as they change (useful in development),
add the ``--watch`` flag.
To have `django-sass` watch files and recompile them as they change (useful in
development), add the ``--watch`` flag.

```
python manage.py sass app2/static/app2/scss/ app2/static/app2/css/ --watch
Expand Down Expand Up @@ -133,10 +134,11 @@ And now proceed with deploying your files as normal.
Limitations
-----------

* `@import` statements must reference a path relative to a path in `STATICFILES_FINDERS`
(which will usually be an app's `static/` directory or some other directory specified
in `STATICFILES_DIRS`). Or they can reference a relative path equal to or below the
current file. It does not support traversing up the filesystem (i.e. `../`).
* `@import` statements must reference a path relative to a path in
`STATICFILES_FINDERS` (which will usually be an app's `static/` directory or
some other directory specified in `STATICFILES_DIRS`). Or they can reference a
relative path equal to or below the current file. It does not support
traversing up the filesystem (i.e. `../`).

Legal imports:
```scss
Expand All @@ -151,31 +153,43 @@ Limitations

* Only files ending in `.scss` are supported for now.

* Only supports `-g`, `-p`, and `-t` options similar to `pysassc`. Ideally `django-sass` will
be as similar as possible to the `pysassc` command line interface.
* Only supports `-g`, `-p`, and `-t` options similar to `pysassc`. Ideally
`django-sass` will be as similar as possible to the `pysassc` command line
interface.

Feel free to file an issue or make a pull request to improve any of these limitations. 🐱‍💻
Feel free to file an issue or make a pull request to improve any of these
limitations. 🐱‍💻


Why django-sass?
----------------

Other packages such as [django-libsass](https://github.com/torchbox/django-libsass)
and [django-sass-processor](https://github.com/jrief/django-sass-processor),
while nice packages, require `django-compressor` which itself depends on several
other packages that require compilation to install.

* If you simply want to use Sass in development without installing a web of unwanted
dependencies, then `django-sass` is for you.
* If you don't want to deploy any processors or compressors to your production server,
then `django-sass` is for you.
Other packages such as
[django-libsass](https://github.com/torchbox/django-libsass) and
[django-sass-processor](https://github.com/jrief/django-sass-processor), while
nice packages, require `django-compressor` which itself depends on several other
packages that require compilation to install.

Installing `django-compressor` in your production web server requires a LOT of
extra bloat including a C compiler. It then will compile the Sass on-the-fly
while rendering the HTML templates. This is a wasteful use of CPU on your web
server.

Instead, `django-sass` lets you compile the Sass locally on your machine
*before* deploying, to reduce dependencies and CPU time on your production web
server. This helps keep things fast and simple.

* If you simply want to use Sass in development without installing a web of
unwanted dependencies, then `django-sass` is for you.
* If you don't want to deploy any processors or compressors to your production
server, then `django-sass` is for you.
* If you don't want to change the way you reference and serve static files,
then `django-sass` is for you.
* And if you want the absolute simplest installation and setup possible for doing Sass,
`django-sass` is for you too.
* And if you want the absolute simplest installation and setup possible for
doing Sass, `django-sass` is for you too.

django-sass only depends on libsass (which provides pre-built wheels for Windows, Mac,
and Linux), and of course Django (any version).
django-sass only depends on libsass (which provides pre-built wheels for
Windows, Mac, and Linux), and of course Django (any version).


Programmatically Compiling Sass
Expand Down Expand Up @@ -233,6 +247,7 @@ venv, then:
Before committing, run static analysis tools:

```
(myvenv)$ black .
(myvenv)$ flake8
(myvenv)$ mypy
```
Expand All @@ -247,17 +262,25 @@ Then run the unit tests:
Changelog
---------

#### 1.0.1
* Maintanence release, no functional changes.
* Add additional type hints within the codebase.
* Tested against Django 3.1
* Formatted code with `black`.

#### 1.0.0
* New: You can now use `django_sass` APIs directly in Python.
* Added unit tests.
* Code quality improvements.

#### 0.2.0
* New feature: `-g` option to build a source map (when input is a file, not a directory).
* New feature: `-g` option to build a source map (when input is a file, not a
directory).

#### 0.1.2
* Fix: Write compiled CSS files as UTF-8.
* Change: Default `-p` precision from 5 to 8 for better support building Bootstrap CSS.
* Change: Default `-p` precision from 5 to 8 for better support building
Bootstrap CSS.

#### 0.1.1
* Fix: Create full file path if not exists when specifying a file output.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name="django-sass",
version="1.0.0",
version="1.0.1",
author="CodeRed LLC",
author_email="[email protected]",
url="https://github.com/coderedcorp/django-sass",
Expand Down

0 comments on commit b3c0268

Please sign in to comment.