@slimr/css 2.1.11 → 2.1.12

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.
@@ -1,14 +1,98 @@
1
- /** Breakpoints like chakra */
2
- export const breakPoints = ['30em', '48em', '62em', '80em', '96em']
1
+ import {T2SProps, t2s} from '@slimr/util'
3
2
 
4
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
- type allowableAny = any
3
+ import {expandShorthands} from './shorthandProps.js'
6
4
 
7
- /** Joins class names and filters out blanks */
8
- export function classJoin(...classes: allowableAny[]) {
5
+ /**
6
+ * Injects css to the page head
7
+ *
8
+ * - Lazy: Will not be added until the component mounts, if called from within a component
9
+ * - Batches dom changes for better performance
10
+ * - Has local cache to recall prior adds, to reduce duplicates and dom changes
11
+ *
12
+ * @param css - css to be injected
13
+ * @returns void
14
+ */
15
+ export function addCss(css: string) {
16
+ addCss.que.add(css)
17
+ setTimeout(() => {
18
+ const css = [...addCss.que].join('\n')
19
+ if (css) {
20
+ addCss.que.clear()
21
+ const s = document.createElement('style')
22
+ s.id = `u${addCss.count++}`
23
+ s.innerHTML = css
24
+ document.head.appendChild(s)
25
+ }
26
+ }, 0)
27
+ }
28
+ addCss.que = new Set<string>()
29
+ addCss.count = 0
30
+
31
+ /**
32
+ * Joins class names and omits falsey props
33
+ *
34
+ * @param classes - class names to be joined
35
+ * @returns a string of joined class names
36
+ *
37
+ * @example
38
+ * ```typescript
39
+ * classJoin('a', 'b', 'c') // 'a b c'
40
+ * classJoin('a', 0, 'b', null, 'c') // 'a b c'
41
+ * ```
42
+ */
43
+ export function classJoin(...classes: (string | 0 | null | undefined)[]) {
9
44
  return classes.filter(c => c && typeof c === 'string').join(' ')
10
45
  }
11
46
 
47
+ /**
48
+ * Injects css and creates unique class names
49
+ *
50
+ * - Skips if already added
51
+ *
52
+ * @param cssString - string or template string, to be injected
53
+ * @returns a unique class name
54
+ */
55
+ export function createClass(...p: T2SProps) {
56
+ let css = t2s(...p)
57
+ if (!css) return ''
58
+ let className = createClass.history.get(css)
59
+ if (!className) {
60
+ className = 's' + createClass.count++
61
+ createClass.history.set(css, className)
62
+
63
+ css = deleteComments(css)
64
+ css = expandShorthands(css)
65
+ css = expandArrayValues(css)
66
+ const qs = findQueries(css)
67
+
68
+ for (const q of qs.reverse()) {
69
+ css = css.slice(0, q.start) + css.slice(q.end)
70
+ }
71
+
72
+ css = `.${className}{\n${css}\n}\n`
73
+ css += qs
74
+ .map(q => {
75
+ if (q.query.startsWith('&')) {
76
+ return `.${className}${q.query.slice(1)}{\n${q.innerBody}\n}`
77
+ }
78
+ if (q.query.startsWith('@keyframes')) {
79
+ return q.outerBody
80
+ }
81
+ return `${q.query}{\n.${className}{${q.innerBody}\n}\n}`
82
+ })
83
+ .join('\n')
84
+
85
+ css = trimByLine(css) + '\n\n'
86
+
87
+ addCss(css)
88
+ }
89
+ return className
90
+ }
91
+ /** Breakpoints like chakra */
92
+ createClass.breakPoints = ['30em', '48em', '62em', '80em', '96em']
93
+ createClass.count = 0
94
+ createClass.history = new Map<string, string>()
95
+
12
96
  /** delete css comments **/
13
97
  function deleteComments(css: string) {
14
98
  return css.replace(/{\/\*[\s\S]*?(?=\*\/})\*\/}/gm, '')
@@ -35,7 +119,7 @@ function expandArrayValues(css: string) {
35
119
  if (i === 0) {
36
120
  return `${prop}: ${val};`
37
121
  }
38
- return `@media (min-width: ${breakPoints[i - 1]}) { ${prop}: ${val}; }`
122
+ return `@media (min-width: ${createClass.breakPoints[i - 1]}) { ${prop}: ${val}; }`
39
123
  })
40
124
  .join('\n')
41
125
  }
@@ -44,117 +128,6 @@ function expandArrayValues(css: string) {
44
128
  .join('\n')
45
129
  }
46
130
 
47
- export interface ShorthandProps {
48
- /** shorthand for css:align-items */
49
- ai?: string
50
- /** shorthand for css:border */
51
- b?: string | number
52
- /** shorthand for css:border-radius */
53
- br?: string | number
54
- /** shorthand for css:background */
55
- bg?: string
56
- /** shorthand for css:color */
57
- c?: string
58
- /** shorthand for css:display */
59
- d?: string
60
- /** shorthand for css:flex */
61
- f?: string
62
- /** shorthand for css:flex-direction */
63
- fd?: string
64
- /** shorthand for css:height */
65
- h?: number | string
66
- /** shorthand for css:inset */
67
- i?: number | string
68
- /** shorthand for css:justify-content */
69
- jc?: string
70
- /** shorthand for css:margin */
71
- m?: number | string
72
- /** shorthand for css:margin-left */
73
- ml?: number | string
74
- /** shorthand for css:margin-right */
75
- mr?: number | string
76
- /** shorthand for css:margin-top */
77
- mt?: number | string
78
- /** shorthand for css:margin-bottom */
79
- mb?: number | string
80
- /** shorthand for css:margin-top & margin-bottom */
81
- my?: number | string
82
- /** shorthand for css:margin-left & margin-right */
83
- mx?: number | string
84
- /** shorthand for css:max-width */
85
- maxW?: number | string
86
- /** shorthand for css:min-width */
87
- minW?: number | string
88
- /** shorthand for css:padding */
89
- p?: number | string
90
- /** shorthand for css:padding-left */
91
- pl?: number | string
92
- /** shorthand for css:padding-right */
93
- pr?: number | string
94
- /** shorthand for css:padding-top */
95
- pt?: number | string
96
- /** shorthand for css:padding-bottom */
97
- pb?: number | string
98
- /** shorthand for css:padding-top & padding-bottom */
99
- py?: number | string
100
- /** shorthand for css:padding-left & padding-right */
101
- px?: number | string
102
- /** shorthand for css:position */
103
- pos?: number | string
104
- /** shorthand for css:text-align */
105
- ta?: string
106
- /** shorthand for css:width */
107
- w?: number | string
108
- /** shorthand for css:z-index */
109
- z?: number | string
110
- }
111
- export const shorthandPropsMap: Record<
112
- keyof Omit<ShorthandProps, 'mx' | 'my' | 'px' | 'py'>,
113
- string
114
- > = {
115
- ai: 'align-items',
116
- b: 'border',
117
- br: 'border-radius',
118
- bg: 'background',
119
- c: 'color',
120
- d: 'display',
121
- f: 'flex',
122
- fd: 'flex-direction',
123
- i: 'inset',
124
- h: 'height',
125
- jc: 'justify-content',
126
- m: 'margin',
127
- ml: 'margin-left',
128
- mr: 'margin-right',
129
- mt: 'margin-top',
130
- mb: 'margin-bottom',
131
- maxW: 'max-width',
132
- minW: 'min-width',
133
- p: 'padding',
134
- pl: 'padding-left',
135
- pr: 'padding-right',
136
- pt: 'padding-top',
137
- pb: 'padding-bottom',
138
- pos: 'position',
139
- ta: 'text-align',
140
- w: 'width',
141
- z: 'z-index',
142
- }
143
- export const shorthandProps = [...Object.keys(shorthandPropsMap), 'mx', 'my', 'px', 'py']
144
-
145
- /** Expand short-hand css props to full */
146
- function expandProps(css: string) {
147
- css = '\n' + css // inject a newline to make the regex easier
148
- // Handle 'mx', 'my', 'px', 'py'
149
- css = css
150
- .replace(/([mp])x:([^;]*)/g, '$1l:$2;\n$1r:$2')
151
- .replace(/([mp])y:([^;]*);/g, '$1t:$2;\n$1b:$2')
152
- Object.entries(shorthandPropsMap).forEach(([k, v]) => {
153
- css = css.replace(new RegExp(`([ \n\t;])${k}:`, 'g'), `$1${v}:`)
154
- })
155
- return css.trim()
156
- }
157
-
158
131
  /** Find @keyframes, @media, @container queries in css **/
159
132
  function findQueries(css: string) {
160
133
  const queries = []
@@ -189,102 +162,10 @@ function findQueries(css: string) {
189
162
  }
190
163
 
191
164
  /** Trims whitespace for every line */
192
- function trim(css: string) {
165
+ function trimByLine(css: string) {
193
166
  return css
194
167
  .split('\n')
195
168
  .map(l => l.trim())
196
169
  .filter(l => l)
197
170
  .join('\n')
198
171
  }
199
-
200
- /**
201
- * Assemble a string from a template string array and a list of placeholders.
202
- *
203
- * - If the first argument is a string, it is returned as is.
204
- *
205
- * i.e.
206
- * myFoo(...props: TemplateStringProps) => {
207
- * const inputStr = t2s(...props);
208
- * }
209
- * myFoo`hello ${name}` => 'hello world'
210
- * myFoo(`hello ${name}`) => 'hello world'
211
- */
212
- export function t2s(...tsp: TemplateStringProps) {
213
- const [s, ...p] = tsp
214
- return typeof s === 'string' ? s : s.map((s, i) => s + (p?.[i] ?? '')).join('')
215
- }
216
- export type TemplateStringProps = [
217
- strings: TemplateStringsArray | string,
218
- ...placeHolders: string[]
219
- ]
220
-
221
- /**
222
- * Injects css to the page
223
- *
224
- * - Batches adds for performance
225
- *
226
- * @param css - css to be injected
227
- * @returns void
228
- */
229
- export function addCss(css: string) {
230
- addCss.que.add(css)
231
- setTimeout(() => {
232
- const css = [...addCss.que].join('\n')
233
- if (css) {
234
- addCss.que.clear()
235
- const s = document.createElement('style')
236
- s.id = `u${addCss.count++}`
237
- s.innerHTML = css
238
- document.head.appendChild(s)
239
- }
240
- }, 0)
241
- }
242
- addCss.que = new Set<string>()
243
- addCss.count = 0
244
-
245
- /**
246
- * Injects css and creates unique class names
247
- *
248
- * - Skips if already added
249
- *
250
- * @param css - string or template string, to be injected
251
- * @returns a unique class name
252
- */
253
- export function createClass(...p: TemplateStringProps) {
254
- let css = t2s(...p)
255
- if (!css) return ''
256
- let className = createClass.history.get(css)
257
- if (!className) {
258
- className = 's' + createClass.count++
259
- createClass.history.set(css, className)
260
-
261
- css = deleteComments(css)
262
- css = expandProps(css)
263
- css = expandArrayValues(css)
264
- const qs = findQueries(css)
265
-
266
- for (const q of qs.reverse()) {
267
- css = css.slice(0, q.start) + css.slice(q.end)
268
- }
269
-
270
- css = `.${className}{\n${css}\n}\n`
271
- css += qs
272
- .map(q => {
273
- if (q.query.startsWith('&')) {
274
- return `.${className}${q.query.slice(1)}{\n${q.innerBody}\n}`
275
- }
276
- if (q.query.startsWith('@keyframes')) {
277
- return q.outerBody
278
- }
279
- return `${q.query}{\n.${className}{${q.innerBody}\n}\n}`
280
- })
281
- .join('\n')
282
-
283
- css = trim(css) + '\n\n'
284
-
285
- addCss(css)
286
- }
287
- return className
288
- }
289
- createClass.count = 0
290
- createClass.history = new Map<string, string>()
package/src/index.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './createClass.js'
2
+ export * from './shorthandProps.js'
2
3
  export {createClass as css} from './createClass.js'
@@ -0,0 +1,118 @@
1
+ /**
2
+ * All the shorthand props that can be used in the css prop
3
+ */
4
+ export interface ShorthandProps {
5
+ /** shorthand for css:align-items */
6
+ ai?: string
7
+ /** shorthand for css:border */
8
+ b?: string | number
9
+ /** shorthand for css:border-radius */
10
+ br?: string | number
11
+ /** shorthand for css:background */
12
+ bg?: string
13
+ /** shorthand for css:color */
14
+ c?: string
15
+ /** shorthand for css:display */
16
+ d?: string
17
+ /** shorthand for css:flex */
18
+ f?: string
19
+ /** shorthand for css:flex-direction */
20
+ fd?: string
21
+ /** shorthand for css:height */
22
+ h?: number | string
23
+ /** shorthand for css:inset */
24
+ i?: number | string
25
+ /** shorthand for css:justify-content */
26
+ jc?: string
27
+ /** shorthand for css:margin */
28
+ m?: number | string
29
+ /** shorthand for css:margin-left */
30
+ ml?: number | string
31
+ /** shorthand for css:margin-right */
32
+ mr?: number | string
33
+ /** shorthand for css:margin-top */
34
+ mt?: number | string
35
+ /** shorthand for css:margin-bottom */
36
+ mb?: number | string
37
+ /** shorthand for css:margin-top & margin-bottom */
38
+ my?: number | string
39
+ /** shorthand for css:margin-left & margin-right */
40
+ mx?: number | string
41
+ /** shorthand for css:max-width */
42
+ maxW?: number | string
43
+ /** shorthand for css:min-width */
44
+ minW?: number | string
45
+ /** shorthand for css:padding */
46
+ p?: number | string
47
+ /** shorthand for css:padding-left */
48
+ pl?: number | string
49
+ /** shorthand for css:padding-right */
50
+ pr?: number | string
51
+ /** shorthand for css:padding-top */
52
+ pt?: number | string
53
+ /** shorthand for css:padding-bottom */
54
+ pb?: number | string
55
+ /** shorthand for css:padding-top & padding-bottom */
56
+ py?: number | string
57
+ /** shorthand for css:padding-left & padding-right */
58
+ px?: number | string
59
+ /** shorthand for css:position */
60
+ pos?: number | string
61
+ /** shorthand for css:text-align */
62
+ ta?: string
63
+ /** shorthand for css:width */
64
+ w?: number | string
65
+ /** shorthand for css:z-index */
66
+ z?: number | string
67
+ }
68
+
69
+ /**
70
+ * Expand short-hand css props to full
71
+ */
72
+ export function expandShorthands(css: string) {
73
+ css = '\n' + css // inject a newline to make the regex easier
74
+ // Handle 'mx', 'my', 'px', 'py'
75
+ css = css
76
+ .replace(/([mp])x:([^;]*)/g, '$1l:$2;\n$1r:$2')
77
+ .replace(/([mp])y:([^;]*);/g, '$1t:$2;\n$1b:$2')
78
+ Object.entries(shorthandPropsMap).forEach(([k, v]) => {
79
+ css = css.replace(new RegExp(`([ \n\t;])${k}:`, 'g'), `$1${v}:`)
80
+ })
81
+ return css.trim()
82
+ }
83
+
84
+ /**
85
+ * Map shorthand props to their full css prop
86
+ */
87
+ export const shorthandPropsMap: Record<
88
+ keyof Omit<ShorthandProps, 'mx' | 'my' | 'px' | 'py'>,
89
+ string
90
+ > = {
91
+ ai: 'align-items',
92
+ b: 'border',
93
+ br: 'border-radius',
94
+ bg: 'background',
95
+ c: 'color',
96
+ d: 'display',
97
+ f: 'flex',
98
+ fd: 'flex-direction',
99
+ i: 'inset',
100
+ h: 'height',
101
+ jc: 'justify-content',
102
+ m: 'margin',
103
+ ml: 'margin-left',
104
+ mr: 'margin-right',
105
+ mt: 'margin-top',
106
+ mb: 'margin-bottom',
107
+ maxW: 'max-width',
108
+ minW: 'min-width',
109
+ p: 'padding',
110
+ pl: 'padding-left',
111
+ pr: 'padding-right',
112
+ pt: 'padding-top',
113
+ pb: 'padding-bottom',
114
+ pos: 'position',
115
+ ta: 'text-align',
116
+ w: 'width',
117
+ z: 'z-index',
118
+ }
package/tsconfig.json CHANGED
@@ -3,5 +3,5 @@
3
3
  "compilerOptions": {
4
4
  "types": ["vite/client"],
5
5
  },
6
- "include": ["src", "index.stories.tsx"]
6
+ "include": ["src", "src/addCss.stories.tsx"]
7
7
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"createClass.js","sourceRoot":"","sources":["../../src/createClass.ts"],"names":[],"mappings":";;;AAAA,8BAA8B;AACjB,QAAA,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;AAKnE,+CAA+C;AAC/C,SAAgB,SAAS,CAAC,GAAG,OAAuB;IAClD,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAA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I,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;gBAC3B,OAAO,IAAI,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,KAAK,CAAA;aAC9D;YACD,IAAI,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE;gBACpC,OAAO,CAAC,CAAC,SAAS,CAAA;aACnB;YACD,OAAO,GAAG,CAAC,CAAC,KAAK,OAAO,SAAS,IAAI,CAAC,CAAC,SAAS,QAAQ,CAAA;QAC1D,CAAC,CAAC;aACD,IAAI,CAAC,IAAI,CAAC,CAAA;QAEb,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAA;QAExB,MAAM,CAAC,GAAG,CAAC,CAAA;KACZ;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAnCD,kCAmCC;AACD,WAAW,CAAC,KAAK,GAAG,CAAC,CAAA;AACrB,WAAW,CAAC,OAAO,GAAG,IAAI,GAAG,EAAkB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mDAAgC;AAChC,mDAAmD;AAA3C,qGAAA,WAAW,OAAO"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"createClass.js","sourceRoot":"","sources":["../../src/createClass.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;AAKnE,+CAA+C;AAC/C,MAAM,UAAU,SAAS,CAAC,GAAG,OAAuB;IAClD,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,CAA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