@symbo.ls/scratch 0.3.23 → 0.3.26
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/README.md +0 -1
- package/package.json +1 -1
- package/src/utils/font.js +10 -5
- package/src/utils/sequence.js +5 -1
package/README.md
CHANGED
|
@@ -4,6 +4,5 @@ Scratch is CSS framework and methodology to build web, mobile and TV application
|
|
|
4
4
|
[](https://badge.fury.io/js/%40rackai%2Fscratch)
|
|
5
5
|
|
|
6
6
|
### TODO:
|
|
7
|
-
- [ ] Generate CSS variables
|
|
8
7
|
- [ ] Accessibility (WCAG) automated tests
|
|
9
8
|
- [ ] Scratch on `node`
|
package/package.json
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