Skip to content

Commit

Permalink
Merge pull request #11 from ba-st/ColorUnitsJS
Browse files Browse the repository at this point in the history
CSSColorUnits now render between " when used inside javascript.
  • Loading branch information
gcotelli authored Apr 5, 2017
2 parents da4a91c + 81e4054 commit 6486dd9
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*RenoirSt-Seaside-Tests
testJavascriptOn

| color |

color := CssHSLColor hue: 120 saturation: 100 percent lightness: 50 percent.

self assert: color asJavascript equals: '"hsl(120,100%,50%)"'
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"class" : {
},
"instance" : {
"testJavascriptOn" : "JulianMaestri 4/1/2017 12:05" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
"name" : "CssHSLColorTest" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*RenoirSt-Seaside-Tests
testJavascriptOn

| color |

color := (CssRGBColor red: 255 green: 0 blue: 0 alpha: 0.5).

self assert: color asJavascript equals: '"rgba(255,0,0,0.5)"'
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"class" : {
},
"instance" : {
"testJavascriptOn" : "JulianMaestri 4/1/2017 12:05" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
"name" : "CssRGBColorTest" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*RenoirSt-Seaside
javascriptOn: aStream

aStream nextPut: $".
self cssContentOn: aStream.
aStream nextPut: $"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"class" : {
},
"instance" : {
"javascriptOn:" : "JulianMaestri 4/1/2017 12:01" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
"name" : "CssColorUnit" }
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Tests
testBasicConstantws
testBasicConstants

self
assert: CssConstants auto equals: 'auto';
Expand All @@ -9,4 +9,5 @@ testBasicConstantws
assert: CssConstants none equals: 'none';
assert: CssConstants odd equals: 'odd';
assert: CssConstants show equals: 'show';
assert: CssConstants vertical equals: 'vertical'
assert: CssConstants vertical equals: 'vertical';
assert: CssConstants initial equals: 'initial'
4 changes: 4 additions & 0 deletions source/RenoirSt.package/CssConstants.class/class/initial.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Accessing
initial

^'initial'

0 comments on commit 6486dd9

Please sign in to comment.