import { jsx, jsxs, Fragment } from 'solid-jsx/jsx-runtime';

/*@jsxRuntime automatic @jsxImportSource solid-jsx*/
const toc = [];
function _createMdxContent(props) {
  const _components = Object.assign({
    p: "p",
    code: "code",
    pre: "pre",
    span: "span"
  }, props.components);
  return jsxs(Fragment, {
    children: [jsxs(_components.p, {
      children: ["Solid 中的 style 属性接受样式字符串或对象。然而，对象形式不同于 ", jsx(_components.code, {
        children: "Element.prototype.style"
      }), "，Solid 通过调用 ", jsx(_components.code, {
        children: "style.setProperty"
      }), " 的封装来进行样式设置。这意味着键需要采用破折号的形式，如 ", jsx(_components.code, {
        children: "background-color"
      }), " 而不是 ", jsx(_components.code, {
        children: "backgroundColor"
      }), "。 但这意味着我们可以设置 CSS 变量。"]
    }), "\n", jsx(_components.pre, {
      children: jsxs(_components.code, {
        className: "hljs language-js",
        children: ["<div style={{ ", jsx(_components.span, {
          className: "hljs-string",
          children: "\"--my-custom-color\""
        }), ": ", jsx(_components.span, {
          className: "hljs-title function_",
          children: "themeColor"
        }), "() }} />\n"]
      })
    }), "\n", jsx(_components.p, {
      children: "让我们用一些内联样式为 div 设置动画："
    }), "\n", jsx(_components.pre, {
      children: jsxs(_components.code, {
        className: "hljs language-jsx",
        children: ["<div\n  style={{\n    ", jsx(_components.span, {
          className: "hljs-attr",
          children: "color"
        }), ": ", jsxs(_components.span, {
          className: "hljs-string",
          children: ["`rgb(", jsx(_components.span, {
            className: "hljs-subst",
            children: "${num()}"
          }), ", 180, ", jsx(_components.span, {
            className: "hljs-subst",
            children: "${num()}"
          }), ")`"]
        }), ",\n    ", jsx(_components.span, {
          className: "hljs-string",
          children: "\"font-weight\""
        }), ": ", jsx(_components.span, {
          className: "hljs-number",
          children: "800"
        }), ",\n    ", jsx(_components.span, {
          className: "hljs-string",
          children: "\"font-size\""
        }), ": ", jsxs(_components.span, {
          className: "hljs-string",
          children: ["`", jsx(_components.span, {
            className: "hljs-subst",
            children: "${num()}"
          }), "px`"]
        }), ",\n  }}\n>\n  ", jsx(_components.span, {
          className: "hljs-title class_",
          children: "Some"
        }), " ", jsx(_components.span, {
          className: "hljs-title class_",
          children: "Text"
        }), "\n</div>\n"]
      })
    })]
  });
}
function MDXContent(props = {}) {
  const {wrapper: MDXLayout} = props.components || ({});
  return MDXLayout ? jsx(MDXLayout, Object.assign({}, props, {
    children: jsx(_createMdxContent, props)
  })) : _createMdxContent(props);
}

export { MDXContent as default, toc };
//# sourceMappingURL=lesson-f232e8d7.js.map
