4646app2/
4747|- static/
4848 |- app2/
49- |- css/
5049 |- scss/
5150 |- _colors.scss
5251 |- app2.scss
@@ -58,14 +57,7 @@ In `app2.scss` you could reference app1's and app2's `_colors.scss` import as so
5857@import ' app1/scss/colors' ;
5958@import ' app2/scss/colors' ;
6059// Or since you are in app2, you can reference its colors with a relative path.
61- @import ' scss/colors' ;
62- ```
63-
64- In your Django HTML template, reference the CSS file as normal:
65-
66- ``` html
67- {% load static %}
68- <link href =" {% static 'app2/css/app2.css' %}" rel =" stylesheet" >
60+ @import ' colors' ;
6961```
7062
7163Then to compile ` app2.scss ` and put it in the ` css ` directory,
@@ -82,6 +74,13 @@ a corresponding `css` directory. This will traverse all subdirectories as well:
8274python manage.py sass app2/static/app2/scss/ app2/static/app2/css/
8375```
8476
77+ In your Django HTML template, reference the CSS file as normal:
78+
79+ ``` html
80+ {% load static %}
81+ <link href =" {% static 'app2/css/app2.css' %}" rel =" stylesheet" >
82+ ```
83+
8584✨✨ ** Congratulations, you are now a Django + Sass developer!** ✨✨
8685
8786Now you can commit those CSS files to version control, or run ` collectstatic ` and deploy them as normal.
@@ -112,7 +111,7 @@ python manage.py sass app2/static/app2/scss/ app2/static/app2/css/ -t compressed
112111```
113112
114113You may now optionally commit the CSS files to version control if so desired,
115- or omit them, whatever fits your needs better. The run ` collectsatic ` as normal.
114+ or omit them, whatever fits your needs better. Then run ` collectsatic ` as normal.
116115
117116```
118117python manage.py collectstatic
@@ -146,8 +145,10 @@ Limitations
146145
147146* Only supports ` -t ` and ` -p ` options similar to ` pysassc ` . Ideally ` django-sass ` will
148147 be as similar as possible to the ` pysassc ` command line interface.
148+ ** Note:** if using with Bootstrap, specify ` -p 8 ` as Bootstrap requires higher floating
149+ point precision to work correctly.
149150
150- Please feel free to file an issue or make a pull request to improve any of these limitations. 🐱💻
151+ Feel free to file an issue or make a pull request to improve any of these limitations. 🐱💻
151152
152153
153154Why django-sass?
@@ -156,13 +157,16 @@ Why django-sass?
156157Other packages such as [ django-libsass] ( https://github.com/torchbox/django-libsass )
157158and [ django-sass-processor] ( https://github.com/jrief/django-sass-processor ) ,
158159while nice packages, require ` django-compressor ` which itself depends on several
159- other packages that require compilation to install. If you simply want to use
160- Sass in development without installing a web of unwanted dependencies, then
161- ` django-sass ` is for you. If you don't want to deploy any processors or compressors
162- to your production server, then ` django-sass ` is for you. If you don't want to change
163- the way you reference and serve static files, then ` django-sass ` is for you.
164- And if you want the absolute simplest installation and setup possible for doing Sass,
165- ` django-sass ` is for you too. 😀
166-
167- django-sass only depends on libsass (which provides pre-build wheels for Windows, Mac,
160+ other packages that require compilation to install.
161+
162+ * If you simply want to use Sass in development without installing a web of unwanted
163+ dependencies, then ` django-sass ` is for you.
164+ * If you don't want to deploy any processors or compressors to your production server,
165+ then ` django-sass ` is for you.
166+ * If you don't want to change the way you reference and serve static files,
167+ then ` django-sass ` is for you.
168+ * And if you want the absolute simplest installation and setup possible for doing Sass,
169+ ` django-sass ` is for you too.
170+
171+ django-sass only depends on libsass (which provides pre-built wheels for Windows, Mac,
168172and Linux), and of course Django (any version).
0 commit comments