Skip to content

Commit e7f19ab

Browse files
author
Krystle Salazar
committed
Use SASS/SCSS for styles
1 parent 69c20ee commit e7f19ab

File tree

6 files changed

+156
-7
lines changed

6 files changed

+156
-7
lines changed

Pipfile

+2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ flake8 = "*"
99

1010
[packages]
1111
django = "~=3.0"
12+
django_compressor = "*"
1213
django-countries = "*"
1314
django-heroku = "*"
15+
django-libsass = "*"
1416
gunicorn = "*"
1517
psycopg2 = "*"
1618
django-ordered-model = "*"

Pipfile.lock

+77-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

caselaw/settings.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@
2424
SECRET_KEY = os.environ.get("DJANGO_SECRET_KEY")
2525

2626
# SECURITY WARNING: don't run with debug turned on in production!
27-
DEBUG = os.environ.get("DJANGO_DEBUG_ENABLED", default=False)
27+
DEBUG = os.environ.get("DJANGO_DEBUG_ENABLED", default=False) in ["True", True]
2828

2929
ALLOWED_HOSTS = ["localhost", "127.0.0.1"]
3030

3131

3232
# Application definition
3333

3434
INSTALLED_APPS = [
35+
"compressor",
3536
"django.contrib.admin",
3637
"django.contrib.auth",
3738
"django.contrib.contenttypes",
@@ -122,6 +123,13 @@
122123

123124
STATIC_URL = "/static/"
124125

126+
STATICFILES_FINDERS = [
127+
"django.contrib.staticfiles.finders.FileSystemFinder",
128+
"django.contrib.staticfiles.finders.AppDirectoriesFinder",
129+
"compressor.finders.CompressorFinder",
130+
]
131+
132+
COMPRESS_PRECOMPILERS = (("text/x-scss", "django_libsass.SassCompiler"),)
125133

126134
# See https://devcenter.heroku.com/articles/deploying-python#python-deployment-flow
127135
django_heroku.settings(locals())

legal_db/static/style.scss

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
$color-tomato: rgb(237, 89, 47);
2+
$color-dark-turquoise: rgb(5, 181, 218);
3+
$color-dark-slate-blue: rgb(60, 92, 153);
4+
$color-dark-slate-gray: rgb(51, 51, 51);
5+
$color-lighter-gray: rgb(245, 245, 245);
6+
7+
body {
8+
color: $color-dark-slate-gray;
9+
}
10+
11+
.breadcrumb {
12+
a, a:hover {
13+
color: $color-dark-slate-blue;
14+
}
15+
}
16+
17+
.button.tag {
18+
&.case {
19+
&:hover, &.tag-selected {
20+
color: white;
21+
background-color: $color-tomato;
22+
border-color: $color-tomato;
23+
}
24+
}
25+
&.scholarship {
26+
&:hover, &.tag-selected {
27+
color: white;
28+
background-color: $color-dark-turquoise;
29+
border-color: $color-dark-turquoise;
30+
}
31+
}
32+
}
33+
34+
.card.entry-post.link a .card-content.has-bottom-link {
35+
padding: 0 0 3rem 0;
36+
}
37+
38+
.hero {
39+
background-color: $color-lighter-gray;
40+
41+
&.case {
42+
box-shadow: inset 0px 6px 0px $color-tomato;
43+
}
44+
45+
&.scholarship {
46+
box-shadow: inset 0px 6px 0px $color-dark-turquoise;
47+
}
48+
49+
p {
50+
max-width: 708px;
51+
}
52+
}
53+
54+
.contribute {
55+
float: right;
56+
max-width: 380px;
57+
}
58+
59+
.tags-filter {
60+
color: $color-dark-slate-blue;
61+
cursor: pointer;
62+
}

legal_db/templates/legal_db/base.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{% load compress %}
12
{% load static %}
23

34
<!DOCTYPE html>
@@ -8,7 +9,10 @@
89
<meta name="description" content=""/>
910
<title>CC Legal Database</title>
1011
<link rel="icon" href="{% static 'favicon.ico' %}"/>
11-
<link rel="stylesheet" href="https://unpkg.com/@creativecommons/vocabulary/css/vocabulary.css">
12+
<link rel="stylesheet" type="text/css" href="https://unpkg.com/@creativecommons/vocabulary/css/vocabulary.css">
13+
{% compress css %}
14+
<link rel="stylesheet" type="text/x-scss" href="{% static 'style.scss' %}">
15+
{% endcompress %}
1216
{% block styles %}{% endblock %}
1317
</head>
1418
<body>
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% extends 'legal_db/base.html' %}
22

33
{% block body_content %}
4-
<div class="padding-horizontal-xxl padding-vertical-large" style="background-color: #E5E5E5;">
4+
<div class="hero padding-horizontal-xxl padding-vertical-large">
55
<h1>Creative Commons Legal Database</h1>
66
</div>
77
{% endblock %}

0 commit comments

Comments
 (0)