css-in-props 3.1.1 → 3.1.2
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/dist/cjs/props/flex.js +0 -6
- package/package.json +6 -6
- package/src/props/flex.js +11 -7
package/dist/cjs/props/flex.js
CHANGED
|
@@ -25,8 +25,6 @@ var import_utils = require("@domql/utils");
|
|
|
25
25
|
const FLEX_PROPS = {
|
|
26
26
|
flow: (value, el) => {
|
|
27
27
|
const { props } = el;
|
|
28
|
-
const DISPLAY_FLEX_ALLOWED = ["flex", "inline-flex"];
|
|
29
|
-
if (!DISPLAY_FLEX_ALLOWED.includes(props.display)) return;
|
|
30
28
|
const { reverse } = props;
|
|
31
29
|
if (!(0, import_utils.isString)(value)) return;
|
|
32
30
|
let [direction, wrap] = (value || "row").split(" ");
|
|
@@ -37,13 +35,9 @@ const FLEX_PROPS = {
|
|
|
37
35
|
};
|
|
38
36
|
},
|
|
39
37
|
wrap: (value, { props }) => {
|
|
40
|
-
const DISPLAY_FLEX_ALLOWED = ["flex", "inline-flex"];
|
|
41
|
-
if (!DISPLAY_FLEX_ALLOWED.includes(props.display)) return;
|
|
42
38
|
return { flexWrap: value };
|
|
43
39
|
},
|
|
44
40
|
align: (value, { props }) => {
|
|
45
|
-
const DISPLAY_FLEX_ALLOWED = ["flex", "inline-flex"];
|
|
46
|
-
if (!DISPLAY_FLEX_ALLOWED.includes(props.display)) return;
|
|
47
41
|
const [alignItems, justifyContent] = value.split(" ");
|
|
48
42
|
return { alignItems, justifyContent };
|
|
49
43
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "css-in-props",
|
|
3
3
|
"description": "Utilize props as CSS methods",
|
|
4
4
|
"author": "symbo.ls",
|
|
5
|
-
"version": "3.1.
|
|
5
|
+
"version": "3.1.2",
|
|
6
6
|
"repository": "https://github.com/symbo-ls/smbls",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"module": "src/index.js",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"dist"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@domql/utils": "^3.1.
|
|
29
|
-
"@symbo.ls/atoms": "^3.1.
|
|
30
|
-
"@symbo.ls/emotion": "^3.1.
|
|
31
|
-
"@symbo.ls/scratch": "^3.1.
|
|
28
|
+
"@domql/utils": "^3.1.2",
|
|
29
|
+
"@symbo.ls/atoms": "^3.1.2",
|
|
30
|
+
"@symbo.ls/emotion": "^3.1.2",
|
|
31
|
+
"@symbo.ls/scratch": "^3.1.2"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "429b36616aa04c8587a26ce3c129815115e35897"
|
|
34
34
|
}
|
package/src/props/flex.js
CHANGED
|
@@ -5,27 +5,31 @@ import { isString } from '@domql/utils'
|
|
|
5
5
|
export const FLEX_PROPS = {
|
|
6
6
|
flow: (value, el) => {
|
|
7
7
|
const { props } = el
|
|
8
|
-
const DISPLAY_FLEX_ALLOWED = ['flex', 'inline-flex']
|
|
9
|
-
if (!DISPLAY_FLEX_ALLOWED.includes(props.display)) return
|
|
8
|
+
// const DISPLAY_FLEX_ALLOWED = ['flex', 'inline-flex']
|
|
9
|
+
// if (!DISPLAY_FLEX_ALLOWED.includes(props.display)) return
|
|
10
10
|
const { reverse } = props
|
|
11
11
|
if (!isString(value)) return
|
|
12
12
|
let [direction, wrap] = (value || 'row').split(' ')
|
|
13
13
|
if (value.startsWith('x') || value === 'row') direction = 'row'
|
|
14
14
|
if (value.startsWith('y') || value === 'column') direction = 'column'
|
|
15
15
|
return {
|
|
16
|
-
flexFlow:
|
|
16
|
+
flexFlow:
|
|
17
|
+
(direction || '') +
|
|
18
|
+
(!direction.includes('-reverse') && reverse ? '-reverse' : '') +
|
|
19
|
+
' ' +
|
|
20
|
+
(wrap || '')
|
|
17
21
|
}
|
|
18
22
|
},
|
|
19
23
|
|
|
20
24
|
wrap: (value, { props }) => {
|
|
21
|
-
const DISPLAY_FLEX_ALLOWED = ['flex', 'inline-flex']
|
|
22
|
-
if (!DISPLAY_FLEX_ALLOWED.includes(props.display)) return
|
|
25
|
+
// const DISPLAY_FLEX_ALLOWED = ['flex', 'inline-flex']
|
|
26
|
+
// if (!DISPLAY_FLEX_ALLOWED.includes(props.display)) return
|
|
23
27
|
return { flexWrap: value }
|
|
24
28
|
},
|
|
25
29
|
|
|
26
30
|
align: (value, { props }) => {
|
|
27
|
-
const DISPLAY_FLEX_ALLOWED = ['flex', 'inline-flex']
|
|
28
|
-
if (!DISPLAY_FLEX_ALLOWED.includes(props.display)) return
|
|
31
|
+
// const DISPLAY_FLEX_ALLOWED = ['flex', 'inline-flex']
|
|
32
|
+
// if (!DISPLAY_FLEX_ALLOWED.includes(props.display)) return
|
|
29
33
|
const [alignItems, justifyContent] = value.split(' ')
|
|
30
34
|
return { alignItems, justifyContent }
|
|
31
35
|
}
|