@symbo.ls/scratch 0.7.6 → 0.7.8

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.6",
5
+ "version": "0.7.8",
6
6
  "files": [
7
7
  "src"
8
8
  ],
@@ -149,6 +149,12 @@ export const getSequenceValue = (value = 'A', sequenceProps) => {
149
149
  absValue = absValue.split('-')[0]
150
150
  }
151
151
 
152
+ // if subsequence is not set but value is applied
153
+ if (!sequence[absValue] && absValue.length === 2) {
154
+ if (CONFIG.verbose) console.warn(absValue, '- value is not found because `subSequence` is set to false')
155
+ absValue = absValue.slice(0, 1)
156
+ }
157
+
152
158
  if (useVariable || CONFIG.useVariable) {
153
159
  const varValue = `var(${prefix}${absValue}${mediaName})`
154
160
  return isNegative ? `calc(${varValue} * -1)` : varValue
@@ -173,10 +179,12 @@ export const getSequenceValuePropertyPair = (value, propertyName, sequenceProps)
173
179
  return { [propertyName]: getSequenceValue(value, sequenceProps) }
174
180
  }
175
181
 
182
+ export const findHeadingLetter = (h1Matches, index) => numToLetterMap[h1Matches - index]
183
+
176
184
  export const findHeadings = propertyNames => {
177
185
  const { h1Matches, sequence } = propertyNames
178
186
  return new Array(6).fill(null).map((_, i) => {
179
- const findLetter = numToLetterMap[h1Matches - i]
187
+ const findLetter = findHeadingLetter(h1Matches, i)
180
188
  return sequence[findLetter]
181
189
  })
182
190
  }