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: ["The ", jsx(_components.code, {
        children: "style"
      }), " attribute in Solid accepts either style strings or objects.\nHowever the object form differs from ", jsx(_components.code, {
        children: "Element.prototype.style"
      }), " and instead is a wrapper for calling ", jsx(_components.code, {
        children: "style.setProperty"
      }), ". This means that keys take the dash-case form, like \"background-color\" rather than \"backgroundColor\", and that any units must be explicitly provided (e.g., ", jsx(_components.code, {
        children: "width: 500px"
      }), " rather than ", jsx(_components.code, {
        children: "width: 500"
      }), ")."]
    }), "\n", jsx(_components.p, {
      children: "This also means that we have the ability to set CSS variables:"
    }), "\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: "Let's animate our div with a few inline styles:"
    }), "\n", jsx(_components.pre, {
      children: jsxs(_components.code, {
        className: "hljs language-jsx",
        children: ["<div 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  ", 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-6021f762.js.map
