{"record":{"id":"eae7f0b7e3e8dfbf","repo":"emotion-js/emotion","slug":"you-seem-to-be-using-a-value-for-content-without","errorCode":null,"errorMessage":"You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"${value}\"'`","messagePattern":"You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"(.+?)\"'`","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/serialize/src/index.ts","lineNumber":146,"sourceCode":"  let contentValues = ['normal', 'none', 'initial', 'inherit', 'unset']\n\n  let oldProcessStyleValue = processStyleValue\n\n  let msPattern = /^-ms-/\n  let hyphenPattern = /-(.)/g\n\n  let hyphenatedCache: Record<string, boolean | undefined> = {}\n\n  processStyleValue = (key: string, value: string | number) => {\n    if (key === 'content') {\n      if (\n        typeof value !== 'string' ||\n        (contentValues.indexOf(value) === -1 &&\n          !contentValuePattern.test(value) &&\n          (value.charAt(0) !== value.charAt(value.length - 1) ||\n            (value.charAt(0) !== '\"' && value.charAt(0) !== \"'\")))\n      ) {\n        throw new Error(\n          `You seem to be using a value for 'content' without quotes, try replacing it with \\`content: '\"${value}\"'\\``\n        )\n      }\n    }\n\n    const processed = oldProcessStyleValue(key, value)\n\n    if (\n      processed !== '' &&\n      !isCustomProperty(key) &&\n      key.indexOf('-') !== -1 &&\n      hyphenatedCache[key] === undefined\n    ) {\n      hyphenatedCache[key] = true\n      console.error(\n        `Using kebab-case for css properties in objects is not supported. Did you mean ${key\n          .replace(msPattern, 'ms-')\n          .replace(hyphenPattern, (str, char) => char.toUpperCase())}?`","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/emotion-js/emotion/blob/b882bcba85132554992e4bd49e94c95939bbf810/packages/serialize/src/index.ts#L128-L164","documentation":"Emotion's serializer validates `content` property values at development time. CSS requires content values to be quoted strings or recognized keywords/URLs; an unquoted bare word like content: hello would silently produce invalid CSS, so emotion throws with the corrected form. The check runs when the value is a non-string-safe, non-quoted, non-keyword value.","triggerScenarios":"Writing styles like { content: hello } or { content: someVariable } where the value is not quoted, not in contentValues (counter, attr, open-quote, etc.), and does not match the allowed patterns (url(...), counter functions, or quoted strings).","commonSituations":"Forgetting quotes around a literal string in a css`` template; interpolating a variable containing unquoted text into content:; migrating from another CSS-in-JS lib that silently accepted unquoted values.","solutions":["Quote the value: content: '\"hello\"' or content: '\"' + value + '\"'","Use CSS.escape-style quoting or JSON.stringify(value) when interpolating dynamic strings","If the value is a keyword (counter, attr(...), open-quote), keep it unquoted — the checker allows it","Check that an interpolated variable doesn't strip quotes added in the template"],"exampleFix":"// before\ncss`\n  &::before { content: ${text}; }\n`\n\n// after\ncss`\n  &::before { content: '\"${text}\"'; }\n`","handlingStrategy":"validation","validationCode":"function safeContent(value) {\n  return /^(['\\\"]).*\\1$/.test(value) || /^(counter|attr|open-quote|close-quote|url)\\b/.test(value)\n    ? value\n    : `\"${value}\"`\n}","typeGuard":"function isQuoted(s) {\n  return typeof s === 'string' && s.length >= 2 &&\n    ((s.startsWith('\"') && s.endsWith('\"')) || (s.startsWith(\"'\") && s.endsWith(\"'\")))\n}","tryCatchPattern":null,"preventionTips":["Always write content values as quoted strings in css`` templates","Wrap interpolated values: content: '\"${val}\"'","Enable dev builds in CI tests to catch unquoted content early"],"tags":["css","content-property","serialization","dev-only"],"backgroundTag":"unquoted-css-content-value","analyzedSha":"b882bcba85132554992e4bd49e94c95939bbf810","analyzedAt":"2026-09-02T22:27:13.739Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}