summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--conftest.py10
-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
4 files changed, 18 insertions, 3 deletions
diff --git a/conftest.py b/conftest.py
index 535bb68..86c213a 100644
--- a/conftest.py
+++ b/conftest.py
@@ -58,7 +58,10 @@ def pytest_collect_file(path, parent):
parts = str(path).split(path.sep)
# -4 tests / -3 files / -2 directory / -1 file.scss
if parts[-4:-2] == ['tests', 'files']:
- return SassFile(path, parent)
+ if hasattr(SassFile, "from_parent"):
+ return SassFile.from_parent(parent, fspath=path)
+ else:
+ return SassFile(path, parent)
class SassFile(pytest.File):
@@ -67,7 +70,10 @@ class SassFile(pytest.File):
if not fontforge and parent_name == 'fonts':
pytest.skip("font tests require fontforge")
- yield SassItem(str(self.fspath), self)
+ if hasattr(SassItem, "from_parent"):
+ yield SassItem.from_parent(parent=self, name=str(self.fspath))
+ else:
+ yield SassItem(str(self.fspath), self)
class SassItem(pytest.Item):
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%);
+}