@symbo.ls/scratch 0.7.26 → 0.7.28

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/system/reset.js +67 -47
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.26",
5
+ "version": "0.7.28",
6
6
  "files": [
7
7
  "src"
8
8
  ],
@@ -3,54 +3,74 @@
3
3
  import * as CONFIG from '../defaultConfig'
4
4
  import { CSS_VARS } from '../factory'
5
5
  import { getTheme } from '.'
6
- import { deepMerge, merge } from '../utils'
6
+ import { deepMerge, merge, overwriteDeep } from '@domql/utils' // eslint-disable-line no-unused-vars
7
7
 
8
8
  export const applyReset = (reset = {}) => {
9
- return deepMerge(merge(CONFIG.RESET, reset), {
10
- ':root': CSS_VARS,
11
-
12
- html: {
13
- position: 'absolute',
14
- overflow: 'hidden',
15
- width: '100%',
16
- height: '100%',
17
- top: '0',
18
- left: '0',
19
- margin: '0',
20
- WebkitFontSmoothing: 'antialiased',
21
- transform: 'translate3d(0, 0, 1px)',
22
- scrollBehavior: 'smooth',
23
-
24
- fontSize: CONFIG.TYPOGRAPHY.browserDefault + 'px',
25
-
26
- fontFamily: CONFIG.DOCUMENT.fontFamily,
27
- lineHeight: CONFIG.DOCUMENT.lineHeight
28
- },
29
-
30
- ...CONFIG.TYPOGRAPHY.styles,
31
-
32
- body: {
33
- boxSizing: 'border-box',
34
- height: '100%',
35
- margin: 0,
36
- fontFamily: CONFIG.DOCUMENT.fontFamily,
37
-
38
- ...getTheme('document'),
39
-
40
- fontSize: CONFIG.TYPOGRAPHY.base / CONFIG.TYPOGRAPHY.browserDefault + CONFIG.UNIT.default,
41
-
42
- ...CONFIG.TYPOGRAPHY.styles.body
43
- },
44
-
45
- // form elements
46
- fieldset: {
47
- border: 0,
48
- padding: 0,
49
- margin: 0
50
- },
51
-
52
- 'select, input': {
53
- fontFamily: CONFIG.DOCUMENT.fontFamily
9
+ if (CONFIG.RESET) {
10
+ // if (CONFIG.RESET[':root']) {
11
+ // overwriteDeep(CONFIG.TYPOGRAPHY.styles, CONFIG.RESET)
12
+ // console.log(CONFIG.RESET)
13
+ // CONFIG.RESET[':root'] = CSS_VARS
14
+ // }
15
+ if (CONFIG.RESET[':root']) {
16
+ const configReset = CONFIG.RESET
17
+ const configStyles = CONFIG.TYPOGRAPHY.styles
18
+ configReset[':root'] = CSS_VARS
19
+ configReset.body = configStyles.body
20
+ configReset.h1 = configStyles.h1
21
+ configReset.h2 = configStyles.h2
22
+ configReset.h3 = configStyles.h3
23
+ configReset.h4 = configStyles.h4
24
+ configReset.h5 = configStyles.h5
25
+ configReset.h6 = configStyles.h6
54
26
  }
55
- })
27
+
28
+ return deepMerge(merge(CONFIG.RESET, reset), {
29
+ ':root': CSS_VARS,
30
+
31
+ html: {
32
+ position: 'absolute',
33
+ overflow: 'hidden',
34
+ width: '100%',
35
+ height: '100%',
36
+ top: '0',
37
+ left: '0',
38
+ margin: '0',
39
+ WebkitFontSmoothing: 'antialiased',
40
+ transform: 'translate3d(0, 0, 1px)',
41
+ scrollBehavior: 'smooth',
42
+
43
+ fontSize: CONFIG.TYPOGRAPHY.browserDefault + 'px',
44
+
45
+ fontFamily: CONFIG.DOCUMENT.fontFamily,
46
+ lineHeight: CONFIG.DOCUMENT.lineHeight
47
+ },
48
+
49
+ ...CONFIG.TYPOGRAPHY.styles,
50
+
51
+ body: {
52
+ boxSizing: 'border-box',
53
+ height: '100%',
54
+ margin: 0,
55
+ fontFamily: CONFIG.DOCUMENT.fontFamily,
56
+
57
+ ...getTheme('document'),
58
+
59
+ fontSize: CONFIG.TYPOGRAPHY.base / CONFIG.TYPOGRAPHY.browserDefault + CONFIG.UNIT.default,
60
+
61
+ ...CONFIG.TYPOGRAPHY.styles.body
62
+ },
63
+
64
+ // form elements
65
+ fieldset: {
66
+ border: 0,
67
+ padding: 0,
68
+ margin: 0
69
+ },
70
+
71
+ 'select, input': {
72
+ fontFamily: CONFIG.DOCUMENT.fontFamily
73
+ }
74
+ })
75
+ }
56
76
  }