@symbo.ls/scratch 0.3.24 → 0.3.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/factory.js +1 -1
- package/src/index.js +0 -4
- package/src/set.js +1 -1
- package/src/system/color.js +1 -1
- package/src/system/font.js +1 -1
- package/src/system/theme.js +1 -1
- package/src/utils/font.js +10 -5
- package/src/utils/sequence.js +5 -1
package/package.json
CHANGED
package/src/factory.js
CHANGED
package/src/index.js
CHANGED
package/src/set.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
import { applyDocument, applySpacingSequence, applyTimingSequence, applyTypographySequence } from './config'
|
|
4
|
-
import CONFIG,
|
|
4
|
+
import { CONFIG, CSS_VARS } from './factory'
|
|
5
5
|
import { applyReset } from './reset'
|
|
6
6
|
import { setColor, setGradient, setFont, setFontFamily, setTheme } from './system'
|
|
7
7
|
import {
|
package/src/system/color.js
CHANGED
package/src/system/font.js
CHANGED
package/src/system/theme.js
CHANGED
package/src/utils/font.js
CHANGED
|
@@ -9,6 +9,8 @@ export const getDefaultOrFirstKey = (LIBRARY, key) => {
|
|
|
9
9
|
|
|
10
10
|
export const getFontFormat = url => url.split(/[#?]/)[0].split('.').pop().trim()
|
|
11
11
|
|
|
12
|
+
export const setInCustomFontMedia = str => `@font-face { ${str} }`
|
|
13
|
+
|
|
12
14
|
export const setCustomFont = (name, weight, url) => `
|
|
13
15
|
font-family: '${name}';
|
|
14
16
|
font-style: normal;
|
|
@@ -28,13 +30,16 @@ export const getFontFaceEach = (name, weightsObject) => {
|
|
|
28
30
|
})
|
|
29
31
|
}
|
|
30
32
|
|
|
31
|
-
export const getFontFaceEachString = (name, weightsObject) => {
|
|
32
|
-
return getFontFaceEach(name, weightsObject).join('\n')
|
|
33
|
-
}
|
|
34
|
-
|
|
35
33
|
export const getFontFace = LIBRARY => {
|
|
36
34
|
const keys = Object.keys(LIBRARY)
|
|
37
35
|
return keys.map(key => getFontFaceEach(key, LIBRARY[key].value))
|
|
38
36
|
}
|
|
39
37
|
|
|
40
|
-
export const
|
|
38
|
+
export const getFontFaceEachString = (name, weightsObject) => {
|
|
39
|
+
return getFontFaceEach(name, weightsObject).map(setInCustomFontMedia)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const getFontFaceString = LIBRARY => {
|
|
43
|
+
const keys = Object.keys(LIBRARY)
|
|
44
|
+
return keys.map(key => getFontFaceEachString(key, LIBRARY[key].value))
|
|
45
|
+
}
|
package/src/utils/sequence.js
CHANGED