@symbo.ls/scratch 0.7.14 → 0.7.16

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 CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@symbo.ls/scratch",
3
3
  "description": "Φ / CSS framework and methodology.",
4
4
  "author": "symbo.ls",
5
- "version": "0.7.14",
5
+ "version": "0.7.16",
6
6
  "files": [
7
7
  "src"
8
8
  ],
@@ -41,7 +41,7 @@ export const getTheme = (value, modifier) => {
41
41
  if (!subtheme && !modifier) return getThemeValue(isOurTheme)
42
42
  value = [theme, subtheme || modifier]
43
43
  }
44
- } // else value = [value, modifier]
44
+ }
45
45
 
46
46
  if (isObjectLike(value) && value[1]) {
47
47
  const themeName = value[0]
@@ -52,8 +52,6 @@ export const getTheme = (value, modifier) => {
52
52
  if (helpers && helpers[subThemeName]) return getThemeValue(helpers[subThemeName])
53
53
  if (state && state[subThemeName]) return getThemeValue(state[subThemeName])
54
54
  } else if (isObject(value)) return setThemeValue(value)
55
-
56
- // if (CONFIG.verbose) console.warn('Can\'t find theme', value)
57
55
  }
58
56
 
59
57
  const setInverseTheme = (theme, variant, value) => {
@@ -221,7 +219,7 @@ const checkForReference = (val, callback) => {
221
219
 
222
220
  const checkThemeReference = (val) => checkForReference(val, checkThemeReference) // eslint-disable-line
223
221
 
224
- export const getMediaTheme = (val, mod, themeObj) => {
222
+ export const getMediaTheme = (val, mod) => {
225
223
  if (isString(val) && val.slice(0, 2) === '--') val = getMediaTheme(val.slice(2))
226
224
 
227
225
  if (!val || !isString(val)) {
@@ -70,7 +70,7 @@ export const hexToRgba = (hex, alpha = 1) => {
70
70
  export const mixTwoRgb = (colorA, colorB, range = 0.5) => {
71
71
  const arr = []
72
72
  for (let i = 0; i < 3; i++) {
73
- arr[i] = Math.round(
73
+ arr[i] = ~~(
74
74
  colorA[i] + (
75
75
  (colorB[i] - colorA[i]) * range
76
76
  )
@@ -38,8 +38,8 @@ const setSequenceValue = (props, sequenceProps) => {
38
38
  const { key, variable, value, scaling, index } = props
39
39
  sequenceProps.sequence[key] = {
40
40
  key,
41
- decimal: Math.round(value * 100) / 100,
42
- val: Math.round(value),
41
+ decimal: ~~(value * 100) / 100,
42
+ val: ~~(value),
43
43
  scaling,
44
44
  index,
45
45
  variable
@@ -55,8 +55,8 @@ export const generateSubSequence = (props, sequenceProps) => {
55
55
  const diff = next - value
56
56
  const smallscale = diff / 1.618
57
57
 
58
- const valueRounded = Math.round(value)
59
- const nextRounded = Math.round(next)
58
+ const valueRounded = ~~(value)
59
+ const nextRounded = ~~(next)
60
60
  const diffRounded = nextRounded - valueRounded
61
61
 
62
62
  let arr = []
@@ -67,7 +67,7 @@ export const generateSubSequence = (props, sequenceProps) => {
67
67
  else arr = [first, second]
68
68
 
69
69
  arr.map((v, k) => {
70
- const scaling = Math.round(v / base * 1000) / 1000
70
+ const scaling = ~~(v / base * 1000) / 1000
71
71
  const newVar = variable + (k + 1)
72
72
 
73
73
  const props = {
@@ -91,7 +91,7 @@ export const generateSequence = (sequenceProps) => {
91
91
  const key = range[1] - i
92
92
  const letterKey = numToLetterMap[key]
93
93
  const value = base * Math.pow(ratio, key)
94
- const scaling = Math.round(value / base * 1000) / 1000
94
+ const scaling = ~~(value / base * 1000) / 1000
95
95
  const variable = prefix + letterKey
96
96
 
97
97
  const props = {