MCPcopy
hub / github.com/cssinjs/jss / parse

Function parse

packages/jss-plugin-template/src/parse.js:11–28  ·  view source on GitHub ↗
(cssText)

Source from the content-addressed store, hash-verified

9 * - No nested rules support
10 */
11const parse = (cssText) => {
12 const style = {}
13 const split = cssText.split(semiWithNl)
14 for (let i = 0; i < split.length; i++) {
15 const decl = (split[i] || '').trim()
16
17 if (!decl) continue
18 const colonIndex = decl.indexOf(':')
19 if (colonIndex === -1) {
20 warning(false, `[JSS] Malformed CSS string "${decl}"`)
21 continue
22 }
23 const prop = decl.substr(0, colonIndex).trim()
24 const value = decl.substr(colonIndex + 1).trim()
25 style[prop] = value
26 }
27 return style
28}
29
30export default parse

Callers 3

parse.jsFile · 0.85
createSheet.jsFile · 0.85
onProcessRuleFunction · 0.85

Calls 1

indexOfMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…