Skip to content

Commit

Permalink
use new attribute shape in mvl
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed May 19, 2019
1 parent af9c57d commit f17f8c8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
9 changes: 5 additions & 4 deletions packages/moon-mvl/dist/moon-mvl.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,12 @@ function addClass(element, name) {
var className = elementAttributes["class"];

if (className === undefined) {
elementAttributes["class"] = "\"" + name + "\"";
} else if (className[0] === "\"" || className[0] === "'") {
elementAttributes["class"] = "" + className[0] + name + " " + className.slice(1);
elementAttributes["class"] = {
value: "\"" + name + "\"",
isStatic: true
};
} else {
elementAttributes["class"] += " + \" " + name + "\"";
elementAttributes["class"].value += " + \" " + name + "\"";
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/moon-mvl/dist/moon-mvl.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions packages/moon-mvl/src/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ export function addClass(element, name) {
const className = elementAttributes.class;

if (className === undefined) {
elementAttributes.class = `"${name}"`;
} else if (className[0] === "\"" || className[0] === "'") {
elementAttributes.class = `${className[0]}${name} ${className.slice(1)}`;
elementAttributes.class = {
value: `"${name}"`,
isStatic: true
};
} else {
elementAttributes.class += ` + " ${name}"`;
elementAttributes.class.value += ` + " ${name}"`;
}
}

Expand Down

0 comments on commit f17f8c8

Please sign in to comment.