Comparing version 0.7.0-beta8 to 0.7.0-beta9
{ | ||
"version": "11.1.0", | ||
"version": "11.2.0", | ||
"summary": "CSS Preprocessor for Elm", | ||
@@ -19,2 +19,3 @@ "repository": "https://github.com/rtfeldman/elm-css.git", | ||
"elm-lang/core": "5.0.0 <= v < 6.0.0", | ||
"elm-lang/virtual-dom": "2.0.0 <= v < 3.0.0", | ||
"rtfeldman/elm-css-util": "1.0.2 <= v < 2.0.0", | ||
@@ -21,0 +22,0 @@ "rtfeldman/hex": "1.0.0 <= v < 2.0.0" |
@@ -80,3 +80,3 @@ //@flow | ||
return findExposedValues( | ||
["Css.File.UniqueClass", "Css.Snippet"], | ||
["Css.File.UniqueClass", "Css.File.UniqueSvgClass", "Css.Snippet"], | ||
readElmiPath, | ||
@@ -83,0 +83,0 @@ generatedDir, |
@@ -26,3 +26,3 @@ //@flow | ||
warn: true, | ||
processOpts: { stdio: ["ignore", "ignore", "pipe"] } | ||
processOpts: { stdio: ["ignore", "ignore", "inherit"] } | ||
}); | ||
@@ -29,0 +29,0 @@ |
@@ -214,9 +214,9 @@ //@flow | ||
pathAndModule.name + | ||
"` is a module with top-level Test values which it does not expose:\n\n" + | ||
"` is a module with top-level CSS-related values which it does not expose:\n\n" + | ||
_.difference(pathAndModule.values, newValues) | ||
.map(function(test) { | ||
return test + " : Test"; | ||
return test; | ||
}) | ||
.join("\n") + | ||
"\n\nThese tests will not get run. Please either expose them or move them out of the top level." | ||
"\n\nThese will not be used by `elm-css`. Please either expose them or move them out of the top level." | ||
); | ||
@@ -223,0 +223,0 @@ } else { |
@@ -22,3 +22,11 @@ // @flow | ||
function declarationForValue(moduleName /*: string*/, valueName /*: string */) { | ||
function declarationForValue( | ||
moduleName /*: string*/, | ||
valueName /*: string */, | ||
isSvg /*: boolean */ | ||
) { | ||
const functionCall = isSvg | ||
? 'Html.attribute "class"' | ||
: "Html.Attributes.class"; | ||
return ( | ||
@@ -28,3 +36,5 @@ valueName + | ||
valueName + | ||
' =\n Html.Attributes.class "' + | ||
" =\n " + | ||
functionCall + | ||
' "' + | ||
classNameForValue(moduleName, valueName) + | ||
@@ -35,9 +45,20 @@ '"' | ||
function isUniqueSvgClass(signature) { | ||
return signature === "Css.File.UniqueSvgClass"; | ||
} | ||
function declarationsForModule(modul /*: ModuleDeclaration */) { | ||
return modul.values | ||
.filter(function(value) { | ||
return value.signature === "Css.File.UniqueClass"; | ||
return ( | ||
value.signature === "Css.File.UniqueClass" || | ||
isUniqueSvgClass(value.signature) | ||
); | ||
}) | ||
.map(function(value) { | ||
return declarationForValue(modul.name, value.name); | ||
return declarationForValue( | ||
modul.name, | ||
value.name, | ||
isUniqueSvgClass(value.signature) | ||
); | ||
}); | ||
@@ -44,0 +65,0 @@ } |
@@ -60,3 +60,3 @@ //@flow | ||
" }\n\n\n" + | ||
"classToSnippet : String -> Css.File.UniqueClass -> Css.Snippet\n" + | ||
"classToSnippet : String -> a -> Css.Snippet\n" + | ||
"classToSnippet str class =\n" + | ||
@@ -78,2 +78,3 @@ " classToSnippet str class\n\n\n" + // This is just to make type-checking pass. We'll splice in a useful implementation after emitting. | ||
case "Css.File.UniqueClass": | ||
case "Css.File.UniqueSvgClass": | ||
const className = classNameForValue(modul.name, value.name); | ||
@@ -80,0 +81,0 @@ |
{ | ||
"name": "elm-css", | ||
"version": "0.7.0-beta8", | ||
"version": "0.7.0-beta9", | ||
"description": "Elm-based CSS Preprocessor", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
4150934
77
1095