forked from cadence/Carbon
Fix all relative paths in built output
This commit is contained in:
parent
25c3fe17b4
commit
ad86c3b064
2 changed files with 3 additions and 3 deletions
4
build.js
4
build.js
|
@ -154,11 +154,11 @@ async function addSass(sourcePath, targetPath) {
|
||||||
indentType: "tab",
|
indentType: "tab",
|
||||||
indentWidth: 1,
|
indentWidth: 1,
|
||||||
functions: {
|
functions: {
|
||||||
"static($name)": function(name) {
|
"relative($name)": function(name) {
|
||||||
if (!(name instanceof sass.types.String)) {
|
if (!(name instanceof sass.types.String)) {
|
||||||
throw "$name: expected a string"
|
throw "$name: expected a string"
|
||||||
}
|
}
|
||||||
const result = static.get(name.getValue())
|
const result = getRelative(targetPath, static.get(name.getValue()))
|
||||||
if (typeof result === "string") {
|
if (typeof result === "string") {
|
||||||
return new sass.types.String(result)
|
return new sass.types.String(result)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
@font-face
|
@font-face
|
||||||
font-family: Whitney
|
font-family: Whitney
|
||||||
font-weight: $weight
|
font-weight: $weight
|
||||||
src: url(static("/assets/fonts/whitney-" + $weight + ".woff")) format("woff2")
|
src: url(relative("/assets/fonts/whitney-" + $weight + ".woff")) format("woff2")
|
||||||
|
|
||||||
+import-whitney(400)
|
+import-whitney(400)
|
||||||
+import-whitney(500)
|
+import-whitney(500)
|
||||||
|
|
Loading…
Reference in a new issue