@symbo.ls/scratch 2.11.430 → 2.11.439

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": "2.11.430",
5
+ "version": "2.11.439",
6
6
  "files": [
7
7
  "src",
8
8
  "dist"
@@ -30,5 +30,5 @@
30
30
  "@symbo.ls/utils": "latest",
31
31
  "color-contrast-checker": "^1.5.0"
32
32
  },
33
- "gitHead": "340f3f6f7aa8ebd812340008730e4490a607be19"
33
+ "gitHead": "b16ac3edce7fceb5e81d7cc7bbad51256e10b166"
34
34
  }
@@ -73,7 +73,7 @@ export const getMediaColor = (value, globalTheme, config) => {
73
73
  const obj = {}
74
74
  for (const mediaName in val) {
75
75
  const query = CONFIG.MEDIA[mediaName.slice(1)]
76
- const media = `@media screen and ${query}`
76
+ const media = '@media ' + (query === 'print' ? `${query}` : `screen and ${query}`)
77
77
  obj[media] = getColor(value, mediaName, config)
78
78
  }
79
79
  return obj
@@ -88,7 +88,7 @@ export const getShadow = (value, globalTheme) => {
88
88
  const obj = {}
89
89
  for (const mediaName in val) {
90
90
  const query = CONFIG.MEDIA[mediaName.slice(1)]
91
- const media = `@media screen and ${query}`
91
+ const media = '@media ' + (query === 'print' ? `${query}` : `screen and ${query}`)
92
92
  obj[media] = val.value
93
93
  }
94
94
  return obj
@@ -192,7 +192,7 @@ const recursiveTheme = val => {
192
192
  if (isObjectLike(val[param])) {
193
193
  if (symb === '@') {
194
194
  const query = CONFIG.MEDIA[param.slice(1)]
195
- const media = `@media screen and ${query}`
195
+ const media = '@media ' + (query === 'print' ? `${query}` : `screen and ${query}`)
196
196
  obj[media] = recursiveTheme(val[param])
197
197
  } else if (symb === ':') {
198
198
  obj[`&${param}`] = recursiveTheme(val[param])
@@ -44,7 +44,8 @@ export const runThroughMedia = FACTORY => {
44
44
  })
45
45
 
46
46
  const query = MEDIA[mediaName]
47
- TYPOGRAPHY.templates[`@media screen and ${query}`] = {
47
+ const media = '@media ' + (query === 'print' ? `${query}` : `screen and ${query}`)
48
+ TYPOGRAPHY.templates[media] = {
48
49
  fontSize: mediaValue.base / TYPOGRAPHY.browserDefault + unit
49
50
  }
50
51
 
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- import { isNull, isString, isUndefined } from '@domql/utils'
3
+ import { isNull, isString, isObject, isUndefined } from '@domql/utils'
4
4
  import { getActiveConfig } from '../factory'
5
5
  import {
6
6
  getSpacingByKey,
@@ -49,11 +49,15 @@ export const transformTextStroke = stroke => {
49
49
 
50
50
  export const transformShadow = (sh, globalTheme) => getShadow(sh, globalTheme)
51
51
 
52
- export const transformBoxShadow = shadows => shadows.split('|').map(shadow => {
53
- return shadow.split(', ').map(v => {
52
+ export const transformBoxShadow = (shadows, globalTheme) => shadows.split('|').map(shadow => {
53
+ return shadow.split(',').map(v => {
54
54
  v = v.trim()
55
55
  if (v.slice(0, 2) === '--') return `var(${v})`
56
- if (getColor(v).length > 2) return getColor(v)
56
+ if (getColor(v).length > 2) {
57
+ const color = getMediaColor(v, globalTheme)
58
+ if (isObject(color)) return Object.values(color).filter(v => v.includes(': ' + globalTheme))[0]
59
+ return color
60
+ }
57
61
  if (v.includes('px') || v.slice(-2) === 'em') return v
58
62
  const arr = v.split(' ')
59
63
  if (!arr.length) return v