summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kolodyazhny <e0ne@e0ne.info>2020-09-03 18:13:22 +0300
committerGitHub <noreply@github.com>2020-09-03 18:13:22 +0300
commita7f875a49673546312e23f089a8aeea3fa1d4ebb (patch)
tree6b577abfa3b93672758a52d0916c9dcf463dbad7
parentef3f998c59c9358980e7e7e840d13df10e92c600 (diff)
parent7d0490e09c0d0baa15b91cf172b1ba4d1ee4b187 (diff)
downloadpyscss-a7f875a49673546312e23f089a8aeea3fa1d4ebb.tar.gz
Merge pull request #406 from matyasrichter/master
[#404] Linear gradient zero division.
-rw-r--r--scss/extension/compass/gradients.py2
-rw-r--r--scss/tests/files/compass/gradients.css4
-rw-r--r--scss/tests/files/compass/gradients.scss5
3 files changed, 10 insertions, 1 deletions
diff --git a/scss/extension/compass/gradients.py b/scss/extension/compass/gradients.py
index 031fba2..15e1200 100644
--- a/scss/extension/compass/gradients.py
+++ b/scss/extension/compass/gradients.py
@@ -59,7 +59,7 @@ def __color_stops(percentages, *args):
if prev_color:
stops.append(None)
stops = stops[:len(colors)]
- if stops[0] is None:
+ if stops[0] is None or stops[0] == Number(0):
stops[0] = Number(0, '%')
if stops[-1] is None:
stops[-1] = Number(100, '%')
diff --git a/scss/tests/files/compass/gradients.css b/scss/tests/files/compass/gradients.css
index f26dc7f..0dd99ee 100644
--- a/scss/tests/files/compass/gradients.css
+++ b/scss/tests/files/compass/gradients.css
@@ -82,3 +82,7 @@
.bg-linear-gradient-to {
background: linear-gradient(to right, red, green);
}
+
+.panel {
+ background-image: linear-gradient(to bottom, red, green);
+}
diff --git a/scss/tests/files/compass/gradients.scss b/scss/tests/files/compass/gradients.scss
index 1eba785..05b2c70 100644
--- a/scss/tests/files/compass/gradients.scss
+++ b/scss/tests/files/compass/gradients.scss
@@ -93,3 +93,8 @@
.bg-linear-gradient-to {
background: linear-gradient(to right, red 0%, green 100%);
}
+
+// Issue #404
+.panel {
+ background-image: linear-gradient(to bottom, red 0, green 100%);
+}