Skip to content

Commit

Permalink
Write files as UTF8; default precision to 8
Browse files Browse the repository at this point in the history
  • Loading branch information
vsalvino committed Aug 2, 2019
1 parent 17a254b commit fd61bd8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
django-sass
===========

The absolute simplest way to use [Sass]() with Django. Pure Python,
minimal dependencies, and no special configuration required.
The absolute simplest way to use [Sass](https://sass-lang.com/) with Django.
Pure Python, minimal dependencies, and no special configuration required.

[Source code on GitHub](https://github.com/coderedcorp/wagtail-cache)

Expand Down Expand Up @@ -34,7 +34,7 @@ Usage
-----

In your app's static files, use Sass as normal. The only difference is that
you should not traverse upwards using `../` in `@import` statements. For example:
you can **not** traverse upwards using `../` in `@import` statements. For example:

```
app1/
Expand Down Expand Up @@ -145,8 +145,6 @@ Limitations

* Only supports `-t` and `-p` options similar to `pysassc`. Ideally `django-sass` will
be as similar as possible to the `pysassc` command line interface.
**Note:** if using with Bootstrap, specify `-p 8` as Bootstrap requires higher floating
point precision to work correctly.

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

Expand All @@ -170,3 +168,17 @@ other packages that require compilation to install.

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


Changelog
---------

#### 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.

#### 0.1.1
* Fix: Create full file path if not exists when specifying a file output.

#### 0.1.0
* Initial release
2 changes: 1 addition & 1 deletion django_sass/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.1"
__version__ = "0.1.2"
6 changes: 3 additions & 3 deletions django_sass/management/commands/sass.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def add_arguments(self, parser):
"-p",
type=int,
dest="p",
default=5,
help="Precision. Defaults to 5 (Bootstrap requires 8)",
default=8,
help="Precision. Defaults to 8",
)
parser.add_argument(
"--watch",
Expand All @@ -53,7 +53,7 @@ def compile_sass(self, outfile, **kwargs):
outfile_dir = os.path.dirname(outfile)
if not os.path.exists(outfile_dir):
os.makedirs(outfile_dir, exist_ok=True)
file = open(outfile, "w")
file = open(outfile, "w", encoding="utf8")
file.write(rval)
file.close()

Expand Down

0 comments on commit fd61bd8

Please sign in to comment.