Commit 780982f6 authored by Fred Chasen's avatar Fred Chasen

Allow content() syntax for string-set

parent ac99861c
...@@ -50,7 +50,7 @@ class StringSets extends Handler { ...@@ -50,7 +50,7 @@ class StringSets extends Handler {
let selected = fragment.querySelector(set.selector); let selected = fragment.querySelector(set.selector);
if (selected) { if (selected) {
let cssVar; let cssVar;
if (set.value === "content" || set.value === "content(text)") { if (set.value === "content" || set.value === "content()" || set.value === "content(text)") {
cssVar = selected.textContent.replace(/\\([\s\S])|(["|'])/g,"\\$1$2"); cssVar = selected.textContent.replace(/\\([\s\S])|(["|'])/g,"\\$1$2");
// this.styleSheet.insertRule(`:root { --string-${name}: "${cssVar}"; }`, this.styleSheet.cssRules.length); // this.styleSheet.insertRule(`:root { --string-${name}: "${cssVar}"; }`, this.styleSheet.cssRules.length);
// fragment.style.setProperty(`--string-${name}`, `"${cssVar}"`); // fragment.style.setProperty(`--string-${name}`, `"${cssVar}"`);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment