Page Not Found
We could not find what you were looking for.
Please contact the owner of the site that linked you to the original URL and let them know their link is broken.
diff --git a/404.html b/404.html index 882795ce..c2bfd4c5 100644 --- a/404.html +++ b/404.html @@ -2,18 +2,18 @@
- +We could not find what you were looking for.
Please contact the owner of the site that linked you to the original URL and let them know their link is broken.
We could not find what you were looking for.
Please contact the owner of the site that linked you to the original URL and let them know their link is broken.
["'])(?.*?)\1/,p=/\{(? [\d,-]+)\}/,b={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},f={...b,lua:{start:"--",end:""},wasm:{start:"\\;\\;",end:""},tex:{start:"%",end:""},vb:{start:"['\u2018\u2019]",end:""},vbnet:{start:"(?:_\\s*)?['\u2018\u2019]",end:""},rem:{start:"[Rr][Ee][Mm]\\b",end:""},f90:{start:"!",end:""},ml:{start:"\\(\\*",end:"\\*\\)"},cobol:{start:"\\*>",end:""}},h=Object.keys(b);function g(e,t){const n=e.map((e=>{const{start:n,end:o}=f[e];return`(?:${n}\\s*(${t.flatMap((e=>[e.line,e.block?.start,e.block?.end].filter(Boolean))).join("|")})\\s*${o})`})).join("|");return new RegExp(`^\\s*(?:${n})\\s*$`)}function k(e,t){let n=e.replace(/\n$/,"");const{language:o,magicComments:s,metastring:c}=t;if(c&&p.test(c)){const e=c.match(p).groups.range;if(0===s.length)throw new Error(`A highlight range has been given in code block's metastring (\`\`\` ${c}), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.`);const t=s[0].className,o=d()(e).filter((e=>e>0)).map((e=>[e-1,[t]]));return{lineClassNames:Object.fromEntries(o),code:n}}if(void 0===o)return{lineClassNames:{},code:n};const r=function(e,t){switch(e){case"js":case"javascript":case"ts":case"typescript":return g(["js","jsBlock"],t);case"jsx":case"tsx":return g(["js","jsBlock","jsx"],t);case"html":return g(["js","jsBlock","html"],t);case"python":case"py":case"bash":return g(["bash"],t);case"markdown":case"md":return g(["html","jsx","bash"],t);case"tex":case"latex":case"matlab":return g(["tex"],t);case"lua":case"haskell":case"sql":return g(["lua"],t);case"wasm":return g(["wasm"],t);case"vb":case"vba":case"visual-basic":return g(["vb","rem"],t);case"vbnet":return g(["vbnet","rem"],t);case"batch":return g(["rem"],t);case"basic":return g(["rem","f90"],t);case"fsharp":return g(["js","ml"],t);case"ocaml":case"sml":return g(["ml"],t);case"fortran":return g(["f90"],t);case"cobol":return g(["cobol"],t);default:return g(h,t)}}(o,s),a=n.split("\n"),l=Object.fromEntries(s.map((e=>[e.className,{start:0,range:""}]))),i=Object.fromEntries(s.filter((e=>e.line)).map((e=>{let{className:t,line:n}=e;return[n,t]}))),u=Object.fromEntries(s.filter((e=>e.block)).map((e=>{let{className:t,block:n}=e;return[n.start,t]}))),m=Object.fromEntries(s.filter((e=>e.block)).map((e=>{let{className:t,block:n}=e;return[n.end,t]})));for(let d=0;d void 0!==e));i[t]?l[i[t]].range+=`${d},`:u[t]?l[u[t]].start=d:m[t]&&(l[m[t]].range+=`${l[m[t]].start}-${d-1},`),a.splice(d,1)}n=a.join("\n");const b={};return Object.entries(l).forEach((e=>{let[t,{range:n}]=e;d()(n).forEach((e=>{b[e]??=[],b[e].push(t)}))})),{lineClassNames:b,code:n}}const x={codeBlockContainer:"codeBlockContainer_Ckt0"};var B=n(4848);function j(e){let{as:t,...n}=e;const o=function(e){const t={color:"--prism-color",backgroundColor:"--prism-background-color"},n={};return Object.entries(e.plain).forEach((e=>{let[o,s]=e;const c=t[o];c&&"string"==typeof s&&(n[c]=s)})),n}(l());return(0,B.jsx)(t,{...n,style:o,className:(0,c.A)(n.className,x.codeBlockContainer,i.G.common.codeBlock)})}const y={codeBlockContent:"codeBlockContent_biex",codeBlockTitle:"codeBlockTitle_Ktv7",codeBlock:"codeBlock_bY9V",codeBlockStandalone:"codeBlockStandalone_MEMb",codeBlockLines:"codeBlockLines_e6Vv",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_o6Pm",buttonGroup:"buttonGroup__atx"};function v(e){let{children:t,className:n}=e;return(0,B.jsx)(j,{as:"pre",tabIndex:0,className:(0,c.A)(y.codeBlockStandalone,"thin-scrollbar",n),children:(0,B.jsx)("code",{className:y.codeBlockLines,children:t})})}var C=n(4799);const N={attributes:!0,characterData:!0,childList:!0,subtree:!0};function w(e,t){const[n,s]=(0,o.useState)(),c=(0,o.useCallback)((()=>{s(e.current?.closest("[role=tabpanel][hidden]"))}),[e,s]);(0,o.useEffect)((()=>{c()}),[c]),function(e,t,n){void 0===n&&(n=N);const s=(0,C._q)(t),c=(0,C.Be)(n);(0,o.useEffect)((()=>{const t=new MutationObserver(s);return e&&t.observe(e,c),()=>t.disconnect()}),[e,s,c])}(n,(e=>{e.forEach((e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(t(),c())}))}),{attributes:!0,characterData:!1,childList:!1,subtree:!1})}var E=n(1765);const L={codeLine:"codeLine_lJS_",codeLineNumber:"codeLineNumber_Tfdd",codeLineContent:"codeLineContent_feaV"};function A(e){let{line:t,classNames:n,showLineNumbers:o,getLineProps:s,getTokenProps:r}=e;1===t.length&&"\n"===t[0].content&&(t[0].content="");const a=s({line:t,className:(0,c.A)(n,o&&L.codeLine)}),l=t.map(((e,t)=>(0,B.jsx)("span",{...r({token:e})},t)));return(0,B.jsxs)("span",{...a,children:[o?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)("span",{className:L.codeLineNumber}),(0,B.jsx)("span",{className:L.codeLineContent,children:l})]}):l,(0,B.jsx)("br",{})]})}var _=n(3230);function S(e){return(0,B.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,B.jsx)("path",{fill:"currentColor",d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"})})}function T(e){return(0,B.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,B.jsx)("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})}const I={copyButtonCopied:"copyButtonCopied_obH4",copyButtonIcons:"copyButtonIcons_eSgA",copyButtonIcon:"copyButtonIcon_y97N",copyButtonSuccessIcon:"copyButtonSuccessIcon_LjdS"};function $(e){let{code:t,className:n}=e;const[s,r]=(0,o.useState)(!1),a=(0,o.useRef)(void 0),l=(0,o.useCallback)((()=>{!function(e,t){let{target:n=document.body}=void 0===t?{}:t;if("string"!=typeof e)throw new TypeError(`Expected parameter \`text\` to be a \`string\`, got \`${typeof e}\`.`);const o=document.createElement("textarea"),s=document.activeElement;o.value=e,o.setAttribute("readonly",""),o.style.contain="strict",o.style.position="absolute",o.style.left="-9999px",o.style.fontSize="12pt";const c=document.getSelection(),r=c.rangeCount>0&&c.getRangeAt(0);n.append(o),o.select(),o.selectionStart=0,o.selectionEnd=e.length;let a=!1;try{a=document.execCommand("copy")}catch{}o.remove(),r&&(c.removeAllRanges(),c.addRange(r)),s&&s.focus()}(t),r(!0),a.current=window.setTimeout((()=>{r(!1)}),1e3)}),[t]);return(0,o.useEffect)((()=>()=>window.clearTimeout(a.current)),[]),(0,B.jsx)("button",{type:"button","aria-label":s?(0,_.T)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,_.T)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,_.T)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,c.A)("clean-btn",n,I.copyButton,s&&I.copyButtonCopied),onClick:l,children:(0,B.jsxs)("span",{className:I.copyButtonIcons,"aria-hidden":"true",children:[(0,B.jsx)(S,{className:I.copyButtonIcon}),(0,B.jsx)(T,{className:I.copyButtonSuccessIcon})]})})}function W(e){return(0,B.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,B.jsx)("path",{fill:"currentColor",d:"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"})})}const M={wordWrapButtonIcon:"wordWrapButtonIcon_Bwma",wordWrapButtonEnabled:"wordWrapButtonEnabled_EoeP"};function H(e){let{className:t,onClick:n,isEnabled:o}=e;const s=(0,_.T)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return(0,B.jsx)("button",{type:"button",onClick:n,className:(0,c.A)("clean-btn",t,o&&M.wordWrapButtonEnabled),"aria-label":s,title:s,children:(0,B.jsx)(W,{className:M.wordWrapButtonIcon,"aria-hidden":"true"})})}function R(e){let{children:t,className:n="",metastring:s,title:r,showLineNumbers:i,language:u}=e;const{prism:{defaultLanguage:d,magicComments:p}}=(0,a.p)(),b=function(e){return e?.toLowerCase()}(u??function(e){const t=e.split(" ").find((e=>e.startsWith("language-")));return t?.replace(/language-/,"")}(n)??d),f=l(),h=function(){const[e,t]=(0,o.useState)(!1),[n,s]=(0,o.useState)(!1),c=(0,o.useRef)(null),r=(0,o.useCallback)((()=>{const n=c.current.querySelector("code");e?n.removeAttribute("style"):(n.style.whiteSpace="pre-wrap",n.style.overflowWrap="anywhere"),t((e=>!e))}),[c,e]),a=(0,o.useCallback)((()=>{const{scrollWidth:e,clientWidth:t}=c.current,n=e>t||c.current.querySelector("code").hasAttribute("style");s(n)}),[c]);return w(c,a),(0,o.useEffect)((()=>{a()}),[e,a]),(0,o.useEffect)((()=>(window.addEventListener("resize",a,{passive:!0}),()=>{window.removeEventListener("resize",a)})),[a]),{codeBlockRef:c,isEnabled:e,isCodeScrollable:n,toggle:r}}(),g=function(e){return e?.match(m)?.groups.title??""}(s)||r,{lineClassNames:x,code:v}=k(t,{metastring:s,language:b,magicComments:p}),C=i??function(e){return Boolean(e?.includes("showLineNumbers"))}(s);return(0,B.jsxs)(j,{as:"div",className:(0,c.A)(n,b&&!n.includes(`language-${b}`)&&`language-${b}`),children:[g&&(0,B.jsx)("div",{className:y.codeBlockTitle,children:g}),(0,B.jsxs)("div",{className:y.codeBlockContent,children:[(0,B.jsx)(E.f4,{theme:f,code:v,language:b??"text",children:e=>{let{className:t,style:n,tokens:o,getLineProps:s,getTokenProps:r}=e;return(0,B.jsx)("pre",{tabIndex:0,ref:h.codeBlockRef,className:(0,c.A)(t,y.codeBlock,"thin-scrollbar"),style:n,children:(0,B.jsx)("code",{className:(0,c.A)(y.codeBlockLines,C&&y.codeBlockLinesWithNumbering),children:o.map(((e,t)=>(0,B.jsx)(A,{line:e,getLineProps:s,getTokenProps:r,classNames:x[t],showLineNumbers:C},t)))})})}}),(0,B.jsxs)("div",{className:y.buttonGroup,children:[(h.isEnabled||h.isCodeScrollable)&&(0,B.jsx)(H,{className:y.codeButton,onClick:()=>h.toggle(),isEnabled:h.isEnabled}),(0,B.jsx)($,{className:y.codeButton,code:v})]})]})]})}function V(e){let{children:t,...n}=e;const c=(0,s.A)(),r=function(e){return o.Children.toArray(e).some((e=>(0,o.isValidElement)(e)))?e:Array.isArray(e)?e.join(""):e}(t),a="string"==typeof r?R:v;return(0,B.jsx)(a,{...n,children:r},String(c))}},8426:(e,t)=>{function n(e){let t,n=[];for(let o of e.split(",").map((e=>e.trim())))if(/^-?\d+$/.test(o))n.push(parseInt(o,10));else if(t=o.match(/^(-?\d+)(-|\.\.\.?|\u2025|\u2026|\u22EF)(-?\d+)$/)){let[e,o,s,c]=t;if(o&&c){o=parseInt(o),c=parseInt(c);const e=o {"use strict";n.d(t,{R:()=>r,x:()=>a});var o=n(6540);const s={},c=o.createContext(s);function r(e){const t=o.useContext(c);return o.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),o.createElement(c.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/17347b34.21ab0fd2.js b/assets/js/17347b34.21ab0fd2.js new file mode 100644 index 00000000..2e1db616 --- /dev/null +++ b/assets/js/17347b34.21ab0fd2.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[6468],{720:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>o,contentTitle:()=>a,default:()=>p,frontMatter:()=>r,metadata:()=>i,toc:()=>c});const i=JSON.parse('{"id":"getting-started/nextjs-integration","title":"NextJS","description":"There are a few steps you need to follow to integrate Stylable into your NextJS project.","source":"@site/docs/getting-started/nextjs-integration.md","sourceDirName":"getting-started","slug":"/getting-started/nextjs-integration","permalink":"/docs/getting-started/nextjs-integration","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/getting-started/nextjs-integration.md","tags":[],"version":"current","frontMatter":{"id":"nextjs-integration","title":"NextJS"},"sidebar":"Discover","previous":{"title":"Integrations","permalink":"/docs/getting-started/integrations"},"next":{"title":"Rollup","permalink":"/docs/getting-started/rollup-integration"}}');var l=t(4848),s=t(8453);const r={id:"nextjs-integration",title:"NextJS"},a=void 0,o={},c=[{value:"Example Configuration:",id:"example-configuration",level:4},{value:"Using 3rd-party stylesheets",id:"using-3rd-party-stylesheets",level:3},{value:"Example Configuration:",id:"example-configuration-1",level:4},{value:"TypeScript integration",id:"typescript-integration",level:3},{value:"App directory",id:"app-directory",level:3},{value:"Example Configuration:",id:"example-configuration-2",level:4}];function d(e){const n={a:"a",admonition:"admonition",code:"code",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",...(0,s.R)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.p,{children:"There are a few steps you need to follow to integrate Stylable into your NextJS project."}),"\n",(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:["Install ",(0,l.jsx)(n.code,{children:"@stylable/webpack-plugin"})," as a ",(0,l.jsx)(n.code,{children:"devDependency"})," in your ",(0,l.jsx)(n.code,{children:"package.json"})," file."]}),"\n",(0,l.jsxs)(n.li,{children:["Create a ",(0,l.jsx)(n.code,{children:"next.config.js"})," file."]}),"\n",(0,l.jsx)(n.li,{children:"Exclude other CSS loaders from loading Stylable (*.st.css) files."}),"\n",(0,l.jsx)(n.li,{children:"Add the Stylable plugin to the webpack configuration."}),"\n"]}),"\n",(0,l.jsx)(n.h4,{id:"example-configuration",children:"Example Configuration:"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-js",metastring:'title="next.config.js"',children:"const { \n StylableWebpackPlugin,\n applyWebpackConfigStylableExcludes \n} = require('@stylable/webpack-plugin');\n\n/* \n * single optimizer for NextJS multiple builds \n * in order to sync client/server namespaces \n*/\nconst StylableOptimizer = require('@stylable/optimizer').StylableOptimizer;\nconst stylableOptimizer = new StylableOptimizer();\n\nmodule.exports = {\n webpack: (config) => {\n /* exclude Stylable files from all other loaders */\n applyWebpackConfigStylableExcludes(config);\n\n /* add the Stylable plugin to the webpack configuration */\n config.plugins.push(\n new StylableWebpackPlugin({\n /* let NextJS handle assets */\n filterAssets: () => false,\n\n /* output CSS to the correct location */\n filename: 'static/css/stylable.[contenthash].css',\n\n /* a shared optimizer instance */\n optimizer: stylableOptimizer,\n })\n );\n return config;\n },\n};\n"})}),"\n",(0,l.jsx)(n.admonition,{type:"important",children:(0,l.jsxs)(n.p,{children:["The ",(0,l.jsx)(n.code,{children:"applyWebpackConfigStylableExcludes"})," export and ",(0,l.jsx)(n.code,{children:"filterAssets"})," flag are available in ",(0,l.jsx)(n.code,{children:"@stylable/webpack-plugin"})," version ",(0,l.jsx)(n.code,{children:"4.2.2"})," and onwards."]})}),"\n",(0,l.jsx)(n.h3,{id:"using-3rd-party-stylesheets",children:"Using 3rd-party stylesheets"}),"\n",(0,l.jsxs)(n.p,{children:["If your project consumes any 3rd-party Stylable stylesheets, additional configuration is required to ensure that they will be handled by ",(0,l.jsx)(n.code,{children:"@stylable/webpack-plugin"}),":"]}),"\n",(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:["Add an import to ",(0,l.jsx)(n.code,{children:"bundleServerLibs"})," from ",(0,l.jsx)(n.code,{children:"@stylable/webpack-plugin"})]}),"\n",(0,l.jsxs)(n.li,{children:["Use the ",(0,l.jsx)(n.code,{children:"isServer"})," flag from the webpack configuration context in the second argument"]}),"\n",(0,l.jsxs)(n.li,{children:["Call ",(0,l.jsx)(n.code,{children:"bundleServerLibs"})," with the webpack ",(0,l.jsx)(n.code,{children:"config"}),", packages to bundle, and the ",(0,l.jsx)(n.code,{children:"isServer"})," flag"]}),"\n"]}),"\n",(0,l.jsx)(n.h4,{id:"example-configuration-1",children:"Example Configuration:"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-js",metastring:'title="next.config.js"',children:"const { \n StylableWebpackPlugin,\n applyWebpackConfigStylableExcludes,\n bundleServerLibs\n} = require('@stylable/webpack-plugin');\n\n/* \n * single optimizer for NextJS multiple builds \n * in order to sync client/server namespaces \n*/\nconst StylableOptimizer = require('@stylable/optimizer').StylableOptimizer;\nconst stylableOptimizer = new StylableOptimizer();\n\nmodule.exports = {\n webpack: (config, { isServer }) => {\n /* exclude Stylable files from all other loaders */\n applyWebpackConfigStylableExcludes(config);\n \n /* causes provided packages to be bundled (not external) */\n bundleServerLibs(config, new Set(['PACKAGE1', 'PACKAGE2'], isServer));\n\n /* add the Stylable plugin to the webpack configuration */\n config.plugins.push(\n new StylableWebpackPlugin({\n /* let NextJS handle assets */\n filterAssets: () => false,\n\n /* output CSS to the correct location */\n filename: 'static/css/stylable.[contenthash].css',\n\n /* a shared optimizer instance */\n optimizer: stylableOptimizer,\n })\n );\n return config;\n },\n};\n"})}),"\n",(0,l.jsx)(n.h3,{id:"typescript-integration",children:"TypeScript integration"}),"\n",(0,l.jsxs)(n.p,{children:["If your NextJS project is configured to work with TypeScript, see our page on ",(0,l.jsx)(n.a,{href:"/docs/getting-started/typescript-integration",children:"integrating Stylable with TypeScript"}),"."]}),"\n",(0,l.jsx)(n.h3,{id:"app-directory",children:"App directory"}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsxs)(n.strong,{children:["Support for Next.js ",(0,l.jsx)(n.a,{href:"https://beta.nextjs.org/docs/app-directory-roadmap",children:"App directory"})," is experimental."]})}),"\n",(0,l.jsx)(n.p,{children:"There are two settings that are required to integrate Stylable with the App directory mode:"}),"\n",(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:["set ",(0,l.jsx)(n.code,{children:"cssInjection:css"})," in order to force CSS to be served as a static CSS file in dev mode. This is required because App directory mode defaults to React server render, and Stylable defaults to injecting CSS via Javascript in development which doesn't reach the browser."]}),"\n",(0,l.jsxs)(n.li,{children:["set ",(0,l.jsx)(n.code,{children:"experimentalAttachCssToContainingChunks:true"})," to change the way the generated CSS asset is attached to Webpack chunks in order for Next.js to pick it up as a CSS module and not a JavaScript module."]}),"\n"]}),"\n",(0,l.jsx)(n.h4,{id:"example-configuration-2",children:"Example Configuration:"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-js",metastring:'title="next.config.js"',children:"const { \n StylableWebpackPlugin,\n applyWebpackConfigStylableExcludes \n} = require('@stylable/webpack-plugin');\n\n/* \n * single optimizer for NextJS multiple builds \n * in order to sync client/server namespaces \n*/\nconst StylableOptimizer = require('@stylable/optimizer').StylableOptimizer;\nconst stylableOptimizer = new StylableOptimizer();\n\nmodule.exports = {\n webpack: (config) => {\n /* exclude Stylable files from all other loaders */\n applyWebpackConfigStylableExcludes(config);\n\n /* add the Stylable plugin to the webpack configuration */\n config.plugins.push(\n new StylableWebpackPlugin({\n /* let NextJS handle assets */\n filterAssets: () => false,\n\n /* output CSS to the correct location */\n filename: 'static/css/stylable.[contenthash].css',\n\n /* a shared optimizer instance */\n optimizer: stylableOptimizer,\n\n /* serve CSS as a bundled asset */\n cssInjection: 'css',\n\n /* attach CSS to every chunk containing a Stylable stylesheet,\n instead of to entry chunks \n */\n experimentalAttachCssToContainingChunks: true,\n })\n );\n return config;\n },\n};\n"})})]})}function p(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,l.jsx)(n,{...e,children:(0,l.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>a});var i=t(6540);const l={},s=i.createContext(l);function r(e){const n=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:r(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/17347b34.a155ec2b.js b/assets/js/17347b34.a155ec2b.js deleted file mode 100644 index 03f33ef1..00000000 --- a/assets/js/17347b34.a155ec2b.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[6468],{9097:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>o,contentTitle:()=>a,default:()=>p,frontMatter:()=>r,metadata:()=>i,toc:()=>c});const i=JSON.parse('{"id":"getting-started/nextjs-integration","title":"NextJS","description":"There are a few steps you need to follow to integrate Stylable into your NextJS project.","source":"@site/docs/getting-started/nextjs-integration.md","sourceDirName":"getting-started","slug":"/getting-started/nextjs-integration","permalink":"/docs/getting-started/nextjs-integration","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/getting-started/nextjs-integration.md","tags":[],"version":"current","frontMatter":{"id":"nextjs-integration","title":"NextJS"},"sidebar":"Discover","previous":{"title":"Integrations","permalink":"/docs/getting-started/integrations"},"next":{"title":"Rollup","permalink":"/docs/getting-started/rollup-integration"}}');var l=t(4848),s=t(8453);const r={id:"nextjs-integration",title:"NextJS"},a=void 0,o={},c=[{value:"Example Configuration:",id:"example-configuration",level:4},{value:"Using 3rd-party stylesheets",id:"using-3rd-party-stylesheets",level:3},{value:"Example Configuration:",id:"example-configuration-1",level:4},{value:"TypeScript integration",id:"typescript-integration",level:3},{value:"App directory",id:"app-directory",level:3},{value:"Example Configuration:",id:"example-configuration-2",level:4}];function d(e){const n={a:"a",admonition:"admonition",code:"code",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",...(0,s.R)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.p,{children:"There are a few steps you need to follow to integrate Stylable into your NextJS project."}),"\n",(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:["Install ",(0,l.jsx)(n.code,{children:"@stylable/webpack-plugin"})," as a ",(0,l.jsx)(n.code,{children:"devDependency"})," in your ",(0,l.jsx)(n.code,{children:"package.json"})," file."]}),"\n",(0,l.jsxs)(n.li,{children:["Create a ",(0,l.jsx)(n.code,{children:"next.config.js"})," file."]}),"\n",(0,l.jsx)(n.li,{children:"Exclude other CSS loaders from loading Stylable (*.st.css) files."}),"\n",(0,l.jsx)(n.li,{children:"Add the Stylable plugin to the webpack configuration."}),"\n"]}),"\n",(0,l.jsx)(n.h4,{id:"example-configuration",children:"Example Configuration:"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-js",metastring:'title="next.config.js"',children:"const { \n StylableWebpackPlugin,\n applyWebpackConfigStylableExcludes \n} = require('@stylable/webpack-plugin');\n\n/* \n * single optimizer for NextJS multiple builds \n * in order to sync client/server namespaces \n*/\nconst StylableOptimizer = require('@stylable/optimizer').StylableOptimizer;\nconst stylableOptimizer = new StylableOptimizer();\n\nmodule.exports = {\n webpack: (config) => {\n /* exclude Stylable files from all other loaders */\n applyWebpackConfigStylableExcludes(config);\n\n /* add the Stylable plugin to the webpack configuration */\n config.plugins.push(\n new StylableWebpackPlugin({\n /* let NextJS handle assets */\n filterAssets: () => false,\n\n /* output CSS to the correct location */\n filename: 'static/css/stylable.[contenthash].css',\n\n /* a shared optimizer instance */\n optimizer: stylableOptimizer,\n })\n );\n return config;\n },\n};\n"})}),"\n",(0,l.jsx)(n.admonition,{type:"important",children:(0,l.jsxs)(n.p,{children:["The ",(0,l.jsx)(n.code,{children:"applyWebpackConfigStylableExcludes"})," export and ",(0,l.jsx)(n.code,{children:"filterAssets"})," flag are available in ",(0,l.jsx)(n.code,{children:"@stylable/webpack-plugin"})," version ",(0,l.jsx)(n.code,{children:"4.2.2"})," and onwards."]})}),"\n",(0,l.jsx)(n.h3,{id:"using-3rd-party-stylesheets",children:"Using 3rd-party stylesheets"}),"\n",(0,l.jsxs)(n.p,{children:["If your project consumes any 3rd-party Stylable stylesheets, additional configuration is required to ensure that they will be handled by ",(0,l.jsx)(n.code,{children:"@stylable/webpack-plugin"}),":"]}),"\n",(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:["Add an import to ",(0,l.jsx)(n.code,{children:"bundleServerLibs"})," from ",(0,l.jsx)(n.code,{children:"@stylable/webpack-plugin"})]}),"\n",(0,l.jsxs)(n.li,{children:["Use the ",(0,l.jsx)(n.code,{children:"isServer"})," flag from the webpack configuration context in the second argument"]}),"\n",(0,l.jsxs)(n.li,{children:["Call ",(0,l.jsx)(n.code,{children:"bundleServerLibs"})," with the webpack ",(0,l.jsx)(n.code,{children:"config"}),", packages to bundle, and the ",(0,l.jsx)(n.code,{children:"isServer"})," flag"]}),"\n"]}),"\n",(0,l.jsx)(n.h4,{id:"example-configuration-1",children:"Example Configuration:"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-js",metastring:'title="next.config.js"',children:"const { \n StylableWebpackPlugin,\n applyWebpackConfigStylableExcludes,\n bundleServerLibs\n} = require('@stylable/webpack-plugin');\n\n/* \n * single optimizer for NextJS multiple builds \n * in order to sync client/server namespaces \n*/\nconst StylableOptimizer = require('@stylable/optimizer').StylableOptimizer;\nconst stylableOptimizer = new StylableOptimizer();\n\nmodule.exports = {\n webpack: (config, { isServer }) => {\n /* exclude Stylable files from all other loaders */\n applyWebpackConfigStylableExcludes(config);\n \n /* causes provided packages to be bundled (not external) */\n bundleServerLibs(config, new Set(['PACKAGE1', 'PACKAGE2'], isServer));\n\n /* add the Stylable plugin to the webpack configuration */\n config.plugins.push(\n new StylableWebpackPlugin({\n /* let NextJS handle assets */\n filterAssets: () => false,\n\n /* output CSS to the correct location */\n filename: 'static/css/stylable.[contenthash].css',\n\n /* a shared optimizer instance */\n optimizer: stylableOptimizer,\n })\n );\n return config;\n },\n};\n"})}),"\n",(0,l.jsx)(n.h3,{id:"typescript-integration",children:"TypeScript integration"}),"\n",(0,l.jsxs)(n.p,{children:["If your NextJS project is configured to work with TypeScript, see our page on ",(0,l.jsx)(n.a,{href:"/docs/getting-started/typescript-integration",children:"integrating Stylable with TypeScript"}),"."]}),"\n",(0,l.jsx)(n.h3,{id:"app-directory",children:"App directory"}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsxs)(n.strong,{children:["Support for Next.js ",(0,l.jsx)(n.a,{href:"https://beta.nextjs.org/docs/app-directory-roadmap",children:"App directory"})," is experimental."]})}),"\n",(0,l.jsx)(n.p,{children:"There are two settings that are required to integrate Stylable with the App directory mode:"}),"\n",(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:["set ",(0,l.jsx)(n.code,{children:"cssInjection:css"})," in order to force CSS to be served as a static CSS file in dev mode. This is required because App directory mode defaults to React server render, and Stylable defaults to injecting CSS via Javascript in development which doesn't reach the browser."]}),"\n",(0,l.jsxs)(n.li,{children:["set ",(0,l.jsx)(n.code,{children:"experimentalAttachCssToContainingChunks:true"})," to change the way the generated CSS asset is attached to Webpack chunks in order for Next.js to pick it up as a CSS module and not a JavaScript module."]}),"\n"]}),"\n",(0,l.jsx)(n.h4,{id:"example-configuration-2",children:"Example Configuration:"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-js",metastring:'title="next.config.js"',children:"const { \n StylableWebpackPlugin,\n applyWebpackConfigStylableExcludes \n} = require('@stylable/webpack-plugin');\n\n/* \n * single optimizer for NextJS multiple builds \n * in order to sync client/server namespaces \n*/\nconst StylableOptimizer = require('@stylable/optimizer').StylableOptimizer;\nconst stylableOptimizer = new StylableOptimizer();\n\nmodule.exports = {\n webpack: (config) => {\n /* exclude Stylable files from all other loaders */\n applyWebpackConfigStylableExcludes(config);\n\n /* add the Stylable plugin to the webpack configuration */\n config.plugins.push(\n new StylableWebpackPlugin({\n /* let NextJS handle assets */\n filterAssets: () => false,\n\n /* output CSS to the correct location */\n filename: 'static/css/stylable.[contenthash].css',\n\n /* a shared optimizer instance */\n optimizer: stylableOptimizer,\n\n /* serve CSS as a bundled asset */\n cssInjection: 'css',\n\n /* attach CSS to every chunk containing a Stylable stylesheet,\n instead of to entry chunks \n */\n experimentalAttachCssToContainingChunks: true,\n })\n );\n return config;\n },\n};\n"})})]})}function p(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,l.jsx)(n,{...e,children:(0,l.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>a});var i=t(6540);const l={},s=i.createContext(l);function r(e){const n=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:r(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/17896441.01c5f8f4.js b/assets/js/17896441.01c5f8f4.js new file mode 100644 index 00000000..b4fcc4f9 --- /dev/null +++ b/assets/js/17896441.01c5f8f4.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[8401],{2234:(e,t,n)=>{n.d(t,{A:()=>c});n(6540);var s=n(4164),a=n(4084),i=n(7559),o=n(7293),l=n(4848);function r(e){let{className:t}=e;return(0,l.jsx)(o.A,{type:"caution",title:(0,l.jsx)(a.Rc,{}),className:(0,s.A)(t,i.G.common.unlistedBanner),children:(0,l.jsx)(a.Uh,{})})}function c(e){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(a.AE,{}),(0,l.jsx)(r,{...e})]})}},1689:(e,t,n)=>{n.d(t,{A:()=>d});n(6540);var s=n(4164),a=n(4084),i=n(7559),o=n(7293),l=n(4848);function r(e){let{className:t}=e;return(0,l.jsx)(o.A,{type:"caution",title:(0,l.jsx)(a.Yh,{}),className:(0,s.A)(t,i.G.common.draftBanner),children:(0,l.jsx)(a.TT,{})})}var c=n(2234);function d(e){let{metadata:t}=e;const{unlisted:n,frontMatter:s}=t;return(0,l.jsxs)(l.Fragment,{children:[(n||s.unlisted)&&(0,l.jsx)(c.A,{}),s.draft&&(0,l.jsx)(r,{})]})}},1243:(e,t,n)=>{n.d(t,{A:()=>f});n(6540);var s=n(4164),a=n(7559),i=n(6972),o=n(9169),l=n(8774),r=n(1312),c=n(6025),d=n(4848);function u(e){return(0,d.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,d.jsx)("path",{d:"M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z",fill:"currentColor"})})}const m={breadcrumbHomeIcon:"breadcrumbHomeIcon_YNFT"};function h(){const e=(0,c.Ay)("/");return(0,d.jsx)("li",{className:"breadcrumbs__item",children:(0,d.jsx)(l.A,{"aria-label":(0,r.T)({id:"theme.docs.breadcrumbs.home",message:"Home page",description:"The ARIA label for the home page in the breadcrumbs"}),className:"breadcrumbs__link",href:e,children:(0,d.jsx)(u,{className:m.breadcrumbHomeIcon})})})}const v={breadcrumbsContainer:"breadcrumbsContainer_Z_bl"};function b(e){let{children:t,href:n,isLast:s}=e;const a="breadcrumbs__link";return s?(0,d.jsx)("span",{className:a,itemProp:"name",children:t}):n?(0,d.jsx)(l.A,{className:a,href:n,itemProp:"item",children:(0,d.jsx)("span",{itemProp:"name",children:t})}):(0,d.jsx)("span",{className:a,children:t})}function x(e){let{children:t,active:n,index:a,addMicrodata:i}=e;return(0,d.jsxs)("li",{...i&&{itemScope:!0,itemProp:"itemListElement",itemType:"https://schema.org/ListItem"},className:(0,s.A)("breadcrumbs__item",{"breadcrumbs__item--active":n}),children:[t,(0,d.jsx)("meta",{itemProp:"position",content:String(a+1)})]})}function f(){const e=(0,i.OF)(),t=(0,o.Dt)();return e?(0,d.jsx)("nav",{className:(0,s.A)(a.G.docs.docBreadcrumbs,v.breadcrumbsContainer),"aria-label":(0,r.T)({id:"theme.docs.breadcrumbs.navAriaLabel",message:"Breadcrumbs",description:"The ARIA label for the breadcrumbs"}),children:(0,d.jsxs)("ul",{className:"breadcrumbs",itemScope:!0,itemType:"https://schema.org/BreadcrumbList",children:[t&&(0,d.jsx)(h,{}),e.map(((t,n)=>{const s=n===e.length-1,a="category"===t.type&&t.linkUnlisted?void 0:t.href;return(0,d.jsx)(x,{active:s,index:n,addMicrodata:!!a,children:(0,d.jsx)(b,{href:a,isLast:s,children:t.label})},n)}))]})}):null}},833:(e,t,n)=>{n.r(t),n.d(t,{default:()=>P});var s=n(6540),a=n(1213),i=n(9532),o=n(4848);const l=s.createContext(null);function r(e){let{children:t,content:n}=e;const a=function(e){return(0,s.useMemo)((()=>({metadata:e.metadata,frontMatter:e.frontMatter,assets:e.assets,contentTitle:e.contentTitle,toc:e.toc})),[e])}(n);return(0,o.jsx)(l.Provider,{value:a,children:t})}function c(){const e=(0,s.useContext)(l);if(null===e)throw new i.dV("DocProvider");return e}function d(){const{metadata:e,frontMatter:t,assets:n}=c();return(0,o.jsx)(a.be,{title:e.title,description:e.description,keywords:t.keywords,image:n.image??t.image})}var u=n(4164),m=n(4581),h=n(7719);function v(){const{metadata:e}=c();return(0,o.jsx)(h.A,{previous:e.previous,next:e.next})}var b=n(1878),x=n(4267),f=n(7559),p=n(2053),g=n(4336);function j(){const{metadata:e}=c(),{editUrl:t,lastUpdatedAt:n,lastUpdatedBy:s,tags:a}=e,i=a.length>0,l=!!(t||n||s);return i||l?(0,o.jsxs)("footer",{className:(0,u.A)(f.G.docs.docFooter,"docusaurus-mt-lg"),children:[i&&(0,o.jsx)("div",{className:(0,u.A)("row margin-top--sm",f.G.docs.docFooterTagsRow),children:(0,o.jsx)("div",{className:"col",children:(0,o.jsx)(p.A,{tags:a})})}),l&&(0,o.jsx)(g.A,{className:(0,u.A)("margin-top--sm",f.G.docs.docFooterEditMetaRow),editUrl:t,lastUpdatedAt:n,lastUpdatedBy:s})]}):null}var A=n(1422),L=n(5195),C=n(1312);const N={tocCollapsibleButton:"tocCollapsibleButton_TO0P",tocCollapsibleButtonExpanded:"tocCollapsibleButtonExpanded_MG3E"};function _(e){let{collapsed:t,...n}=e;return(0,o.jsx)("button",{type:"button",...n,className:(0,u.A)("clean-btn",N.tocCollapsibleButton,!t&&N.tocCollapsibleButtonExpanded,n.className),children:(0,o.jsx)(C.A,{id:"theme.TOCCollapsible.toggleButtonLabel",description:"The label used by the button on the collapsible TOC component",children:"On this page"})})}const T={tocCollapsible:"tocCollapsible_ETCw",tocCollapsibleContent:"tocCollapsibleContent_vkbj",tocCollapsibleExpanded:"tocCollapsibleExpanded_sAul"};function k(e){let{toc:t,className:n,minHeadingLevel:s,maxHeadingLevel:a}=e;const{collapsed:i,toggleCollapsed:l}=(0,A.u)({initialState:!0});return(0,o.jsxs)("div",{className:(0,u.A)(T.tocCollapsible,!i&&T.tocCollapsibleExpanded,n),children:[(0,o.jsx)(_,{collapsed:i,onClick:l}),(0,o.jsx)(A.N,{lazy:!0,className:T.tocCollapsibleContent,collapsed:i,children:(0,o.jsx)(L.A,{toc:t,minHeadingLevel:s,maxHeadingLevel:a})})]})}const H={tocMobile:"tocMobile_ITEo"};function y(){const{toc:e,frontMatter:t}=c();return(0,o.jsx)(k,{toc:e,minHeadingLevel:t.toc_min_heading_level,maxHeadingLevel:t.toc_max_heading_level,className:(0,u.A)(f.G.docs.docTocMobile,H.tocMobile)})}var M=n(7763);function B(){const{toc:e,frontMatter:t}=c();return(0,o.jsx)(M.A,{toc:e,minHeadingLevel:t.toc_min_heading_level,maxHeadingLevel:t.toc_max_heading_level,className:f.G.docs.docTocDesktop})}var I=n(1107),w=n(5425);function E(e){let{children:t}=e;const n=function(){const{metadata:e,frontMatter:t,contentTitle:n}=c();return t.hide_title||void 0!==n?null:e.title}();return(0,o.jsxs)("div",{className:(0,u.A)(f.G.docs.docMarkdown,"markdown"),children:[n&&(0,o.jsx)("header",{children:(0,o.jsx)(I.A,{as:"h1",children:n})}),(0,o.jsx)(w.A,{children:t})]})}var V=n(1243),O=n(1689);const G={docItemContainer:"docItemContainer_Djhp",docItemCol:"docItemCol_VOVn"};function S(e){let{children:t}=e;const n=function(){const{frontMatter:e,toc:t}=c(),n=(0,m.l)(),s=e.hide_table_of_contents,a=!s&&t.length>0;return{hidden:s,mobile:a?(0,o.jsx)(y,{}):void 0,desktop:!a||"desktop"!==n&&"ssr"!==n?void 0:(0,o.jsx)(B,{})}}(),{metadata:s}=c();return(0,o.jsxs)("div",{className:"row",children:[(0,o.jsxs)("div",{className:(0,u.A)("col",!n.hidden&&G.docItemCol),children:[(0,o.jsx)(O.A,{metadata:s}),(0,o.jsx)(b.A,{}),(0,o.jsxs)("div",{className:G.docItemContainer,children:[(0,o.jsxs)("article",{children:[(0,o.jsx)(V.A,{}),(0,o.jsx)(x.A,{}),n.mobile,(0,o.jsx)(E,{children:t}),(0,o.jsx)(j,{})]}),(0,o.jsx)(v,{})]})]}),n.desktop&&(0,o.jsx)("div",{className:"col col--3",children:n.desktop})]})}function P(e){const t=`docs-doc-id-${e.content.metadata.id}`,n=e.content;return(0,o.jsx)(r,{content:e.content,children:(0,o.jsxs)(a.e3,{className:t,children:[(0,o.jsx)(d,{}),(0,o.jsx)(S,{children:(0,o.jsx)(n,{})})]})})}},7719:(e,t,n)=>{n.d(t,{A:()=>o});n(6540);var s=n(1312),a=n(9022),i=n(4848);function o(e){const{previous:t,next:n}=e;return(0,i.jsxs)("nav",{className:"pagination-nav docusaurus-mt-lg","aria-label":(0,s.T)({id:"theme.docs.paginator.navAriaLabel",message:"Docs pages",description:"The ARIA label for the docs pagination"}),children:[t&&(0,i.jsx)(a.A,{...t,subLabel:(0,i.jsx)(s.A,{id:"theme.docs.paginator.previous",description:"The label used to navigate to the previous doc",children:"Previous"})}),n&&(0,i.jsx)(a.A,{...n,subLabel:(0,i.jsx)(s.A,{id:"theme.docs.paginator.next",description:"The label used to navigate to the next doc",children:"Next"}),isNext:!0})]})}},4267:(e,t,n)=>{n.d(t,{A:()=>r});n(6540);var s=n(4164),a=n(1312),i=n(7559),o=n(3025),l=n(4848);function r(e){let{className:t}=e;const n=(0,o.r)();return n.badge?(0,l.jsx)("span",{className:(0,s.A)(t,i.G.docs.docVersionBadge,"badge badge--secondary"),children:(0,l.jsx)(a.A,{id:"theme.docs.versionBadge.label",values:{versionLabel:n.label},children:"Version: {versionLabel}"})}):null}},1878:(e,t,n)=>{n.d(t,{A:()=>x});n(6540);var s=n(4164),a=n(4586),i=n(8774),o=n(1312),l=n(4070),r=n(7559),c=n(3886),d=n(3025),u=n(4848);const m={unreleased:function(e){let{siteTitle:t,versionMetadata:n}=e;return(0,u.jsx)(o.A,{id:"theme.docs.versions.unreleasedVersionLabel",description:"The label used to tell the user that he's browsing an unreleased doc version",values:{siteTitle:t,versionLabel:(0,u.jsx)("b",{children:n.label})},children:"This is unreleased documentation for {siteTitle} {versionLabel} version."})},unmaintained:function(e){let{siteTitle:t,versionMetadata:n}=e;return(0,u.jsx)(o.A,{id:"theme.docs.versions.unmaintainedVersionLabel",description:"The label used to tell the user that he's browsing an unmaintained doc version",values:{siteTitle:t,versionLabel:(0,u.jsx)("b",{children:n.label})},children:"This is documentation for {siteTitle} {versionLabel}, which is no longer actively maintained."})}};function h(e){const t=m[e.versionMetadata.banner];return(0,u.jsx)(t,{...e})}function v(e){let{versionLabel:t,to:n,onClick:s}=e;return(0,u.jsx)(o.A,{id:"theme.docs.versions.latestVersionSuggestionLabel",description:"The label used to tell the user to check the latest version",values:{versionLabel:t,latestVersionLink:(0,u.jsx)("b",{children:(0,u.jsx)(i.A,{to:n,onClick:s,children:(0,u.jsx)(o.A,{id:"theme.docs.versions.latestVersionLinkLabel",description:"The label used for the latest version suggestion link label",children:"latest version"})})})},children:"For up-to-date documentation, see the {latestVersionLink} ({versionLabel})."})}function b(e){let{className:t,versionMetadata:n}=e;const{siteConfig:{title:i}}=(0,a.A)(),{pluginId:o}=(0,l.vT)({failfast:!0}),{savePreferredVersionName:d}=(0,c.g1)(o),{latestDocSuggestion:m,latestVersionSuggestion:b}=(0,l.HW)(o),x=m??(f=b).docs.find((e=>e.id===f.mainDocId));var f;return(0,u.jsxs)("div",{className:(0,s.A)(t,r.G.docs.docVersionBanner,"alert alert--warning margin-bottom--md"),role:"alert",children:[(0,u.jsx)("div",{children:(0,u.jsx)(h,{siteTitle:i,versionMetadata:n})}),(0,u.jsx)("div",{className:"margin-top--md",children:(0,u.jsx)(v,{versionLabel:b.label,to:x.path,onClick:()=>d(b.name)})})]})}function x(e){let{className:t}=e;const n=(0,d.r)();return n.banner?(0,u.jsx)(b,{className:t,versionMetadata:n}):null}},7763:(e,t,n)=>{n.d(t,{A:()=>c});n(6540);var s=n(4164),a=n(5195);const i={tableOfContents:"tableOfContents_bqdL",docItemContainer:"docItemContainer_F8PC"};var o=n(4848);const l="table-of-contents__link toc-highlight",r="table-of-contents__link--active";function c(e){let{className:t,...n}=e;return(0,o.jsx)("div",{className:(0,s.A)(i.tableOfContents,"thin-scrollbar",t),children:(0,o.jsx)(a.A,{...n,linkClassName:l,linkActiveClassName:r})})}},5195:(e,t,n)=>{n.d(t,{A:()=>b});var s=n(6540),a=n(6342);function i(e){const t=e.map((e=>({...e,parentIndex:-1,children:[]}))),n=Array(7).fill(-1);t.forEach(((e,t)=>{const s=n.slice(2,e.level);e.parentIndex=Math.max(...s),n[e.level]=t}));const s=[];return t.forEach((e=>{const{parentIndex:n,...a}=e;n>=0?t[n].children.push(a):s.push(a)})),s}function o(e){let{toc:t,minHeadingLevel:n,maxHeadingLevel:s}=e;return t.flatMap((e=>{const t=o({toc:e.children,minHeadingLevel:n,maxHeadingLevel:s});return function(e){return e.level>=n&&e.level<=s}(e)?[{...e,children:t}]:t}))}function l(e){const t=e.getBoundingClientRect();return t.top===t.bottom?l(e.parentNode):t}function r(e,t){let{anchorTopOffset:n}=t;const s=e.find((e=>l(e).top>=n));if(s){return function(e){return e.top>0&&e.bottom {e.current=t?0:document.querySelector(".navbar").clientHeight}),[t]),e}function d(e){const t=(0,s.useRef)(void 0),n=c();(0,s.useEffect)((()=>{if(!e)return()=>{};const{linkClassName:s,linkActiveClassName:a,minHeadingLevel:i,maxHeadingLevel:o}=e;function l(){const e=function(e){return Array.from(document.getElementsByClassName(e))}(s),l=function(e){let{minHeadingLevel:t,maxHeadingLevel:n}=e;const s=[];for(let a=t;a<=n;a+=1)s.push(`h${a}.anchor`);return Array.from(document.querySelectorAll(s.join()))}({minHeadingLevel:i,maxHeadingLevel:o}),c=r(l,{anchorTopOffset:n.current}),d=e.find((e=>c&&c.id===function(e){return decodeURIComponent(e.href.substring(e.href.indexOf("#")+1))}(e)));e.forEach((e=>{!function(e,n){n?(t.current&&t.current!==e&&t.current.classList.remove(a),e.classList.add(a),t.current=e):e.classList.remove(a)}(e,e===d)}))}return document.addEventListener("scroll",l),document.addEventListener("resize",l),l(),()=>{document.removeEventListener("scroll",l),document.removeEventListener("resize",l)}}),[e,n])}var u=n(8774),m=n(4848);function h(e){let{toc:t,className:n,linkClassName:s,isChild:a}=e;return t.length?(0,m.jsx)("ul",{className:a?void 0:n,children:t.map((e=>(0,m.jsxs)("li",{children:[(0,m.jsx)(u.A,{to:`#${e.id}`,className:s??void 0,dangerouslySetInnerHTML:{__html:e.value}}),(0,m.jsx)(h,{isChild:!0,toc:e.children,className:n,linkClassName:s})]},e.id)))}):null}const v=s.memo(h);function b(e){let{toc:t,className:n="table-of-contents table-of-contents__left-border",linkClassName:l="table-of-contents__link",linkActiveClassName:r,minHeadingLevel:c,maxHeadingLevel:u,...h}=e;const b=(0,a.p)(),x=c??b.tableOfContents.minHeadingLevel,f=u??b.tableOfContents.maxHeadingLevel,p=function(e){let{toc:t,minHeadingLevel:n,maxHeadingLevel:a}=e;return(0,s.useMemo)((()=>o({toc:i(t),minHeadingLevel:n,maxHeadingLevel:a})),[t,n,a])}({toc:t,minHeadingLevel:x,maxHeadingLevel:f});return d((0,s.useMemo)((()=>{if(l&&r)return{linkClassName:l,linkActiveClassName:r,minHeadingLevel:x,maxHeadingLevel:f}}),[l,r,x,f])),(0,m.jsx)(v,{toc:p,className:n,linkClassName:l,...h})}},4084:(e,t,n)=>{n.d(t,{AE:()=>r,Rc:()=>o,TT:()=>d,Uh:()=>l,Yh:()=>c});n(6540);var s=n(1312),a=n(5260),i=n(4848);function o(){return(0,i.jsx)(s.A,{id:"theme.contentVisibility.unlistedBanner.title",description:"The unlisted content banner title",children:"Unlisted page"})}function l(){return(0,i.jsx)(s.A,{id:"theme.contentVisibility.unlistedBanner.message",description:"The unlisted content banner message",children:"This page is unlisted. Search engines will not index it, and only users having a direct link can access it."})}function r(){return(0,i.jsx)(a.A,{children:(0,i.jsx)("meta",{name:"robots",content:"noindex, nofollow"})})}function c(){return(0,i.jsx)(s.A,{id:"theme.contentVisibility.draftBanner.title",description:"The draft content banner title",children:"Draft page"})}function d(){return(0,i.jsx)(s.A,{id:"theme.contentVisibility.draftBanner.message",description:"The draft content banner message",children:"This page is a draft. It will only be visible in dev and be excluded from the production build."})}}}]); \ No newline at end of file diff --git a/assets/js/17896441.0e3dc5a0.js b/assets/js/17896441.0e3dc5a0.js deleted file mode 100644 index 5326ed0d..00000000 --- a/assets/js/17896441.0e3dc5a0.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[8401],{8811:(e,t,n)=>{n.d(t,{A:()=>c});n(6540);var s=n(4164),a=n(6907),i=n(8630),o=n(4182),l=n(4848);function r(e){let{className:t}=e;return(0,l.jsx)(o.A,{type:"caution",title:(0,l.jsx)(a.Rc,{}),className:(0,s.A)(t,i.G.common.unlistedBanner),children:(0,l.jsx)(a.Uh,{})})}function c(e){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(a.AE,{}),(0,l.jsx)(r,{...e})]})}},4648:(e,t,n)=>{n.d(t,{A:()=>d});n(6540);var s=n(4164),a=n(6907),i=n(8630),o=n(4182),l=n(4848);function r(e){let{className:t}=e;return(0,l.jsx)(o.A,{type:"caution",title:(0,l.jsx)(a.Yh,{}),className:(0,s.A)(t,i.G.common.draftBanner),children:(0,l.jsx)(a.TT,{})})}var c=n(8811);function d(e){let{metadata:t}=e;const{unlisted:n,frontMatter:s}=t;return(0,l.jsxs)(l.Fragment,{children:[(n||s.unlisted)&&(0,l.jsx)(c.A,{}),s.draft&&(0,l.jsx)(r,{})]})}},4168:(e,t,n)=>{n.d(t,{A:()=>f});n(6540);var s=n(4164),a=n(8630),i=n(5357),o=n(260),l=n(4783),r=n(3230),c=n(8180),d=n(4848);function u(e){return(0,d.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,d.jsx)("path",{d:"M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z",fill:"currentColor"})})}const m={breadcrumbHomeIcon:"breadcrumbHomeIcon_YNFT"};function h(){const e=(0,c.Ay)("/");return(0,d.jsx)("li",{className:"breadcrumbs__item",children:(0,d.jsx)(l.A,{"aria-label":(0,r.T)({id:"theme.docs.breadcrumbs.home",message:"Home page",description:"The ARIA label for the home page in the breadcrumbs"}),className:"breadcrumbs__link",href:e,children:(0,d.jsx)(u,{className:m.breadcrumbHomeIcon})})})}const v={breadcrumbsContainer:"breadcrumbsContainer_Z_bl"};function b(e){let{children:t,href:n,isLast:s}=e;const a="breadcrumbs__link";return s?(0,d.jsx)("span",{className:a,itemProp:"name",children:t}):n?(0,d.jsx)(l.A,{className:a,href:n,itemProp:"item",children:(0,d.jsx)("span",{itemProp:"name",children:t})}):(0,d.jsx)("span",{className:a,children:t})}function x(e){let{children:t,active:n,index:a,addMicrodata:i}=e;return(0,d.jsxs)("li",{...i&&{itemScope:!0,itemProp:"itemListElement",itemType:"https://schema.org/ListItem"},className:(0,s.A)("breadcrumbs__item",{"breadcrumbs__item--active":n}),children:[t,(0,d.jsx)("meta",{itemProp:"position",content:String(a+1)})]})}function f(){const e=(0,i.OF)(),t=(0,o.Dt)();return e?(0,d.jsx)("nav",{className:(0,s.A)(a.G.docs.docBreadcrumbs,v.breadcrumbsContainer),"aria-label":(0,r.T)({id:"theme.docs.breadcrumbs.navAriaLabel",message:"Breadcrumbs",description:"The ARIA label for the breadcrumbs"}),children:(0,d.jsxs)("ul",{className:"breadcrumbs",itemScope:!0,itemType:"https://schema.org/BreadcrumbList",children:[t&&(0,d.jsx)(h,{}),e.map(((t,n)=>{const s=n===e.length-1,a="category"===t.type&&t.linkUnlisted?void 0:t.href;return(0,d.jsx)(x,{active:s,index:n,addMicrodata:!!a,children:(0,d.jsx)(b,{href:a,isLast:s,children:t.label})},n)}))]})}):null}},2239:(e,t,n)=>{n.r(t),n.d(t,{default:()=>P});var s=n(6540),a=n(6644),i=n(4799),o=n(4848);const l=s.createContext(null);function r(e){let{children:t,content:n}=e;const a=function(e){return(0,s.useMemo)((()=>({metadata:e.metadata,frontMatter:e.frontMatter,assets:e.assets,contentTitle:e.contentTitle,toc:e.toc})),[e])}(n);return(0,o.jsx)(l.Provider,{value:a,children:t})}function c(){const e=(0,s.useContext)(l);if(null===e)throw new i.dV("DocProvider");return e}function d(){const{metadata:e,frontMatter:t,assets:n}=c();return(0,o.jsx)(a.be,{title:e.title,description:e.description,keywords:t.keywords,image:n.image??t.image})}var u=n(4164),m=n(2216),h=n(3682);function v(){const{metadata:e}=c();return(0,o.jsx)(h.A,{previous:e.previous,next:e.next})}var b=n(7180),x=n(9436),f=n(8630),p=n(1113),g=n(5659);function j(){const{metadata:e}=c(),{editUrl:t,lastUpdatedAt:n,lastUpdatedBy:s,tags:a}=e,i=a.length>0,l=!!(t||n||s);return i||l?(0,o.jsxs)("footer",{className:(0,u.A)(f.G.docs.docFooter,"docusaurus-mt-lg"),children:[i&&(0,o.jsx)("div",{className:(0,u.A)("row margin-top--sm",f.G.docs.docFooterTagsRow),children:(0,o.jsx)("div",{className:"col",children:(0,o.jsx)(p.A,{tags:a})})}),l&&(0,o.jsx)(g.A,{className:(0,u.A)("margin-top--sm",f.G.docs.docFooterEditMetaRow),editUrl:t,lastUpdatedAt:n,lastUpdatedBy:s})]}):null}var A=n(4549),L=n(1507),C=n(3230);const N={tocCollapsibleButton:"tocCollapsibleButton_TO0P",tocCollapsibleButtonExpanded:"tocCollapsibleButtonExpanded_MG3E"};function _(e){let{collapsed:t,...n}=e;return(0,o.jsx)("button",{type:"button",...n,className:(0,u.A)("clean-btn",N.tocCollapsibleButton,!t&&N.tocCollapsibleButtonExpanded,n.className),children:(0,o.jsx)(C.A,{id:"theme.TOCCollapsible.toggleButtonLabel",description:"The label used by the button on the collapsible TOC component",children:"On this page"})})}const T={tocCollapsible:"tocCollapsible_ETCw",tocCollapsibleContent:"tocCollapsibleContent_vkbj",tocCollapsibleExpanded:"tocCollapsibleExpanded_sAul"};function k(e){let{toc:t,className:n,minHeadingLevel:s,maxHeadingLevel:a}=e;const{collapsed:i,toggleCollapsed:l}=(0,A.u)({initialState:!0});return(0,o.jsxs)("div",{className:(0,u.A)(T.tocCollapsible,!i&&T.tocCollapsibleExpanded,n),children:[(0,o.jsx)(_,{collapsed:i,onClick:l}),(0,o.jsx)(A.N,{lazy:!0,className:T.tocCollapsibleContent,collapsed:i,children:(0,o.jsx)(L.A,{toc:t,minHeadingLevel:s,maxHeadingLevel:a})})]})}const H={tocMobile:"tocMobile_ITEo"};function y(){const{toc:e,frontMatter:t}=c();return(0,o.jsx)(k,{toc:e,minHeadingLevel:t.toc_min_heading_level,maxHeadingLevel:t.toc_max_heading_level,className:(0,u.A)(f.G.docs.docTocMobile,H.tocMobile)})}var M=n(8793);function B(){const{toc:e,frontMatter:t}=c();return(0,o.jsx)(M.A,{toc:e,minHeadingLevel:t.toc_min_heading_level,maxHeadingLevel:t.toc_max_heading_level,className:f.G.docs.docTocDesktop})}var I=n(5225),w=n(600);function E(e){let{children:t}=e;const n=function(){const{metadata:e,frontMatter:t,contentTitle:n}=c();return t.hide_title||void 0!==n?null:e.title}();return(0,o.jsxs)("div",{className:(0,u.A)(f.G.docs.docMarkdown,"markdown"),children:[n&&(0,o.jsx)("header",{children:(0,o.jsx)(I.A,{as:"h1",children:n})}),(0,o.jsx)(w.A,{children:t})]})}var V=n(4168),O=n(4648);const G={docItemContainer:"docItemContainer_Djhp",docItemCol:"docItemCol_VOVn"};function S(e){let{children:t}=e;const n=function(){const{frontMatter:e,toc:t}=c(),n=(0,m.l)(),s=e.hide_table_of_contents,a=!s&&t.length>0;return{hidden:s,mobile:a?(0,o.jsx)(y,{}):void 0,desktop:!a||"desktop"!==n&&"ssr"!==n?void 0:(0,o.jsx)(B,{})}}(),{metadata:s}=c();return(0,o.jsxs)("div",{className:"row",children:[(0,o.jsxs)("div",{className:(0,u.A)("col",!n.hidden&&G.docItemCol),children:[(0,o.jsx)(O.A,{metadata:s}),(0,o.jsx)(b.A,{}),(0,o.jsxs)("div",{className:G.docItemContainer,children:[(0,o.jsxs)("article",{children:[(0,o.jsx)(V.A,{}),(0,o.jsx)(x.A,{}),n.mobile,(0,o.jsx)(E,{children:t}),(0,o.jsx)(j,{})]}),(0,o.jsx)(v,{})]})]}),n.desktop&&(0,o.jsx)("div",{className:"col col--3",children:n.desktop})]})}function P(e){const t=`docs-doc-id-${e.content.metadata.id}`,n=e.content;return(0,o.jsx)(r,{content:e.content,children:(0,o.jsxs)(a.e3,{className:t,children:[(0,o.jsx)(d,{}),(0,o.jsx)(S,{children:(0,o.jsx)(n,{})})]})})}},3682:(e,t,n)=>{n.d(t,{A:()=>o});n(6540);var s=n(3230),a=n(3555),i=n(4848);function o(e){const{previous:t,next:n}=e;return(0,i.jsxs)("nav",{className:"pagination-nav docusaurus-mt-lg","aria-label":(0,s.T)({id:"theme.docs.paginator.navAriaLabel",message:"Docs pages",description:"The ARIA label for the docs pagination"}),children:[t&&(0,i.jsx)(a.A,{...t,subLabel:(0,i.jsx)(s.A,{id:"theme.docs.paginator.previous",description:"The label used to navigate to the previous doc",children:"Previous"})}),n&&(0,i.jsx)(a.A,{...n,subLabel:(0,i.jsx)(s.A,{id:"theme.docs.paginator.next",description:"The label used to navigate to the next doc",children:"Next"}),isNext:!0})]})}},9436:(e,t,n)=>{n.d(t,{A:()=>r});n(6540);var s=n(4164),a=n(3230),i=n(8630),o=n(1704),l=n(4848);function r(e){let{className:t}=e;const n=(0,o.r)();return n.badge?(0,l.jsx)("span",{className:(0,s.A)(t,i.G.docs.docVersionBadge,"badge badge--secondary"),children:(0,l.jsx)(a.A,{id:"theme.docs.versionBadge.label",values:{versionLabel:n.label},children:"Version: {versionLabel}"})}):null}},7180:(e,t,n)=>{n.d(t,{A:()=>x});n(6540);var s=n(4164),a=n(7639),i=n(4783),o=n(3230),l=n(4721),r=n(8630),c=n(6457),d=n(1704),u=n(4848);const m={unreleased:function(e){let{siteTitle:t,versionMetadata:n}=e;return(0,u.jsx)(o.A,{id:"theme.docs.versions.unreleasedVersionLabel",description:"The label used to tell the user that he's browsing an unreleased doc version",values:{siteTitle:t,versionLabel:(0,u.jsx)("b",{children:n.label})},children:"This is unreleased documentation for {siteTitle} {versionLabel} version."})},unmaintained:function(e){let{siteTitle:t,versionMetadata:n}=e;return(0,u.jsx)(o.A,{id:"theme.docs.versions.unmaintainedVersionLabel",description:"The label used to tell the user that he's browsing an unmaintained doc version",values:{siteTitle:t,versionLabel:(0,u.jsx)("b",{children:n.label})},children:"This is documentation for {siteTitle} {versionLabel}, which is no longer actively maintained."})}};function h(e){const t=m[e.versionMetadata.banner];return(0,u.jsx)(t,{...e})}function v(e){let{versionLabel:t,to:n,onClick:s}=e;return(0,u.jsx)(o.A,{id:"theme.docs.versions.latestVersionSuggestionLabel",description:"The label used to tell the user to check the latest version",values:{versionLabel:t,latestVersionLink:(0,u.jsx)("b",{children:(0,u.jsx)(i.A,{to:n,onClick:s,children:(0,u.jsx)(o.A,{id:"theme.docs.versions.latestVersionLinkLabel",description:"The label used for the latest version suggestion link label",children:"latest version"})})})},children:"For up-to-date documentation, see the {latestVersionLink} ({versionLabel})."})}function b(e){let{className:t,versionMetadata:n}=e;const{siteConfig:{title:i}}=(0,a.A)(),{pluginId:o}=(0,l.vT)({failfast:!0}),{savePreferredVersionName:d}=(0,c.g1)(o),{latestDocSuggestion:m,latestVersionSuggestion:b}=(0,l.HW)(o),x=m??(f=b).docs.find((e=>e.id===f.mainDocId));var f;return(0,u.jsxs)("div",{className:(0,s.A)(t,r.G.docs.docVersionBanner,"alert alert--warning margin-bottom--md"),role:"alert",children:[(0,u.jsx)("div",{children:(0,u.jsx)(h,{siteTitle:i,versionMetadata:n})}),(0,u.jsx)("div",{className:"margin-top--md",children:(0,u.jsx)(v,{versionLabel:b.label,to:x.path,onClick:()=>d(b.name)})})]})}function x(e){let{className:t}=e;const n=(0,d.r)();return n.banner?(0,u.jsx)(b,{className:t,versionMetadata:n}):null}},8793:(e,t,n)=>{n.d(t,{A:()=>c});n(6540);var s=n(4164),a=n(1507);const i={tableOfContents:"tableOfContents_bqdL",docItemContainer:"docItemContainer_F8PC"};var o=n(4848);const l="table-of-contents__link toc-highlight",r="table-of-contents__link--active";function c(e){let{className:t,...n}=e;return(0,o.jsx)("div",{className:(0,s.A)(i.tableOfContents,"thin-scrollbar",t),children:(0,o.jsx)(a.A,{...n,linkClassName:l,linkActiveClassName:r})})}},1507:(e,t,n)=>{n.d(t,{A:()=>b});var s=n(6540),a=n(6957);function i(e){const t=e.map((e=>({...e,parentIndex:-1,children:[]}))),n=Array(7).fill(-1);t.forEach(((e,t)=>{const s=n.slice(2,e.level);e.parentIndex=Math.max(...s),n[e.level]=t}));const s=[];return t.forEach((e=>{const{parentIndex:n,...a}=e;n>=0?t[n].children.push(a):s.push(a)})),s}function o(e){let{toc:t,minHeadingLevel:n,maxHeadingLevel:s}=e;return t.flatMap((e=>{const t=o({toc:e.children,minHeadingLevel:n,maxHeadingLevel:s});return function(e){return e.level>=n&&e.level<=s}(e)?[{...e,children:t}]:t}))}function l(e){const t=e.getBoundingClientRect();return t.top===t.bottom?l(e.parentNode):t}function r(e,t){let{anchorTopOffset:n}=t;const s=e.find((e=>l(e).top>=n));if(s){return function(e){return e.top>0&&e.bottom {e.current=t?0:document.querySelector(".navbar").clientHeight}),[t]),e}function d(e){const t=(0,s.useRef)(void 0),n=c();(0,s.useEffect)((()=>{if(!e)return()=>{};const{linkClassName:s,linkActiveClassName:a,minHeadingLevel:i,maxHeadingLevel:o}=e;function l(){const e=function(e){return Array.from(document.getElementsByClassName(e))}(s),l=function(e){let{minHeadingLevel:t,maxHeadingLevel:n}=e;const s=[];for(let a=t;a<=n;a+=1)s.push(`h${a}.anchor`);return Array.from(document.querySelectorAll(s.join()))}({minHeadingLevel:i,maxHeadingLevel:o}),c=r(l,{anchorTopOffset:n.current}),d=e.find((e=>c&&c.id===function(e){return decodeURIComponent(e.href.substring(e.href.indexOf("#")+1))}(e)));e.forEach((e=>{!function(e,n){n?(t.current&&t.current!==e&&t.current.classList.remove(a),e.classList.add(a),t.current=e):e.classList.remove(a)}(e,e===d)}))}return document.addEventListener("scroll",l),document.addEventListener("resize",l),l(),()=>{document.removeEventListener("scroll",l),document.removeEventListener("resize",l)}}),[e,n])}var u=n(4783),m=n(4848);function h(e){let{toc:t,className:n,linkClassName:s,isChild:a}=e;return t.length?(0,m.jsx)("ul",{className:a?void 0:n,children:t.map((e=>(0,m.jsxs)("li",{children:[(0,m.jsx)(u.A,{to:`#${e.id}`,className:s??void 0,dangerouslySetInnerHTML:{__html:e.value}}),(0,m.jsx)(h,{isChild:!0,toc:e.children,className:n,linkClassName:s})]},e.id)))}):null}const v=s.memo(h);function b(e){let{toc:t,className:n="table-of-contents table-of-contents__left-border",linkClassName:l="table-of-contents__link",linkActiveClassName:r,minHeadingLevel:c,maxHeadingLevel:u,...h}=e;const b=(0,a.p)(),x=c??b.tableOfContents.minHeadingLevel,f=u??b.tableOfContents.maxHeadingLevel,p=function(e){let{toc:t,minHeadingLevel:n,maxHeadingLevel:a}=e;return(0,s.useMemo)((()=>o({toc:i(t),minHeadingLevel:n,maxHeadingLevel:a})),[t,n,a])}({toc:t,minHeadingLevel:x,maxHeadingLevel:f});return d((0,s.useMemo)((()=>{if(l&&r)return{linkClassName:l,linkActiveClassName:r,minHeadingLevel:x,maxHeadingLevel:f}}),[l,r,x,f])),(0,m.jsx)(v,{toc:p,className:n,linkClassName:l,...h})}},6907:(e,t,n)=>{n.d(t,{AE:()=>r,Rc:()=>o,TT:()=>d,Uh:()=>l,Yh:()=>c});n(6540);var s=n(3230),a=n(1141),i=n(4848);function o(){return(0,i.jsx)(s.A,{id:"theme.contentVisibility.unlistedBanner.title",description:"The unlisted content banner title",children:"Unlisted page"})}function l(){return(0,i.jsx)(s.A,{id:"theme.contentVisibility.unlistedBanner.message",description:"The unlisted content banner message",children:"This page is unlisted. Search engines will not index it, and only users having a direct link can access it."})}function r(){return(0,i.jsx)(a.A,{children:(0,i.jsx)("meta",{name:"robots",content:"noindex, nofollow"})})}function c(){return(0,i.jsx)(s.A,{id:"theme.contentVisibility.draftBanner.title",description:"The draft content banner title",children:"Draft page"})}function d(){return(0,i.jsx)(s.A,{id:"theme.contentVisibility.draftBanner.message",description:"The draft content banner message",children:"This page is a draft. It will only be visible in dev and be excluded from the production build."})}}}]); \ No newline at end of file diff --git a/assets/js/1a4e3797.fa60ffd8.js b/assets/js/1a4e3797.19bd1aaa.js similarity index 91% rename from assets/js/1a4e3797.fa60ffd8.js rename to assets/js/1a4e3797.19bd1aaa.js index 8653cf1b..1e910f26 100644 --- a/assets/js/1a4e3797.fa60ffd8.js +++ b/assets/js/1a4e3797.19bd1aaa.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[2138],{7824:(e,t,r)=>{r.d(t,{W:()=>u});var s=r(6540),a=r(7639);const n=["zero","one","two","few","many","other"];function l(e){return n.filter((t=>e.includes(t)))}const c={locale:"en",pluralForms:l(["one","other"]),select:e=>1===e?"one":"other"};function o(){const{i18n:{currentLocale:e}}=(0,a.A)();return(0,s.useMemo)((()=>{try{return function(e){const t=new Intl.PluralRules(e);return{locale:e,pluralForms:l(t.resolvedOptions().pluralCategories),select:e=>t.select(e)}}(e)}catch(t){return console.error(`Failed to use Intl.PluralRules for locale "${e}".\nDocusaurus will fallback to the default (English) implementation.\nError: ${t.message}\n`),c}}),[e])}function u(){const e=o();return{selectMessage:(t,r)=>function(e,t,r){const s=e.split("|");if(1===s.length)return s[0];s.length>r.pluralForms.length&&console.error(`For locale=${r.locale}, a maximum of ${r.pluralForms.length} plural forms are expected (${r.pluralForms.join(",")}), but the message contains ${s.length}: ${e}`);const a=r.select(t),n=r.pluralForms.indexOf(a);return s[Math.min(n,s.length-1)]}(r,t,e)}}},5849:(e,t,r)=>{r.r(t),r.d(t,{default:()=>k});var s=r(6540),a=r(7639),n=r(7635),l=r(1141),c=r(4783),o=r(3230),u=r(7824),i=r(5391),h=r(6347),d=r(1062),m=r(5196);const g=function(){const e=(0,d.A)(),t=(0,h.W6)(),r=(0,h.zy)(),{siteConfig:{baseUrl:s}}=(0,a.A)(),n=e?new URLSearchParams(r.search):null,l=n?.get("q")||"",c=n?.get("ctx")||"",o=n?.get("version")||"",u=e=>{const t=new URLSearchParams(r.search);return e?t.set("q",e):t.delete("q"),t};return{searchValue:l,searchContext:c&&Array.isArray(m.Hg)&&m.Hg.some((e=>"string"==typeof e?e===c:e.path===c))?c:"",searchVersion:o,updateSearchPath:e=>{const r=u(e);t.replace({search:r.toString()})},updateSearchContext:e=>{const s=new URLSearchParams(r.search);s.set("ctx",e),t.replace({search:s.toString()})},generateSearchPageLink:e=>{const t=u(e);return`${s}search?${t.toString()}`}}};var p=r(1538),f=r(9950),x=r(3032),y=r(5928),j=r(6323),S=r(5990),A=r(5268);const C="searchContextInput_mXoe",w="searchQueryInput_CFBF",v="searchResultItem_U687",b="searchResultItemPath_uIbk",P="searchResultItemSummary_oZHr",_="searchQueryColumn_q7nx",F="searchContextColumn_oWAF";var R=r(4982),T=r(4848);function $(){const{siteConfig:{baseUrl:e},i18n:{currentLocale:t}}=(0,a.A)(),{selectMessage:r}=(0,u.W)(),{searchValue:n,searchContext:c,searchVersion:h,updateSearchPath:d,updateSearchContext:f}=g(),[x,y]=(0,s.useState)(n),[j,A]=(0,s.useState)(),v=`${e}${h}`,b=(0,s.useMemo)((()=>x?(0,o.T)({id:"theme.SearchPage.existingResultsTitle",message:'Search results for "{query}"',description:"The search page title for non-empty query"},{query:x}):(0,o.T)({id:"theme.SearchPage.emptyResultsTitle",message:"Search the documentation",description:"The search page title for empty query"})),[x]);(0,s.useEffect)((()=>{d(x),x?(async()=>{const e=await(0,p.w)(v,c,x);A(e)})():A(void 0)}),[x,v,c]);const P=(0,s.useCallback)((e=>{y(e.target.value)}),[]);(0,s.useEffect)((()=>{n&&n!==x&&y(n)}),[n]);const[$,k]=(0,s.useState)(!1);return(0,s.useEffect)((()=>{!async function(){(!Array.isArray(m.Hg)||c||m.dz)&&await(0,p.k)(v,c),k(!0)}()}),[c,v]),(0,T.jsxs)(s.Fragment,{children:[(0,T.jsxs)(l.A,{children:[(0,T.jsx)("meta",{property:"robots",content:"noindex, follow"}),(0,T.jsx)("title",{children:b})]}),(0,T.jsxs)("div",{className:"container margin-vert--lg",children:[(0,T.jsx)("h1",{children:b}),(0,T.jsxs)("div",{className:"row",children:[(0,T.jsx)("div",{className:(0,i.A)("col",{[_]:Array.isArray(m.Hg),"col--9":Array.isArray(m.Hg),"col--12":!Array.isArray(m.Hg)}),children:(0,T.jsx)("input",{type:"search",name:"q",className:w,"aria-label":"Search",onChange:P,value:x,autoComplete:"off",autoFocus:!0})}),Array.isArray(m.Hg)?(0,T.jsx)("div",{className:(0,i.A)("col","col--3","padding-left--none",F),children:(0,T.jsxs)("select",{name:"search-context",className:C,id:"context-selector",value:c,onChange:e=>f(e.target.value),children:[m.dz&&(0,T.jsx)("option",{value:"",children:(0,o.T)({id:"theme.SearchPage.searchContext.everywhere",message:"Everywhere"})}),m.Hg.map((e=>{const{label:r,path:s}=(0,R.p)(e,t);return(0,T.jsx)("option",{value:s,children:r},s)}))]})}):null]}),!$&&x&&(0,T.jsx)("div",{children:(0,T.jsx)(S.A,{})}),j&&(j.length>0?(0,T.jsx)("p",{children:r(j.length,(0,o.T)({id:"theme.SearchPage.documentsFound.plurals",message:"1 document found|{count} documents found",description:'Pluralized label for "{count} documents found". Use as much plural forms (separated by "|") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)'},{count:j.length}))}):(0,T.jsx)("p",{children:(0,o.T)({id:"theme.SearchPage.noResultsText",message:"No documents were found",description:"The paragraph for empty search result"})})),(0,T.jsx)("section",{children:j&&j.map((e=>(0,T.jsx)(H,{searchResult:e},e.document.i)))})]})]})}function H(e){let{searchResult:{document:t,type:r,page:s,tokens:a,metadata:n}}=e;const l=r===f.i.Title,o=r===f.i.Keywords,u=r===f.i.Description,i=u||o,h=l||i,d=r===f.i.Content,g=(l?t.b:s.b).slice(),p=d||i?t.s:t.t;h||g.push(s.t);let S="";if(m.CU&&a.length>0){const e=new URLSearchParams;for(const t of a)e.append("_highlight",t);S=`?${e.toString()}`}return(0,T.jsxs)("article",{className:v,children:[(0,T.jsx)("h2",{children:(0,T.jsx)(c.A,{to:t.u+S+(t.h||""),dangerouslySetInnerHTML:{__html:d||i?(0,x.Z)(p,a):(0,y.C)(p,(0,j.g)(n,"t"),a,100)}})}),g.length>0&&(0,T.jsx)("p",{className:b,children:(0,A.$)(g)}),(d||u)&&(0,T.jsx)("p",{className:P,dangerouslySetInnerHTML:{__html:(0,y.C)(t.t,(0,j.g)(n,"t"),a,100)}})]})}const k=function(){return(0,T.jsx)(n.A,{children:(0,T.jsx)($,{})})}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[2138],{5846:(e,t,r)=>{r.d(t,{W:()=>u});var s=r(6540),a=r(4586);const n=["zero","one","two","few","many","other"];function l(e){return n.filter((t=>e.includes(t)))}const c={locale:"en",pluralForms:l(["one","other"]),select:e=>1===e?"one":"other"};function o(){const{i18n:{currentLocale:e}}=(0,a.A)();return(0,s.useMemo)((()=>{try{return function(e){const t=new Intl.PluralRules(e);return{locale:e,pluralForms:l(t.resolvedOptions().pluralCategories),select:e=>t.select(e)}}(e)}catch(t){return console.error(`Failed to use Intl.PluralRules for locale "${e}".\nDocusaurus will fallback to the default (English) implementation.\nError: ${t.message}\n`),c}}),[e])}function u(){const e=o();return{selectMessage:(t,r)=>function(e,t,r){const s=e.split("|");if(1===s.length)return s[0];s.length>r.pluralForms.length&&console.error(`For locale=${r.locale}, a maximum of ${r.pluralForms.length} plural forms are expected (${r.pluralForms.join(",")}), but the message contains ${s.length}: ${e}`);const a=r.select(t),n=r.pluralForms.indexOf(a);return s[Math.min(n,s.length-1)]}(r,t,e)}}},1283:(e,t,r)=>{r.r(t),r.d(t,{default:()=>k});var s=r(6540),a=r(4586),n=r(7823),l=r(5260),c=r(8774),o=r(1312),u=r(5846),i=r(4164),h=r(6347),d=r(2303),m=r(4081);const g=function(){const e=(0,d.A)(),t=(0,h.W6)(),r=(0,h.zy)(),{siteConfig:{baseUrl:s}}=(0,a.A)(),n=e?new URLSearchParams(r.search):null,l=n?.get("q")||"",c=n?.get("ctx")||"",o=n?.get("version")||"",u=e=>{const t=new URLSearchParams(r.search);return e?t.set("q",e):t.delete("q"),t};return{searchValue:l,searchContext:c&&Array.isArray(m.Hg)&&m.Hg.some((e=>"string"==typeof e?e===c:e.path===c))?c:"",searchVersion:o,updateSearchPath:e=>{const r=u(e);t.replace({search:r.toString()})},updateSearchContext:e=>{const s=new URLSearchParams(r.search);s.set("ctx",e),t.replace({search:s.toString()})},generateSearchPageLink:e=>{const t=u(e);return`${s}search?${t.toString()}`}}};var p=r(9153),f=r(9913),x=r(6841),y=r(3810),j=r(7674),S=r(2849),A=r(4471);const C="searchContextInput_mXoe",w="searchQueryInput_CFBF",v="searchResultItem_U687",b="searchResultItemPath_uIbk",P="searchResultItemSummary_oZHr",_="searchQueryColumn_q7nx",F="searchContextColumn_oWAF";var R=r(3385),T=r(4848);function $(){const{siteConfig:{baseUrl:e},i18n:{currentLocale:t}}=(0,a.A)(),{selectMessage:r}=(0,u.W)(),{searchValue:n,searchContext:c,searchVersion:h,updateSearchPath:d,updateSearchContext:f}=g(),[x,y]=(0,s.useState)(n),[j,A]=(0,s.useState)(),v=`${e}${h}`,b=(0,s.useMemo)((()=>x?(0,o.T)({id:"theme.SearchPage.existingResultsTitle",message:'Search results for "{query}"',description:"The search page title for non-empty query"},{query:x}):(0,o.T)({id:"theme.SearchPage.emptyResultsTitle",message:"Search the documentation",description:"The search page title for empty query"})),[x]);(0,s.useEffect)((()=>{d(x),x?(async()=>{const e=await(0,p.w)(v,c,x);A(e)})():A(void 0)}),[x,v,c]);const P=(0,s.useCallback)((e=>{y(e.target.value)}),[]);(0,s.useEffect)((()=>{n&&n!==x&&y(n)}),[n]);const[$,k]=(0,s.useState)(!1);return(0,s.useEffect)((()=>{!async function(){(!Array.isArray(m.Hg)||c||m.dz)&&await(0,p.k)(v,c),k(!0)}()}),[c,v]),(0,T.jsxs)(s.Fragment,{children:[(0,T.jsxs)(l.A,{children:[(0,T.jsx)("meta",{property:"robots",content:"noindex, follow"}),(0,T.jsx)("title",{children:b})]}),(0,T.jsxs)("div",{className:"container margin-vert--lg",children:[(0,T.jsx)("h1",{children:b}),(0,T.jsxs)("div",{className:"row",children:[(0,T.jsx)("div",{className:(0,i.A)("col",{[_]:Array.isArray(m.Hg),"col--9":Array.isArray(m.Hg),"col--12":!Array.isArray(m.Hg)}),children:(0,T.jsx)("input",{type:"search",name:"q",className:w,"aria-label":"Search",onChange:P,value:x,autoComplete:"off",autoFocus:!0})}),Array.isArray(m.Hg)?(0,T.jsx)("div",{className:(0,i.A)("col","col--3","padding-left--none",F),children:(0,T.jsxs)("select",{name:"search-context",className:C,id:"context-selector",value:c,onChange:e=>f(e.target.value),children:[m.dz&&(0,T.jsx)("option",{value:"",children:(0,o.T)({id:"theme.SearchPage.searchContext.everywhere",message:"Everywhere"})}),m.Hg.map((e=>{const{label:r,path:s}=(0,R.p)(e,t);return(0,T.jsx)("option",{value:s,children:r},s)}))]})}):null]}),!$&&x&&(0,T.jsx)("div",{children:(0,T.jsx)(S.A,{})}),j&&(j.length>0?(0,T.jsx)("p",{children:r(j.length,(0,o.T)({id:"theme.SearchPage.documentsFound.plurals",message:"1 document found|{count} documents found",description:'Pluralized label for "{count} documents found". Use as much plural forms (separated by "|") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)'},{count:j.length}))}):(0,T.jsx)("p",{children:(0,o.T)({id:"theme.SearchPage.noResultsText",message:"No documents were found",description:"The paragraph for empty search result"})})),(0,T.jsx)("section",{children:j&&j.map((e=>(0,T.jsx)(H,{searchResult:e},e.document.i)))})]})]})}function H(e){let{searchResult:{document:t,type:r,page:s,tokens:a,metadata:n}}=e;const l=r===f.i.Title,o=r===f.i.Keywords,u=r===f.i.Description,i=u||o,h=l||i,d=r===f.i.Content,g=(l?t.b:s.b).slice(),p=d||i?t.s:t.t;h||g.push(s.t);let S="";if(m.CU&&a.length>0){const e=new URLSearchParams;for(const t of a)e.append("_highlight",t);S=`?${e.toString()}`}return(0,T.jsxs)("article",{className:v,children:[(0,T.jsx)("h2",{children:(0,T.jsx)(c.A,{to:t.u+S+(t.h||""),dangerouslySetInnerHTML:{__html:d||i?(0,x.Z)(p,a):(0,y.C)(p,(0,j.g)(n,"t"),a,100)}})}),g.length>0&&(0,T.jsx)("p",{className:b,children:(0,A.$)(g)}),(d||u)&&(0,T.jsx)("p",{className:P,dangerouslySetInnerHTML:{__html:(0,y.C)(t.t,(0,j.g)(n,"t"),a,100)}})]})}const k=function(){return(0,T.jsx)(n.A,{children:(0,T.jsx)($,{})})}}}]); \ No newline at end of file diff --git a/assets/js/1a5eac39.0b4fb100.js b/assets/js/1a5eac39.31cacb96.js similarity index 99% rename from assets/js/1a5eac39.0b4fb100.js rename to assets/js/1a5eac39.31cacb96.js index 948f8694..f7a2c7be 100644 --- a/assets/js/1a5eac39.0b4fb100.js +++ b/assets/js/1a5eac39.31cacb96.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[4215],{9807:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>r,contentTitle:()=>o,default:()=>h,frontMatter:()=>i,metadata:()=>l,toc:()=>c});const l=JSON.parse('{"id":"guides/handbook/namespacing","title":"Namespacing","description":"In the Classes chapter, we briefly explained the concept of using namespacing to avoid conflicts between stylesheets.","source":"@site/docs/guides/handbook/namespace.md","sourceDirName":"guides/handbook","slug":"/guides/handbook/namespacing","permalink":"/docs/guides/handbook/namespacing","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/guides/handbook/namespace.md","tags":[],"version":"current","frontMatter":{"id":"namespacing","title":"Namespacing"},"sidebar":"Guides","previous":{"title":"Classes","permalink":"/docs/guides/handbook/class"},"next":{"title":"Custom State","permalink":"/docs/guides/handbook/custom-state"}}');var a=n(4848),t=n(8453);const i={id:"namespacing",title:"Namespacing"},o=void 0,r={},c=[{value:"Supported symbols",id:"supported-symbols",level:2},{value:"Global",id:"global",level:2},{value:"Disable in selector",id:"disable-in-selector",level:3},{value:"Defining global symbols",id:"defining-global-symbols",level:3},{value:"Stylesheet level namespacing",id:"stylesheet-level-namespacing",level:2},{value:"Project level namespacing",id:"project-level-namespacing",level:2}];function d(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,t.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(s.p,{children:["In the ",(0,a.jsx)(s.a,{href:"/docs/guides/handbook/class#resolve-global-conflicts",children:"Classes chapter"}),", we briefly explained the concept of using namespacing to avoid conflicts between stylesheets."]}),"\n",(0,a.jsx)(s.p,{children:"In this chapter, we'll dive deeper to see how other symbols in CSS can be rendered safe to use, and how namespacing can be controlled."}),"\n",(0,a.jsx)(s.h2,{id:"supported-symbols",children:"Supported symbols"}),"\n",(0,a.jsx)(s.p,{children:"We've only mentioned classes up to this point, but in CSS, there are many other symbols that share the same naming context, therefore requiring namespacing to avoid potential conflicts."}),"\n",(0,a.jsx)(s.p,{children:"Symbols that Stylable namespaces:"}),"\n",(0,a.jsxs)(s.table,{children:[(0,a.jsx)(s.thead,{children:(0,a.jsxs)(s.tr,{children:[(0,a.jsx)(s.th,{children:"Symbol"}),(0,a.jsx)(s.th,{children:"Source"}),(0,a.jsx)(s.th,{children:"Target"})]})}),(0,a.jsxs)(s.tbody,{children:[(0,a.jsxs)(s.tr,{children:[(0,a.jsx)(s.td,{children:"Class"}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:".okButton"})}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:".NAMESPACE__okButton"})})]}),(0,a.jsxs)(s.tr,{children:[(0,a.jsx)(s.td,{children:"Custom property"}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"--bgColor"})}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"--NAMESPACE-bgColor"})})]}),(0,a.jsxs)(s.tr,{children:[(0,a.jsx)(s.td,{children:"Keyframes"}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"@keyframes slide"})}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"@keyframes NAMESPACE__slide"})})]}),(0,a.jsxs)(s.tr,{children:[(0,a.jsx)(s.td,{children:"Layer"}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"@layer theme"})}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"@layer NAMESPACE__theme"})})]}),(0,a.jsxs)(s.tr,{children:[(0,a.jsx)(s.td,{children:"Container"}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"container: panel"})}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"container: NAMESPACE__panel"})})]})]})]}),"\n",(0,a.jsx)(s.admonition,{type:"note",children:(0,a.jsxs)(s.p,{children:["Stylable does not namespace ",(0,a.jsx)(s.code,{children:"id"}),", ",(0,a.jsx)(s.code,{children:"custom-element"}),", ",(0,a.jsx)(s.code,{children:"attribute"}),", or other symbols at the moment, but may add additional symbol namespacing support in the future."]})}),"\n",(0,a.jsx)(s.h2,{id:"global",children:"Global"}),"\n",(0,a.jsx)(s.p,{children:"In some cases, we might want to avoid namespacing for a specific symbol."}),"\n",(0,a.jsx)(s.p,{children:"For example:"}),"\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsx)(s.li,{children:"To style a third-party component that is using pre-determined global class names."}),"\n",(0,a.jsx)(s.li,{children:"To expose a persistent, globally-namespaced API for non-Stylable consumers that are using our project."}),"\n"]}),"\n",(0,a.jsx)(s.h3,{id:"disable-in-selector",children:"Disable in selector"}),"\n",(0,a.jsxs)(s.p,{children:["To avoid namespacing on classes in a selector, wrap those classes with a ",(0,a.jsx)(s.code,{children:":global(...)"})," pseudo-class."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="game.st.css"',children:".player:global(.highlight) {\n background: yellow;\n}\n\n/* OUTPUT */\n.game__player.highlight {\n background: yellow;\n}\n"})}),"\n",(0,a.jsx)(s.admonition,{type:"caution",children:(0,a.jsxs)(s.p,{children:["Classes used within the ",(0,a.jsx)(s.code,{children:":global(...)"})," pseudo-class are not treated as symbols in the stylesheet, and are not exported. This means that they are not available for use in other stylesheets or in the runtime JavaScript module."]})}),"\n",(0,a.jsx)(s.h3,{id:"defining-global-symbols",children:"Defining global symbols"}),"\n",(0,a.jsxs)(s.p,{children:["We can avoid namespacing for all symbols (except classes) by using the ",(0,a.jsx)(s.code,{children:"st-global()"})," function:"]}),"\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.code,{children:"@property st-global(--bgColor)"})," - ",(0,a.jsx)(s.a,{href:"../../references/css-vars#disable-namespace",children:"read more"})]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.code,{children:"@keyframes st-global(slide)"})," - ",(0,a.jsx)(s.a,{href:"../../references/keyframes#disable-namespace",children:"read more"})]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.code,{children:"@layer st-global(theme)"})," - ",(0,a.jsx)(s.a,{href:"../../references/layer#disable-namespace",children:"read more"})]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.code,{children:"container: st-global(panel)"})," - ",(0,a.jsx)(s.a,{href:"../../references/contains#disable-namespace",children:"read more"})]}),"\n"]}),"\n",(0,a.jsxs)(s.p,{children:["Unlike the other symbols that are mapped from a local name to their global one, when we map a class using ",(0,a.jsx)(s.code,{children:"-st-global"}),", we can define a global selector that will replace it."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",children:".player {\n -st-global: '.myGame__player';\n}\n"})}),"\n",(0,a.jsxs)(s.p,{children:["Notice that in this case, we are mapping our ",(0,a.jsx)(s.code,{children:"player"})," class to a ",(0,a.jsx)(s.code,{children:".myGame__player"})," class selector. This is because classes can be mapped to any selector, including multiple classes, elements, attributes, and other CSS selector parts."]}),"\n",(0,a.jsx)(s.h2,{id:"stylesheet-level-namespacing",children:"Stylesheet level namespacing"}),"\n",(0,a.jsx)(s.p,{children:"By default, namespacing is derived in Stylable using the stylesheet filename, but in some edge cases we might want to override this behavior."}),"\n",(0,a.jsxs)(s.p,{children:["To do so, we can use the ",(0,a.jsx)(s.code,{children:"@st-namespace 'OverrideNamespace';"})," definition. ",(0,a.jsx)(s.a,{href:"/docs/references/namespace",children:"Click here"})," to read more about the namespace API."]}),"\n",(0,a.jsx)(s.h2,{id:"project-level-namespacing",children:"Project level namespacing"}),"\n",(0,a.jsxs)(s.p,{children:["On a more general level, we can have granular control of Stylable's namespacing process by passing a ",(0,a.jsx)(s.a,{href:"../../getting-started/stylable-config",children:"custom namespace resolver"})," to Stylable at initialization using configuration."]})]})}function h(e={}){const{wrapper:s}={...(0,t.R)(),...e.components};return s?(0,a.jsx)(s,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},8453:(e,s,n)=>{n.d(s,{R:()=>i,x:()=>o});var l=n(6540);const a={},t=l.createContext(a);function i(e){const s=l.useContext(t);return l.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function o(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:i(e.components),l.createElement(t.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[4215],{7189:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>r,contentTitle:()=>o,default:()=>h,frontMatter:()=>i,metadata:()=>l,toc:()=>c});const l=JSON.parse('{"id":"guides/handbook/namespacing","title":"Namespacing","description":"In the Classes chapter, we briefly explained the concept of using namespacing to avoid conflicts between stylesheets.","source":"@site/docs/guides/handbook/namespace.md","sourceDirName":"guides/handbook","slug":"/guides/handbook/namespacing","permalink":"/docs/guides/handbook/namespacing","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/guides/handbook/namespace.md","tags":[],"version":"current","frontMatter":{"id":"namespacing","title":"Namespacing"},"sidebar":"Guides","previous":{"title":"Classes","permalink":"/docs/guides/handbook/class"},"next":{"title":"Custom State","permalink":"/docs/guides/handbook/custom-state"}}');var a=n(4848),t=n(8453);const i={id:"namespacing",title:"Namespacing"},o=void 0,r={},c=[{value:"Supported symbols",id:"supported-symbols",level:2},{value:"Global",id:"global",level:2},{value:"Disable in selector",id:"disable-in-selector",level:3},{value:"Defining global symbols",id:"defining-global-symbols",level:3},{value:"Stylesheet level namespacing",id:"stylesheet-level-namespacing",level:2},{value:"Project level namespacing",id:"project-level-namespacing",level:2}];function d(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,t.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(s.p,{children:["In the ",(0,a.jsx)(s.a,{href:"/docs/guides/handbook/class#resolve-global-conflicts",children:"Classes chapter"}),", we briefly explained the concept of using namespacing to avoid conflicts between stylesheets."]}),"\n",(0,a.jsx)(s.p,{children:"In this chapter, we'll dive deeper to see how other symbols in CSS can be rendered safe to use, and how namespacing can be controlled."}),"\n",(0,a.jsx)(s.h2,{id:"supported-symbols",children:"Supported symbols"}),"\n",(0,a.jsx)(s.p,{children:"We've only mentioned classes up to this point, but in CSS, there are many other symbols that share the same naming context, therefore requiring namespacing to avoid potential conflicts."}),"\n",(0,a.jsx)(s.p,{children:"Symbols that Stylable namespaces:"}),"\n",(0,a.jsxs)(s.table,{children:[(0,a.jsx)(s.thead,{children:(0,a.jsxs)(s.tr,{children:[(0,a.jsx)(s.th,{children:"Symbol"}),(0,a.jsx)(s.th,{children:"Source"}),(0,a.jsx)(s.th,{children:"Target"})]})}),(0,a.jsxs)(s.tbody,{children:[(0,a.jsxs)(s.tr,{children:[(0,a.jsx)(s.td,{children:"Class"}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:".okButton"})}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:".NAMESPACE__okButton"})})]}),(0,a.jsxs)(s.tr,{children:[(0,a.jsx)(s.td,{children:"Custom property"}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"--bgColor"})}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"--NAMESPACE-bgColor"})})]}),(0,a.jsxs)(s.tr,{children:[(0,a.jsx)(s.td,{children:"Keyframes"}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"@keyframes slide"})}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"@keyframes NAMESPACE__slide"})})]}),(0,a.jsxs)(s.tr,{children:[(0,a.jsx)(s.td,{children:"Layer"}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"@layer theme"})}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"@layer NAMESPACE__theme"})})]}),(0,a.jsxs)(s.tr,{children:[(0,a.jsx)(s.td,{children:"Container"}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"container: panel"})}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"container: NAMESPACE__panel"})})]})]})]}),"\n",(0,a.jsx)(s.admonition,{type:"note",children:(0,a.jsxs)(s.p,{children:["Stylable does not namespace ",(0,a.jsx)(s.code,{children:"id"}),", ",(0,a.jsx)(s.code,{children:"custom-element"}),", ",(0,a.jsx)(s.code,{children:"attribute"}),", or other symbols at the moment, but may add additional symbol namespacing support in the future."]})}),"\n",(0,a.jsx)(s.h2,{id:"global",children:"Global"}),"\n",(0,a.jsx)(s.p,{children:"In some cases, we might want to avoid namespacing for a specific symbol."}),"\n",(0,a.jsx)(s.p,{children:"For example:"}),"\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsx)(s.li,{children:"To style a third-party component that is using pre-determined global class names."}),"\n",(0,a.jsx)(s.li,{children:"To expose a persistent, globally-namespaced API for non-Stylable consumers that are using our project."}),"\n"]}),"\n",(0,a.jsx)(s.h3,{id:"disable-in-selector",children:"Disable in selector"}),"\n",(0,a.jsxs)(s.p,{children:["To avoid namespacing on classes in a selector, wrap those classes with a ",(0,a.jsx)(s.code,{children:":global(...)"})," pseudo-class."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="game.st.css"',children:".player:global(.highlight) {\n background: yellow;\n}\n\n/* OUTPUT */\n.game__player.highlight {\n background: yellow;\n}\n"})}),"\n",(0,a.jsx)(s.admonition,{type:"caution",children:(0,a.jsxs)(s.p,{children:["Classes used within the ",(0,a.jsx)(s.code,{children:":global(...)"})," pseudo-class are not treated as symbols in the stylesheet, and are not exported. This means that they are not available for use in other stylesheets or in the runtime JavaScript module."]})}),"\n",(0,a.jsx)(s.h3,{id:"defining-global-symbols",children:"Defining global symbols"}),"\n",(0,a.jsxs)(s.p,{children:["We can avoid namespacing for all symbols (except classes) by using the ",(0,a.jsx)(s.code,{children:"st-global()"})," function:"]}),"\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.code,{children:"@property st-global(--bgColor)"})," - ",(0,a.jsx)(s.a,{href:"../../references/css-vars#disable-namespace",children:"read more"})]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.code,{children:"@keyframes st-global(slide)"})," - ",(0,a.jsx)(s.a,{href:"../../references/keyframes#disable-namespace",children:"read more"})]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.code,{children:"@layer st-global(theme)"})," - ",(0,a.jsx)(s.a,{href:"../../references/layer#disable-namespace",children:"read more"})]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.code,{children:"container: st-global(panel)"})," - ",(0,a.jsx)(s.a,{href:"../../references/contains#disable-namespace",children:"read more"})]}),"\n"]}),"\n",(0,a.jsxs)(s.p,{children:["Unlike the other symbols that are mapped from a local name to their global one, when we map a class using ",(0,a.jsx)(s.code,{children:"-st-global"}),", we can define a global selector that will replace it."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",children:".player {\n -st-global: '.myGame__player';\n}\n"})}),"\n",(0,a.jsxs)(s.p,{children:["Notice that in this case, we are mapping our ",(0,a.jsx)(s.code,{children:"player"})," class to a ",(0,a.jsx)(s.code,{children:".myGame__player"})," class selector. This is because classes can be mapped to any selector, including multiple classes, elements, attributes, and other CSS selector parts."]}),"\n",(0,a.jsx)(s.h2,{id:"stylesheet-level-namespacing",children:"Stylesheet level namespacing"}),"\n",(0,a.jsx)(s.p,{children:"By default, namespacing is derived in Stylable using the stylesheet filename, but in some edge cases we might want to override this behavior."}),"\n",(0,a.jsxs)(s.p,{children:["To do so, we can use the ",(0,a.jsx)(s.code,{children:"@st-namespace 'OverrideNamespace';"})," definition. ",(0,a.jsx)(s.a,{href:"/docs/references/namespace",children:"Click here"})," to read more about the namespace API."]}),"\n",(0,a.jsx)(s.h2,{id:"project-level-namespacing",children:"Project level namespacing"}),"\n",(0,a.jsxs)(s.p,{children:["On a more general level, we can have granular control of Stylable's namespacing process by passing a ",(0,a.jsx)(s.a,{href:"../../getting-started/stylable-config",children:"custom namespace resolver"})," to Stylable at initialization using configuration."]})]})}function h(e={}){const{wrapper:s}={...(0,t.R)(),...e.components};return s?(0,a.jsx)(s,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},8453:(e,s,n)=>{n.d(s,{R:()=>i,x:()=>o});var l=n(6540);const a={},t=l.createContext(a);function i(e){const s=l.useContext(t);return l.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function o(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:i(e.components),l.createElement(t.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/1df93b7f.4fe2d858.js b/assets/js/1df93b7f.ad4a7afe.js similarity index 98% rename from assets/js/1df93b7f.4fe2d858.js rename to assets/js/1df93b7f.ad4a7afe.js index 0abd2bc6..3960b730 100644 --- a/assets/js/1df93b7f.4fe2d858.js +++ b/assets/js/1df93b7f.ad4a7afe.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[4583],{6114:(e,t,s)=>{},4183:(e,t,s)=>{s(6114)},5797:(e,t,s)=>{s.d(t,{X:()=>m});var a=s(6540),l=s(8180),i=s(4783),n=s(3013);const r="feature",o=(...e)=>(0,n.rx)(r,...e),c=o,h={root:"feature__root",title:"feature__title",image:"feature__image",imageWrapper:"feature__imageWrapper"};var d=s(4848);function m(e){let{className:t,image:s,title:n,children:r,link:o}=e;const m="string"==typeof s?(0,l.Ay)(s):"",q=a.useMemo((()=>s?"string"==typeof s?(0,d.jsx)("div",{className:h.imageWrapper,children:(0,d.jsx)("img",{className:h.image,src:m,alt:n})}):(0,d.jsx)("div",{className:h.imageWrapper,children:s(h.image)}):null),[s,m]);return(0,d.jsxs)("div",{className:c(h.root,"col col--4",t),children:[o?(0,d.jsxs)(i.A,{href:o,children:[q,(0,d.jsx)("h3",{className:h.title,children:n})]}):(0,d.jsxs)(d.Fragment,{children:[q,(0,d.jsx)("h3",{className:h.title,children:n})]}),(0,d.jsx)("p",{children:r})]})}},3047:(e,t,s)=>{s.r(t),s.d(t,{default:()=>J});var a,l,i,n,r,o,c,h,d,m=s(6540),q=s(7635),p=s(7639),u=s(4783),x=s(8180);function v(){return v=Object.assign?Object.assign.bind():function(e){for(var t=1;t {let{title:t,titleId:s,...q}=e;return m.createElement("svg",v({xmlns:"http://www.w3.org/2000/svg",width:449,height:96,viewBox:"0 0 449 96","aria-labelledby":s},q),void 0===t?m.createElement("title",{id:s},"96-logo-horizontal"):t?m.createElement("title",{id:s},t):null,a||(a=m.createElement("defs",null,m.createElement("linearGradient",{id:"a",x1:"66.548%",x2:"80.272%",y1:"-4.692%",y2:"111.186%"},m.createElement("stop",{offset:"0%",stopColor:"#7AD852"}),m.createElement("stop",{offset:"53.584%",stopColor:"#3AB38B"}),m.createElement("stop",{offset:"100%",stopColor:"#00BFC9"})),m.createElement("linearGradient",{id:"b",x1:"78.094%",x2:"20.394%",y1:".738%",y2:"118.622%"},m.createElement("stop",{offset:"0%",stopColor:"#FF2953"}),m.createElement("stop",{offset:"100%",stopColor:"#EA3333"})))),m.createElement("g",{fill:"none",fillRule:"evenodd"},l||(l=m.createElement("path",{fill:"url(#a)",d:"M25.946 1.832C18.067 5.184.061 22.442 0 36.04c.106 14.058 18.067 30.856 25.946 34.209 1.806.768 4.61 1.83 7.57 1.83 2.7 0 4.986-1.331 7.312-4.13 3.91-4.703 3.44-11.466-1.771-15.304-6.236-4.59-11.339-8.71-11.445-16.605.106-7.894 5.21-13.404 11.445-17.995 5.21-3.838 6.226-9.66 2.316-14.363C39.047.884 36.216 0 33.516 0c-2.96 0-5.764 1.063-7.57 1.832"})),i||(i=m.createElement("path",{fill:"#005892",d:"M40.697 68.129c3.458-3.933 3.887-11.736-1.54-15.484-7.608-5.253-11.492-10.262-11.447-16.68.052-7.278 4.684-11.835 5.838-13.255-17.276 19.395-19.668 41.31-2.943 49.03 3.826 1.33 7.104-.212 10.092-3.611"})),n||(n=m.createElement("path",{fill:"#00418E",d:"M32.619 61.166c2.22-2.728 2.008-7.9-.99-10.74-4.765-4.514-5.616-9.426-5.587-13.877.033-5.048 3.007-8.21 3.748-9.194-11.09 13.452-14.386 30.96-3.65 36.315 2.457.923 4.56-.147 6.479-2.504"})),r||(r=m.createElement("path",{fill:"#002355",d:"M27.915 55.898c1.416-1.741 1.281-5.042-.631-6.853-3.042-2.881-3.585-6.016-3.566-8.856.021-3.222 1.042-6.002-.636-2.281-1.679 3.721-6.153 16.17.698 19.588 1.568.589 2.91-.094 4.135-1.598"})),o||(o=m.createElement("path",{fill:"url(#b)",d:"M10.22 72.218c-2.686 0-5.504-.884-7.819-3.68-3.891-4.701-2.874-10.519 2.311-14.354 6.206-4.588 11.279-10.096 11.385-17.986-.106-7.89-5.185-13.13-11.385-17.742C.135 15.052-1.49 8.56 2.401 3.858c2.315-2.796 5.132-3.68 7.82-3.68 2.946 0 5.736 1.063 7.534 1.83 7.84 3.35 25.682 20.098 25.82 34.19-.044 13.283-17.98 30.839-25.82 34.19-1.798.767-4.588 1.83-7.535 1.83",transform:"translate(41.212 23.742)"})),m.createElement("path",{fill:"#470000",d:"M22.557 45.69c3.476-3.932 2.887-10.991-2.569-14.74-7.647-5.253-11.292-11.276-11.247-17.695C8.793 5.977 13.45 1.42 14.61 0-3.436 13.255-5.16 41.31 11.65 49.03c3.847 1.33 7.904.06 10.907-3.34",opacity:.6,style:{mixBlendMode:"multiply"},transform:"rotate(-180 32.97 36.645)"}),c||(c=m.createElement("path",{fill:"#670010",d:"M53.003 34.318c-2.22 2.728-2.008 7.9.989 10.74 4.766 4.514 5.617 9.426 5.588 13.877-.034 5.048-1.044 7.352-1.785 8.337 9.027-10.609 11.977-30.335 1.687-35.458-2.457-.923-4.56.147-6.479 2.504"})),m.createElement("path",{fill:"#730000",d:"M23.889 33.973c1.417-1.74 1.282-5.041-.631-6.853-3.041-2.88-4.06-6.538-4.174-8.565-.14-2.501-.124-2.856.315-4.62-1.338 2.41-7.198 19.036.356 21.636 1.567.59 2.91-.094 4.134-1.598",style:{mixBlendMode:"multiply"},transform:"rotate(-180 41.01 36.73)"}),h||(h=m.createElement("path",{fill:"currentColor",d:"M123.196 27.784q-1.68-.495-3.088-.496-1.951 0-3.12.752-1.168.752-1.168 2.064 0 1.185.704 1.936.704.752 1.728 1.184t2.848 1.008q2.272.704 3.68 1.344a6.4 6.4 0 0 1 2.4 1.904q.992 1.264.992 3.344 0 1.92-1.04 3.36t-2.912 2.224-4.304.784q-2.465 0-4.8-.96t-4.032-2.56l1.376-2.656a11.6 11.6 0 0 0 3.6 2.416q2 .848 3.888.848 2.24 0 3.536-.88t1.296-2.384q0-1.184-.704-1.952t-1.776-1.216-2.896-.992q-2.24-.672-3.648-1.312a6.3 6.3 0 0 1-2.384-1.888q-.976-1.247-.976-3.296 0-1.792.992-3.168t2.784-2.112q1.792-.735 4.16-.736 2.016 0 3.952.592 1.935.593 3.44 1.584l-1.28 2.752a12.9 12.9 0 0 0-3.248-1.488m14.992-3.184h17.504v2.816h-7.232V47h-3.072V27.416h-7.2zm45.888 0-8.384 14.72V47h-3.072v-7.552L164.108 24.6h3.136l6.912 11.424L180.94 24.6zm11.296 0h3.072v19.616h9.792V47h-12.864zM237.004 47l-2.368-5.44h-11.808L220.492 47h-3.232l9.952-22.4h3.2l9.92 22.4zm-12.96-8.224h9.408l-4.736-10.88zm42.512-12.688q1.968 1.488 1.968 4.112 0 1.92-1.088 3.248-1.087 1.327-2.976 1.776 2.336.353 3.664 1.872t1.328 3.792q0 2.88-2.16 4.496T261.324 47h-9.728V24.6h9.568q3.424 0 5.392 1.488m-2.336 7.136q1.136-.88 1.136-2.512 0-1.6-1.136-2.464t-3.216-.832h-6.336v6.688h6.336q2.08 0 3.216-.88m.688 10.016q1.408-.976 1.408-2.736 0-1.695-1.408-2.656-1.408-.96-3.904-.96h-6.336v7.296h6.336q2.496.032 3.904-.944M282.38 24.6h3.072v19.616h9.792V47H282.38zm24.768 0H322.7v2.784h-12.48v6.912h11.168v2.784H310.22v7.136h12.864V47h-15.936z"})),d||(d=m.createElement("path",{fill:"#7A92A5",d:"M113.989 76.277q-.225.513-.426.697a.68.68 0 0 1-.477.185.7.7 0 0 1-.502-.21.68.68 0 0 1-.185-.698q.03-.108.082-.23l6.399-13.792q.256-.532.451-.723a.65.65 0 0 1 .472-.19.73.73 0 0 1 .523.205q.215.205.215.493a.798.798 0 0 1-.103.38zm15.504-9.075 2.707-1.159.143-.04a.4.4 0 0 1 .113-.021q.082 0 .138.077.056.076.129.282l.256.78q.03.122.046.2.016.075.016.107 0 .081-.083.143a.6.6 0 0 1-.235.093l-2.871.646 1.927 2.235a.4.4 0 0 1 .108.138.35.35 0 0 1 .036.149q0 .051-.067.128a1.5 1.5 0 0 1-.18.17l-.676.481a1.4 1.4 0 0 1-.195.129.3.3 0 0 1-.123.035q-.06 0-.133-.061a.7.7 0 0 1-.133-.164l-1.518-2.543-1.507 2.543a.6.6 0 0 1-.15.169.25.25 0 0 1-.148.056.3.3 0 0 1-.123-.04 1 1 0 0 1-.184-.124l-.657-.482a1.3 1.3 0 0 1-.205-.169q-.072-.076-.071-.148 0-.052.04-.129a.5.5 0 0 1 .113-.138l1.928-2.235-2.85-.646a.6.6 0 0 1-.252-.098q-.087-.066-.087-.159 0-.02.036-.128.037-.108.046-.159l.256-.78a.9.9 0 0 1 .124-.281q.06-.077.143-.077t.144.01a.5.5 0 0 1 .112.03l2.707 1.18-.276-2.943v-.123q0-.174.092-.236.092-.06.369-.061h.8q.287 0 .374.061.087.062.087.236v.123zm23.666-3.63q0-1.107.2-1.394.2-.288.856-.287.636 0 .84.24.206.241.206 1.144 0 .882-.19 1.092t-.856.21q-.657 0-.856-.195-.2-.195-.2-.81m1.897 10.982h3.291q.4 0 .59.17.19.168.19.538 0 .42-.18.58-.18.158-.661.158h-7.957q-.41 0-.616-.185-.204-.184-.205-.553 0-.36.216-.533.215-.175.646-.175h3.127v-6.573h-2q-.42 0-.64-.19t-.22-.548q0-.36.204-.538.205-.18.616-.18h3.004q.277 0 .436.113a.36.36 0 0 1 .159.308zm7.177.708v-1.825q0-.452.17-.646.168-.195.548-.195.42 0 .667.574.164.349.297.523.43.554 1.272.887.84.333 1.855.333 1.087 0 1.744-.44.656-.442.656-1.16 0-.727-.528-1.035t-1.81-.308h-.564q-2.091 0-3.189-.728t-1.097-2.112q0-1.353 1.071-2.102 1.072-.75 3.01-.749.79 0 1.61.22.82.221.861.221.113 0 .43-.2.319-.2.626-.2.349 0 .518.257.17.255.17.769v1.2q0 .543-.165.784-.164.24-.523.24-.308 0-.758-.522a7 7 0 0 0-.523-.544 3.4 3.4 0 0 0-1.16-.723q-.615-.22-1.445-.22-.964 0-1.553.426-.59.425-.59 1.081 0 .647.605.923.605.277 2.604.318 2.133.051 3.118.743.984.693.984 2.138 0 1.385-1.087 2.215t-2.932.83a9 9 0 0 1-1.303-.107 23 23 0 0 1-1.804-.364 5 5 0 0 1-.616.354q-.255.118-.43.118-.36 0-.549-.251-.19-.252-.19-.723m32.915-11.085q.103-.276.288-.39.184-.112.533-.112.379 0 .533.184.153.184.154.76a79 79 0 0 0 .04 2.624q0 .481-.163.651-.164.17-.585.17-.676 0-.882-.964l-.112-.441q-.195-.77-.933-1.256-.739-.487-1.733-.487-1.815 0-2.913 1.327-1.097 1.328-1.097 3.564t1.113 3.563 2.938 1.328q.595 0 1.21-.17a5.3 5.3 0 0 0 1.21-.507q.276-.144.758-.487.482-.344.687-.344.318 0 .539.21.22.21.22.518t-.24.59-.898.692a6.8 6.8 0 0 1-1.733.83 6.2 6.2 0 0 1-1.835.267q-2.533 0-4.184-1.789-1.65-1.79-1.65-4.578 0-2.76 1.67-4.584 1.672-1.825 4.205-1.825.675 0 1.379.164.702.164 1.481.492m6.368 11.464q-.051.462-.236.641-.185.18-.584.18-.43 0-.641-.252-.21-.25-.241-.815l-.133-2.379v-.184q0-.493.19-.698.189-.204.63-.205.615 0 .882.882.123.44.236.667.359.717 1.133 1.107t1.85.39q1.323 0 2.149-.626.825-.625.825-1.6 0-.81-.507-1.302-.508-.492-1.482-.635l-1.518-.206q-2.123-.297-3.096-1.117-.974-.82-.974-2.307 0-1.57 1.297-2.636 1.296-1.065 3.235-1.066.563 0 1.19.149.624.148 1.414.466.021-.297.164-.41t.493-.113q.45 0 .625.134.174.132.215.635l.144 2.143v.103q0 .359-.205.559t-.574.2q-.544 0-.841-.76a2.8 2.8 0 0 0-.287-.645q-.339-.513-.974-.79a3.6 3.6 0 0 0-1.446-.276q-1.24 0-2.015.615-.774.615-.774 1.61 0 .78.579 1.23.58.45 1.769.615l1.64.205q1.784.237 2.687 1.092t.902 2.313q0 1.723-1.281 2.763-1.283 1.04-3.425 1.04-.738 0-1.467-.173a9 9 0 0 1-1.548-.544m12.602 0q-.051.462-.236.641-.185.18-.584.18-.43 0-.641-.252-.21-.25-.241-.815l-.133-2.379v-.184q0-.493.19-.698.189-.204.63-.205.615 0 .882.882.123.44.236.667.359.717 1.133 1.107t1.85.39q1.323 0 2.149-.626.825-.625.825-1.6 0-.81-.507-1.302-.509-.492-1.482-.635l-1.518-.206q-2.123-.297-3.096-1.117-.975-.82-.974-2.307 0-1.57 1.297-2.636 1.297-1.065 3.235-1.066.563 0 1.19.149.624.148 1.414.466.021-.297.164-.41t.493-.113q.45 0 .625.134.174.132.215.635l.144 2.143v.103q0 .359-.205.559t-.574.2q-.544 0-.841-.76a2.8 2.8 0 0 0-.287-.645q-.339-.513-.974-.79a3.6 3.6 0 0 0-1.446-.276q-1.24 0-2.015.615-.774.615-.774 1.61 0 .78.58 1.23.578.45 1.768.615l1.64.205q1.785.237 2.687 1.092.903.856.902 2.313 0 1.723-1.281 2.763-1.282 1.04-3.425 1.04-.738 0-1.466-.173a9 9 0 0 1-1.549-.544m31.357-1.107q.42 0 .64.184t.22.544q0 .369-.21.553t-.61.185h-6.705q-.42 0-.641-.185-.22-.184-.22-.553 0-.359.21-.544.21-.184.61-.184h1.743v-6.265h-1.682q-.42 0-.651-.195-.23-.195-.23-.554 0-.369.215-.554.215-.184.625-.184h1.62v-.698q0-1.855 1.056-2.691t3.415-.836q1.148 0 1.697.256.549.257.548.8a.66.66 0 0 1-.235.523.9.9 0 0 1-.605.205q-.185 0-.887-.123a7 7 0 0 0-1.205-.123q-1.159 0-1.661.487-.503.487-.503 1.615v.585h3.63q.42 0 .641.184.22.185.22.554 0 .348-.225.549-.226.2-.615.2h-3.548v6.265zm9.443.287q1.58 0 2.59-1t1.01-2.548-1.016-2.558q-1.014-1.01-2.584-1.01-1.568 0-2.578 1.01t-1.01 2.558q0 1.558 1.004 2.553t2.584.995m5.384-3.548q0 2.195-1.497 3.589t-3.887 1.394q-2.378 0-3.876-1.394-1.497-1.395-1.497-3.59 0-2.193 1.497-3.583t3.876-1.39q2.379 0 3.882 1.395 1.502 1.395 1.502 3.579m6.214 3.281h3.404q.4 0 .59.17.19.168.19.538 0 .42-.18.58-.18.158-.662.158h-6.706q-.4 0-.605-.185-.204-.184-.205-.553 0-.36.21-.533.21-.175.652-.175h1.784v-6.573h-.697q-.995 0-1.241-.158-.246-.16-.246-.58 0-.36.2-.538.2-.18.61-.18h2.338q.276 0 .42.108a.37.37 0 0 1 .144.313v1.743q.974-1.22 2.03-1.815a4.56 4.56 0 0 1 2.276-.595q.913 0 1.477.37.564.369.564.953a.94.94 0 0 1-.282.672q-.282.292-.62.292-.237 0-.795-.313-.56-.312-1-.313-.8 0-1.687.57-.887.569-1.963 1.8zm29.295-7.413V67.1q0-.339.195-.498t.605-.159q.42 0 .58.246.158.247.158 1.016v1.907q0 .379-.195.569-.194.19-.584.19a.74.74 0 0 1-.477-.16q-.2-.158-.487-.66-.492-.831-1.195-1.257-.702-.425-1.615-.425-1.599 0-2.599.943t-1 2.44q0 1.528.959 2.497.96.97 2.466.97.687 0 1.307-.19a4.3 4.3 0 0 0 1.175-.57q.195-.123.522-.379.667-.543 1.046-.543a.7.7 0 0 1 .518.2.7.7 0 0 1 .2.517q0 .81-1.533 1.656a6.64 6.64 0 0 1-3.255.846q-2.226 0-3.707-1.425-1.482-1.425-1.482-3.558t1.477-3.563 3.691-1.43q.779 0 1.564.21a9 9 0 0 1 1.666.65m9.516 7.68q1.578 0 2.589-1t1.01-2.548q0-1.548-1.015-2.558t-2.584-1.01-2.58 1.01-1.01 2.558q0 1.558 1.006 2.553 1.004.995 2.584.995m5.383-3.548q0 2.195-1.497 3.589t-3.886 1.394q-2.379 0-3.876-1.394-1.497-1.395-1.497-3.59 0-2.193 1.497-3.583t3.876-1.39q2.38 0 3.88 1.395 1.503 1.395 1.503 3.579m11.023-.984q0-1.446-.262-1.954-.261-.507-.897-.507-.758 0-1.205.656-.446.656-.446 1.805v4.265h.185q.625 0 .836.149.21.148.21.559 0 .369-.175.553-.173.185-.533.185h-1.302q-.441 0-.6-.205t-.159-.882V69.49q0-.77-.348-1.215-.349-.447-.954-.446-.462 0-.846.271-.385.273-.661.805v5.65h.38q.615 0 .83.154t.215.554q0 .42-.174.58-.175.158-.667.158h-2.727q-.4 0-.59-.18t-.19-.558q0-.41.241-.56.24-.148.939-.148h.205v-6.573h-.185q-.717 0-.98-.164-.26-.163-.26-.574 0-.36.204-.538.205-.18.616-.18H314q.339 0 .447.118t.128.498q.42-.451.902-.667a2.6 2.6 0 0 1 1.087-.215q.717 0 1.184.313.467.312.692.948.432-.646.995-.954a2.65 2.65 0 0 1 1.292-.307q1.323 0 1.933.861t.61 2.79v4.644h.164q.636 0 .851.154t.215.554q0 .369-.184.553t-.544.185h-1.24q-.41 0-.605-.246t-.195-.78zm6.152 8.336h2.461q.39 0 .585.185.195.184.194.553 0 .4-.19.564-.19.165-.67.164h-4.523q-.41 0-.62-.184t-.21-.544q0-.41.261-.574.26-.165.97-.164h.194V67.981h-.195q-.708 0-.969-.164-.261-.163-.261-.574 0-.36.21-.538.21-.18.62-.18h1.559q.308 0 .446.103.138.102.138.318v.994q.698-.717 1.543-1.076a4.6 4.6 0 0 1 1.82-.36q2.062 0 3.446 1.395t1.384 3.497q0 2.02-1.312 3.322t-3.353 1.303a5.1 5.1 0 0 1-2-.385 4.05 4.05 0 0 1-1.528-1.102zm3.179-4.112q1.425 0 2.338-.897.912-.897.912-2.323 0-1.395-.917-2.302-.918-.907-2.333-.907t-2.317.902-.903 2.307q0 1.415.897 2.318.898.902 2.323.902m12.069.308q1.58 0 2.589-1 1.01-1 1.01-2.548t-1.015-2.558-2.584-1.01q-1.57 0-2.579 1.01t-1.01 2.558q0 1.558 1.005 2.553t2.584.995m5.383-3.548q0 2.195-1.497 3.589t-3.886 1.394q-2.379 0-3.876-1.394-1.497-1.395-1.497-3.59 0-2.193 1.497-3.583t3.876-1.39q2.38 0 3.88 1.395 1.503 1.395 1.503 3.579m3.404 3.281v-6.573h-.194q-.697 0-.96-.164-.26-.163-.26-.574 0-.38.215-.548.215-.17.697-.17h1.466q.277 0 .43.113a.36.36 0 0 1 .155.308v.697q.749-.697 1.481-1.03a3.6 3.6 0 0 1 1.523-.334q1.548 0 2.435.964.888.964.887 2.666v4.645h.482q.513 0 .739.17.225.168.225.538 0 .4-.24.569-.242.17-.857.169h-2.266q-.657 0-.84-.154-.186-.153-.185-.584 0-.4.215-.554.214-.154.81-.154h.359V70.29q0-1.2-.544-1.83-.543-.631-1.579-.631-1.046 0-1.845.707-.8.707-.8 1.754v4.265h.359q.615 0 .83.154.216.154.216.554 0 .43-.185.584t-.902.154h-2.42q-.42 0-.63-.18t-.211-.558q0-.41.24-.56.241-.148.94-.148zm12.951-2.84q.082 1.476 1 2.281t2.507.805q1.2 0 2.615-.64 1.415-.642 1.712-.641.308 0 .513.194.204.195.205.482 0 .298-.215.544-.216.245-.687.482-1.026.502-2.118.769a9 9 0 0 1-2.169.266q-2.337 0-3.742-1.348t-1.405-3.574q0-2.266 1.487-3.67 1.486-1.405 3.876-1.405 2.163 0 3.589 1.312 1.425 1.313 1.425 3.179 0 .575-.241.769t-1.307.195zm.051-1.343h6.676q-.154-1.22-1.02-1.964-.867-.743-2.128-.743-1.365 0-2.297.717-.933.718-1.23 1.99m12.203 4.183v-6.573h-.195q-.697 0-.96-.164-.26-.163-.26-.574 0-.38.215-.548.215-.17.697-.17h1.466q.278 0 .431.113a.36.36 0 0 1 .154.308v.697q.748-.697 1.482-1.03a3.6 3.6 0 0 1 1.522-.334q1.548 0 2.436.964.886.964.887 2.666v4.645h.481q.513 0 .739.17.225.168.225.538 0 .4-.24.569-.242.17-.857.169h-2.266q-.656 0-.84-.154-.186-.153-.185-.584 0-.4.215-.554.216-.154.81-.154h.359V70.29q0-1.2-.544-1.83-.543-.631-1.579-.631-1.046 0-1.845.707-.8.707-.8 1.754v4.265h.359q.615 0 .83.154.216.154.216.554 0 .43-.185.584t-.902.154h-2.42q-.42 0-.63-.18t-.211-.558q0-.41.24-.56.242-.148.94-.148zM396.34 67.1q.503 0 .733.174.231.173.231.554 0 .358-.215.538-.216.18-.646.18h-4.153v3.424q0 1.682.436 2.215t1.492.533q.933 0 2.235-.543 1.302-.544 1.61-.544.287 0 .487.205.2.206.2.503a.8.8 0 0 1-.251.59q-.252.251-.856.487-1.005.4-1.81.584a6.8 6.8 0 0 1-1.513.185q-1.2 0-2.015-.385a2.57 2.57 0 0 1-1.215-1.143 2.6 2.6 0 0 1-.292-.851q-.087-.492-.087-1.518v-3.743h-1.743q-.43 0-.626-.169-.195-.169-.195-.548 0-.42.267-.575.267-.153 1.138-.153h1.159v-2.646q0-.44.19-.651.19-.21.59-.21.45 0 .625.256.174.256.174 1.17v2.08zm5.332 8.162v-1.825q0-.452.17-.646.168-.195.548-.195.42 0 .667.574.163.349.297.523.43.554 1.271.887.842.333 1.856.333 1.087 0 1.744-.44.656-.442.656-1.16 0-.727-.528-1.035t-1.81-.308h-.564q-2.093 0-3.189-.728t-1.097-2.112q0-1.353 1.071-2.102 1.072-.75 3.01-.749.79 0 1.61.22.82.221.861.221.113 0 .43-.2.319-.2.626-.2.349 0 .518.257.17.255.17.769v1.2q0 .543-.165.784-.164.24-.523.24-.307 0-.759-.522a7 7 0 0 0-.522-.544 3.4 3.4 0 0 0-1.16-.723q-.615-.22-1.445-.22-.964 0-1.553.426-.59.425-.59 1.081 0 .647.605.923.605.277 2.604.318 2.133.051 3.118.743.984.693.984 2.138 0 1.385-1.087 2.215t-2.933.83a9 9 0 0 1-1.302-.107 23 23 0 0 1-1.804-.364 5 5 0 0 1-.616.354q-.256.118-.43.118-.36 0-.549-.251-.19-.252-.19-.723m30.27-8.06 2.707-1.159.143-.04a.4.4 0 0 1 .113-.021q.082 0 .139.077.056.076.128.282l.256.78q.03.122.046.2.015.075.016.107 0 .081-.082.143a.6.6 0 0 1-.236.093l-2.871.646 1.928 2.235a.4.4 0 0 1 .107.138.35.35 0 0 1 .036.149q0 .051-.067.128a1.5 1.5 0 0 1-.179.17l-.677.481a1.4 1.4 0 0 1-.195.129.3.3 0 0 1-.123.035q-.06 0-.133-.061a.7.7 0 0 1-.133-.164l-1.518-2.543-1.507 2.543a.6.6 0 0 1-.149.169.25.25 0 0 1-.149.056.3.3 0 0 1-.123-.04 1 1 0 0 1-.184-.124l-.656-.482a1.3 1.3 0 0 1-.205-.169q-.072-.076-.072-.148 0-.052.04-.129a.5.5 0 0 1 .114-.138l1.927-2.235-2.85-.646a.6.6 0 0 1-.252-.098q-.087-.066-.087-.159 0-.02.036-.128t.046-.159l.257-.78a.9.9 0 0 1 .123-.281q.061-.077.143-.077.083 0 .144.01a.5.5 0 0 1 .113.03l2.707 1.18-.277-2.943v-.123q0-.174.092-.236.093-.06.37-.061h.8q.286 0 .373.061.087.062.087.236v.123zm9.7 9.075q-.225.513-.425.697a.68.68 0 0 1-.477.185.7.7 0 0 1-.503-.21.68.68 0 0 1-.184-.698q.03-.108.082-.23l6.398-13.792q.256-.532.451-.723a.65.65 0 0 1 .472-.19.73.73 0 0 1 .523.205q.215.205.215.493a.798.798 0 0 1-.103.38z"}))))};var y=s(3013);const j="hero",f=(...e)=>(0,y.rx)(j,...e),b=f,S="hero__root",w="hero__logo",N="hero__buttons",_="hero__getStarted";var C=s(4848);function E(e){let{className:t}=e;return(0,C.jsx)("header",{className:b(S,"hero hero--primary",t),children:(0,C.jsxs)("div",{className:"container",children:[(0,C.jsx)(g,{className:w}),(0,C.jsx)("div",{className:N,children:(0,C.jsx)(u.A,{className:b(_,"button button--outline button--secondary button--lg"),to:(0,x.Ay)("docs/getting-started/intro"),children:"Get Started"})})]})})}var k=s(5797);const A="responsive-embed__root";function z(e){let{src:t}=e;return(0,C.jsx)("div",{className:A,children:(0,C.jsx)("iframe",{src:t,frameBorder:"0",allowFullScreen:!0})})}s(6114),s(4183);const M="index",I=(...e)=>(0,y.rx)(M,...e),T=I,V="index__root",W="index__hero",B="index__features",D="index__feature",P="index__section",X="index__sectionAlt",F="index__heart",G="index__quote",H="index__lspDemo",L="index__playWithIt";const J=function(){const e=(0,p.A)(),{siteConfig:t}=e;return(0,C.jsxs)(q.A,{wrapperClassName:V,title:t.title,description:"A modern CSS pre-processor built for components",children:[(0,C.jsx)(E,{className:W}),(0,C.jsxs)("main",{children:[(0,C.jsx)("section",{className:B,children:(0,C.jsx)("div",{className:"container",children:(0,C.jsxs)("div",{className:"row",children:[(0,C.jsx)(k.X,{className:D,title:"CSS Superset",image:"img/component.svg",children:"Extending CSS so that it is easier to use in a component ecosystem, but without losing any of the declarative, familiar, static and fast aspects of CSS."}),(0,C.jsx)(k.X,{className:D,title:"Style API",image:"img/api.svg",children:"Each component exposes a Style API that maps its internal parts and states so you can reuse components across teams without sacrificing stylability or scalability."}),(0,C.jsx)(k.X,{className:D,title:"Type Safety",image:"img/stethoscope.svg",children:"Provide the ability to see errors at build time or even while working in your IDE. Wave goodbye to silent run-time breakage misery!"}),(0,C.jsx)(k.X,{className:D,title:"Performant",image:"img/checklist.svg",children:"Perform build-time transpilation and require only a minimal runtime. Use custom states and properties for dynamic interactions."}),(0,C.jsx)(k.X,{className:D,title:"Mixins & Formatters",image:"img/prototype.svg",children:"Easily create complex designs using CSS or JavaScript and reuse them across projects."}),(0,C.jsx)(k.X,{className:D,title:"Developer Tooling",image:"img/tool.svg",children:"Use our language-intelligence IDE extension for a better development experience including completions, defintions, hinting, diagnostics and more."})]})})}),(0,C.jsx)("section",{className:T(P,X),children:(0,C.jsxs)("div",{className:"container",children:[(0,C.jsx)("h2",{children:"What is Stylable?"}),(0,C.jsxs)("p",{children:["At ",(0,C.jsx)(u.A,{to:"https://www.wix.engineering/",children:"Wix"}),", we"," ",(0,C.jsx)("span",{className:F,children:"\u2665 "}),"CSS. Its simple, declarative syntax that is native in browsers is easily the fastest way to add styles to web pages and web apps. But when writing CSS that is scoped to individual components, developers have to maintain highly-specific selectors, using elaborate conventions to fake namespacing. Writing and maintaining CSS across large teams and large projects can be tricky."]}),(0,C.jsxs)("p",{children:["We also ",(0,C.jsx)("span",{className:F,children:"\u2665"})," TypeScript. TypeScript helps us manage these large projects, exposing at build-time what we could once only see at run-time."]}),(0,C.jsxs)("div",{children:["We want to give CSS a ",(0,C.jsx)("em",{children:"type system"})," \u2014 to do for CSS what TypeScript does for JavaScript.",(0,C.jsx)("ul",{})]}),"So we created ",(0,C.jsx)("strong",{children:"Stylable"})," \u2014 a CSS preprocessor that enables you to write style rules in CSS syntax, with some extensions that we believe adhere to the spirit of CSS."]})}),(0,C.jsx)("section",{className:P,children:(0,C.jsxs)("div",{className:"container",children:[(0,C.jsx)("h2",{children:"What Does Stylable Do?"}),(0,C.jsxs)("ul",{children:[(0,C.jsx)("li",{children:'Stylable scopes styles to components so they don\u2019t "leak" and clash with other styles.'}),(0,C.jsx)("li",{children:"Stylable enables custom pseudo-classes and pseudo-elements that abstract the internal state and structure of a component. These can then be styled externally. For example, you can style the label inside a button, or style the play button of a video player from outside these components."}),(0,C.jsx)("li",{children:"At build time, the preprocessor converts the Stylable CSS into flat, static, valid, vanilla CSS that works cross-browser."})]})]})}),(0,C.jsx)("section",{className:T(P,X),children:(0,C.jsxs)("div",{className:"container",children:[(0,C.jsx)("h2",{children:"Tooling"}),(0,C.jsx)("img",{className:H,src:"img/stylable-lsp-opt.gif",alt:"Stylable Intelligence Demo"}),(0,C.jsx)("p",{children:"Treating CSS as a type system opens up a whole new world of tooling. You can:"}),(0,C.jsxs)("ul",{children:[(0,C.jsx)("li",{children:"Get code completion that hints at the internal structure of components."}),(0,C.jsx)("li",{children:"Get types for your parameters. And so much more."})]}),(0,C.jsx)("strong",{children:"Stylable"})," enhances the styling development process. To get the full"," ",(0,C.jsx)("strong",{children:"Stylable"})," experience, install our"," ",(0,C.jsx)(u.A,{to:"https://marketplace.visualstudio.com/items?itemName=wix.stylable-intelligence",children:"VSCode Intellisense Extension"}),". It supports code completions, diagnostics, go to definitions, syntax highlighting and more."]})}),(0,C.jsx)("section",{className:P,children:(0,C.jsxs)("div",{className:"container",children:[(0,C.jsx)("h2",{children:"Videos"}),(0,C.jsx)("h3",{children:"Introduction to Stylable"}),(0,C.jsx)(z,{src:"https://www.youtube-nocookie.com/embed/Cx-JyJ9eXks?rel=0"}),(0,C.jsx)("h3",{children:"The Official Stylable Musical!"}),(0,C.jsx)(z,{src:"https://www.youtube.com/embed/jK88TqyXSWs?rel=0"})]})}),(0,C.jsx)("section",{className:T(P,X),children:(0,C.jsxs)("div",{className:"container",children:[(0,C.jsx)("h2",{children:"Documentation"}),(0,C.jsx)(u.A,{to:"./docs/getting-started/intro",children:"Learn more about Stylable"})," and get started with step by step instructions and code examples."]})}),(0,C.jsx)("section",{className:P,children:(0,C.jsxs)("div",{className:"container",children:[(0,C.jsx)("h2",{children:"Demo Project"}),(0,C.jsxs)("p",{children:["You can download our"," ",(0,C.jsxs)(u.A,{to:"https://github.com/wix/potato-bruce",children:["Learn more about ",(0,C.jsx)("strong",{children:"Mr. Potato Bruce project"})]})," ","from GitHub. It's a"," ",(0,C.jsx)(u.A,{to:"https://wix.github.io/potato-bruce/",children:(0,C.jsx)("strong",{children:"demo application"})})," ","showcasing the features and typed style API. Bruce explains it in his React Europe 2018 talk:"]}),(0,C.jsx)("div",{children:(0,C.jsx)(z,{src:"https://www.youtube.com/embed/YRhJZZsTEvQ"})}),(0,C.jsx)("p",{className:L,children:"Play with it and let us know what you think!"})]})}),(0,C.jsx)("section",{className:T(P,X),children:(0,C.jsx)("div",{className:"container",children:(0,C.jsxs)("div",{children:[(0,C.jsx)("h2",{children:"Shut up and take my money!"}),(0,C.jsxs)("p",{children:["No need! ",(0,C.jsx)("strong",{children:"Stylable"})," is open-source. Take it, use it, make your development easier and your apps faster. Viva CSS, and welcome ",(0,C.jsx)("strong",{children:"Stylable"}),". We hope you like it."]}),(0,C.jsxs)("p",{children:["Click here to access the MIT-licensed"," ",(0,C.jsx)(u.A,{to:"https://github.com/wix/stylable",children:"Stylable GitHub project"}),"."]}),(0,C.jsxs)("blockquote",{className:G,children:[(0,C.jsx)("p",{children:"New ideas will come along, but they will extend CSS rather than replace it. I believe that the CSS code we write today will be readable by computers 500 years from now."}),(0,C.jsxs)("small",{children:["\u2014"," ",(0,C.jsx)(u.A,{to:"https://dev.opera.com/articles/css-twenty-years-hakon/",children:"H\xe5kon Wium Lie"}),", co-creator of CSS."]})]})]})})})]})]})}},2224:(e,t,s)=>{e.exports=s.p+"f4bc9dffc19ff19f.svg"},3013:(e,t,s)=>{function a(e,t,s){if(!1===s||null==s||s!=s)return"";if(!0===s)return e+"--"+t;var a=s.toString();return e+"---"+t+"-"+a.length+"-"+a.replace(/\s/gm,"_")}function l(e){for(var t=[],s=1;s l})}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[4583],{6114:(e,t,s)=>{},4183:(e,t,s)=>{s(6114)},5453:(e,t,s)=>{s.d(t,{X:()=>m});var a=s(6540),l=s(6025),i=s(8774),n=s(3013);const r="feature",o=(...e)=>(0,n.rx)(r,...e),c=o,h={root:"feature__root",title:"feature__title",image:"feature__image",imageWrapper:"feature__imageWrapper"};var d=s(4848);function m(e){let{className:t,image:s,title:n,children:r,link:o}=e;const m="string"==typeof s?(0,l.Ay)(s):"",q=a.useMemo((()=>s?"string"==typeof s?(0,d.jsx)("div",{className:h.imageWrapper,children:(0,d.jsx)("img",{className:h.image,src:m,alt:n})}):(0,d.jsx)("div",{className:h.imageWrapper,children:s(h.image)}):null),[s,m]);return(0,d.jsxs)("div",{className:c(h.root,"col col--4",t),children:[o?(0,d.jsxs)(i.A,{href:o,children:[q,(0,d.jsx)("h3",{className:h.title,children:n})]}):(0,d.jsxs)(d.Fragment,{children:[q,(0,d.jsx)("h3",{className:h.title,children:n})]}),(0,d.jsx)("p",{children:r})]})}},8421:(e,t,s)=>{s.r(t),s.d(t,{default:()=>J});var a,l,i,n,r,o,c,h,d,m=s(6540),q=s(7823),p=s(4586),u=s(8774),x=s(6025);function v(){return v=Object.assign?Object.assign.bind():function(e){for(var t=1;t {let{title:t,titleId:s,...q}=e;return m.createElement("svg",v({xmlns:"http://www.w3.org/2000/svg",width:449,height:96,viewBox:"0 0 449 96","aria-labelledby":s},q),void 0===t?m.createElement("title",{id:s},"96-logo-horizontal"):t?m.createElement("title",{id:s},t):null,a||(a=m.createElement("defs",null,m.createElement("linearGradient",{id:"a",x1:"66.548%",x2:"80.272%",y1:"-4.692%",y2:"111.186%"},m.createElement("stop",{offset:"0%",stopColor:"#7AD852"}),m.createElement("stop",{offset:"53.584%",stopColor:"#3AB38B"}),m.createElement("stop",{offset:"100%",stopColor:"#00BFC9"})),m.createElement("linearGradient",{id:"b",x1:"78.094%",x2:"20.394%",y1:".738%",y2:"118.622%"},m.createElement("stop",{offset:"0%",stopColor:"#FF2953"}),m.createElement("stop",{offset:"100%",stopColor:"#EA3333"})))),m.createElement("g",{fill:"none",fillRule:"evenodd"},l||(l=m.createElement("path",{fill:"url(#a)",d:"M25.946 1.832C18.067 5.184.061 22.442 0 36.04c.106 14.058 18.067 30.856 25.946 34.209 1.806.768 4.61 1.83 7.57 1.83 2.7 0 4.986-1.331 7.312-4.13 3.91-4.703 3.44-11.466-1.771-15.304-6.236-4.59-11.339-8.71-11.445-16.605.106-7.894 5.21-13.404 11.445-17.995 5.21-3.838 6.226-9.66 2.316-14.363C39.047.884 36.216 0 33.516 0c-2.96 0-5.764 1.063-7.57 1.832"})),i||(i=m.createElement("path",{fill:"#005892",d:"M40.697 68.129c3.458-3.933 3.887-11.736-1.54-15.484-7.608-5.253-11.492-10.262-11.447-16.68.052-7.278 4.684-11.835 5.838-13.255-17.276 19.395-19.668 41.31-2.943 49.03 3.826 1.33 7.104-.212 10.092-3.611"})),n||(n=m.createElement("path",{fill:"#00418E",d:"M32.619 61.166c2.22-2.728 2.008-7.9-.99-10.74-4.765-4.514-5.616-9.426-5.587-13.877.033-5.048 3.007-8.21 3.748-9.194-11.09 13.452-14.386 30.96-3.65 36.315 2.457.923 4.56-.147 6.479-2.504"})),r||(r=m.createElement("path",{fill:"#002355",d:"M27.915 55.898c1.416-1.741 1.281-5.042-.631-6.853-3.042-2.881-3.585-6.016-3.566-8.856.021-3.222 1.042-6.002-.636-2.281-1.679 3.721-6.153 16.17.698 19.588 1.568.589 2.91-.094 4.135-1.598"})),o||(o=m.createElement("path",{fill:"url(#b)",d:"M10.22 72.218c-2.686 0-5.504-.884-7.819-3.68-3.891-4.701-2.874-10.519 2.311-14.354 6.206-4.588 11.279-10.096 11.385-17.986-.106-7.89-5.185-13.13-11.385-17.742C.135 15.052-1.49 8.56 2.401 3.858c2.315-2.796 5.132-3.68 7.82-3.68 2.946 0 5.736 1.063 7.534 1.83 7.84 3.35 25.682 20.098 25.82 34.19-.044 13.283-17.98 30.839-25.82 34.19-1.798.767-4.588 1.83-7.535 1.83",transform:"translate(41.212 23.742)"})),m.createElement("path",{fill:"#470000",d:"M22.557 45.69c3.476-3.932 2.887-10.991-2.569-14.74-7.647-5.253-11.292-11.276-11.247-17.695C8.793 5.977 13.45 1.42 14.61 0-3.436 13.255-5.16 41.31 11.65 49.03c3.847 1.33 7.904.06 10.907-3.34",opacity:.6,style:{mixBlendMode:"multiply"},transform:"rotate(-180 32.97 36.645)"}),c||(c=m.createElement("path",{fill:"#670010",d:"M53.003 34.318c-2.22 2.728-2.008 7.9.989 10.74 4.766 4.514 5.617 9.426 5.588 13.877-.034 5.048-1.044 7.352-1.785 8.337 9.027-10.609 11.977-30.335 1.687-35.458-2.457-.923-4.56.147-6.479 2.504"})),m.createElement("path",{fill:"#730000",d:"M23.889 33.973c1.417-1.74 1.282-5.041-.631-6.853-3.041-2.88-4.06-6.538-4.174-8.565-.14-2.501-.124-2.856.315-4.62-1.338 2.41-7.198 19.036.356 21.636 1.567.59 2.91-.094 4.134-1.598",style:{mixBlendMode:"multiply"},transform:"rotate(-180 41.01 36.73)"}),h||(h=m.createElement("path",{fill:"currentColor",d:"M123.196 27.784q-1.68-.495-3.088-.496-1.951 0-3.12.752-1.168.752-1.168 2.064 0 1.185.704 1.936.704.752 1.728 1.184t2.848 1.008q2.272.704 3.68 1.344a6.4 6.4 0 0 1 2.4 1.904q.992 1.264.992 3.344 0 1.92-1.04 3.36t-2.912 2.224-4.304.784q-2.465 0-4.8-.96t-4.032-2.56l1.376-2.656a11.6 11.6 0 0 0 3.6 2.416q2 .848 3.888.848 2.24 0 3.536-.88t1.296-2.384q0-1.184-.704-1.952t-1.776-1.216-2.896-.992q-2.24-.672-3.648-1.312a6.3 6.3 0 0 1-2.384-1.888q-.976-1.247-.976-3.296 0-1.792.992-3.168t2.784-2.112q1.792-.735 4.16-.736 2.016 0 3.952.592 1.935.593 3.44 1.584l-1.28 2.752a12.9 12.9 0 0 0-3.248-1.488m14.992-3.184h17.504v2.816h-7.232V47h-3.072V27.416h-7.2zm45.888 0-8.384 14.72V47h-3.072v-7.552L164.108 24.6h3.136l6.912 11.424L180.94 24.6zm11.296 0h3.072v19.616h9.792V47h-12.864zM237.004 47l-2.368-5.44h-11.808L220.492 47h-3.232l9.952-22.4h3.2l9.92 22.4zm-12.96-8.224h9.408l-4.736-10.88zm42.512-12.688q1.968 1.488 1.968 4.112 0 1.92-1.088 3.248-1.087 1.327-2.976 1.776 2.336.353 3.664 1.872t1.328 3.792q0 2.88-2.16 4.496T261.324 47h-9.728V24.6h9.568q3.424 0 5.392 1.488m-2.336 7.136q1.136-.88 1.136-2.512 0-1.6-1.136-2.464t-3.216-.832h-6.336v6.688h6.336q2.08 0 3.216-.88m.688 10.016q1.408-.976 1.408-2.736 0-1.695-1.408-2.656-1.408-.96-3.904-.96h-6.336v7.296h6.336q2.496.032 3.904-.944M282.38 24.6h3.072v19.616h9.792V47H282.38zm24.768 0H322.7v2.784h-12.48v6.912h11.168v2.784H310.22v7.136h12.864V47h-15.936z"})),d||(d=m.createElement("path",{fill:"#7A92A5",d:"M113.989 76.277q-.225.513-.426.697a.68.68 0 0 1-.477.185.7.7 0 0 1-.502-.21.68.68 0 0 1-.185-.698q.03-.108.082-.23l6.399-13.792q.256-.532.451-.723a.65.65 0 0 1 .472-.19.73.73 0 0 1 .523.205q.215.205.215.493a.798.798 0 0 1-.103.38zm15.504-9.075 2.707-1.159.143-.04a.4.4 0 0 1 .113-.021q.082 0 .138.077.056.076.129.282l.256.78q.03.122.046.2.016.075.016.107 0 .081-.083.143a.6.6 0 0 1-.235.093l-2.871.646 1.927 2.235a.4.4 0 0 1 .108.138.35.35 0 0 1 .036.149q0 .051-.067.128a1.5 1.5 0 0 1-.18.17l-.676.481a1.4 1.4 0 0 1-.195.129.3.3 0 0 1-.123.035q-.06 0-.133-.061a.7.7 0 0 1-.133-.164l-1.518-2.543-1.507 2.543a.6.6 0 0 1-.15.169.25.25 0 0 1-.148.056.3.3 0 0 1-.123-.04 1 1 0 0 1-.184-.124l-.657-.482a1.3 1.3 0 0 1-.205-.169q-.072-.076-.071-.148 0-.052.04-.129a.5.5 0 0 1 .113-.138l1.928-2.235-2.85-.646a.6.6 0 0 1-.252-.098q-.087-.066-.087-.159 0-.02.036-.128.037-.108.046-.159l.256-.78a.9.9 0 0 1 .124-.281q.06-.077.143-.077t.144.01a.5.5 0 0 1 .112.03l2.707 1.18-.276-2.943v-.123q0-.174.092-.236.092-.06.369-.061h.8q.287 0 .374.061.087.062.087.236v.123zm23.666-3.63q0-1.107.2-1.394.2-.288.856-.287.636 0 .84.24.206.241.206 1.144 0 .882-.19 1.092t-.856.21q-.657 0-.856-.195-.2-.195-.2-.81m1.897 10.982h3.291q.4 0 .59.17.19.168.19.538 0 .42-.18.58-.18.158-.661.158h-7.957q-.41 0-.616-.185-.204-.184-.205-.553 0-.36.216-.533.215-.175.646-.175h3.127v-6.573h-2q-.42 0-.64-.19t-.22-.548q0-.36.204-.538.205-.18.616-.18h3.004q.277 0 .436.113a.36.36 0 0 1 .159.308zm7.177.708v-1.825q0-.452.17-.646.168-.195.548-.195.42 0 .667.574.164.349.297.523.43.554 1.272.887.84.333 1.855.333 1.087 0 1.744-.44.656-.442.656-1.16 0-.727-.528-1.035t-1.81-.308h-.564q-2.091 0-3.189-.728t-1.097-2.112q0-1.353 1.071-2.102 1.072-.75 3.01-.749.79 0 1.61.22.82.221.861.221.113 0 .43-.2.319-.2.626-.2.349 0 .518.257.17.255.17.769v1.2q0 .543-.165.784-.164.24-.523.24-.308 0-.758-.522a7 7 0 0 0-.523-.544 3.4 3.4 0 0 0-1.16-.723q-.615-.22-1.445-.22-.964 0-1.553.426-.59.425-.59 1.081 0 .647.605.923.605.277 2.604.318 2.133.051 3.118.743.984.693.984 2.138 0 1.385-1.087 2.215t-2.932.83a9 9 0 0 1-1.303-.107 23 23 0 0 1-1.804-.364 5 5 0 0 1-.616.354q-.255.118-.43.118-.36 0-.549-.251-.19-.252-.19-.723m32.915-11.085q.103-.276.288-.39.184-.112.533-.112.379 0 .533.184.153.184.154.76a79 79 0 0 0 .04 2.624q0 .481-.163.651-.164.17-.585.17-.676 0-.882-.964l-.112-.441q-.195-.77-.933-1.256-.739-.487-1.733-.487-1.815 0-2.913 1.327-1.097 1.328-1.097 3.564t1.113 3.563 2.938 1.328q.595 0 1.21-.17a5.3 5.3 0 0 0 1.21-.507q.276-.144.758-.487.482-.344.687-.344.318 0 .539.21.22.21.22.518t-.24.59-.898.692a6.8 6.8 0 0 1-1.733.83 6.2 6.2 0 0 1-1.835.267q-2.533 0-4.184-1.789-1.65-1.79-1.65-4.578 0-2.76 1.67-4.584 1.672-1.825 4.205-1.825.675 0 1.379.164.702.164 1.481.492m6.368 11.464q-.051.462-.236.641-.185.18-.584.18-.43 0-.641-.252-.21-.25-.241-.815l-.133-2.379v-.184q0-.493.19-.698.189-.204.63-.205.615 0 .882.882.123.44.236.667.359.717 1.133 1.107t1.85.39q1.323 0 2.149-.626.825-.625.825-1.6 0-.81-.507-1.302-.508-.492-1.482-.635l-1.518-.206q-2.123-.297-3.096-1.117-.974-.82-.974-2.307 0-1.57 1.297-2.636 1.296-1.065 3.235-1.066.563 0 1.19.149.624.148 1.414.466.021-.297.164-.41t.493-.113q.45 0 .625.134.174.132.215.635l.144 2.143v.103q0 .359-.205.559t-.574.2q-.544 0-.841-.76a2.8 2.8 0 0 0-.287-.645q-.339-.513-.974-.79a3.6 3.6 0 0 0-1.446-.276q-1.24 0-2.015.615-.774.615-.774 1.61 0 .78.579 1.23.58.45 1.769.615l1.64.205q1.784.237 2.687 1.092t.902 2.313q0 1.723-1.281 2.763-1.283 1.04-3.425 1.04-.738 0-1.467-.173a9 9 0 0 1-1.548-.544m12.602 0q-.051.462-.236.641-.185.18-.584.18-.43 0-.641-.252-.21-.25-.241-.815l-.133-2.379v-.184q0-.493.19-.698.189-.204.63-.205.615 0 .882.882.123.44.236.667.359.717 1.133 1.107t1.85.39q1.323 0 2.149-.626.825-.625.825-1.6 0-.81-.507-1.302-.509-.492-1.482-.635l-1.518-.206q-2.123-.297-3.096-1.117-.975-.82-.974-2.307 0-1.57 1.297-2.636 1.297-1.065 3.235-1.066.563 0 1.19.149.624.148 1.414.466.021-.297.164-.41t.493-.113q.45 0 .625.134.174.132.215.635l.144 2.143v.103q0 .359-.205.559t-.574.2q-.544 0-.841-.76a2.8 2.8 0 0 0-.287-.645q-.339-.513-.974-.79a3.6 3.6 0 0 0-1.446-.276q-1.24 0-2.015.615-.774.615-.774 1.61 0 .78.58 1.23.578.45 1.768.615l1.64.205q1.785.237 2.687 1.092.903.856.902 2.313 0 1.723-1.281 2.763-1.282 1.04-3.425 1.04-.738 0-1.466-.173a9 9 0 0 1-1.549-.544m31.357-1.107q.42 0 .64.184t.22.544q0 .369-.21.553t-.61.185h-6.705q-.42 0-.641-.185-.22-.184-.22-.553 0-.359.21-.544.21-.184.61-.184h1.743v-6.265h-1.682q-.42 0-.651-.195-.23-.195-.23-.554 0-.369.215-.554.215-.184.625-.184h1.62v-.698q0-1.855 1.056-2.691t3.415-.836q1.148 0 1.697.256.549.257.548.8a.66.66 0 0 1-.235.523.9.9 0 0 1-.605.205q-.185 0-.887-.123a7 7 0 0 0-1.205-.123q-1.159 0-1.661.487-.503.487-.503 1.615v.585h3.63q.42 0 .641.184.22.185.22.554 0 .348-.225.549-.226.2-.615.2h-3.548v6.265zm9.443.287q1.58 0 2.59-1t1.01-2.548-1.016-2.558q-1.014-1.01-2.584-1.01-1.568 0-2.578 1.01t-1.01 2.558q0 1.558 1.004 2.553t2.584.995m5.384-3.548q0 2.195-1.497 3.589t-3.887 1.394q-2.378 0-3.876-1.394-1.497-1.395-1.497-3.59 0-2.193 1.497-3.583t3.876-1.39q2.379 0 3.882 1.395 1.502 1.395 1.502 3.579m6.214 3.281h3.404q.4 0 .59.17.19.168.19.538 0 .42-.18.58-.18.158-.662.158h-6.706q-.4 0-.605-.185-.204-.184-.205-.553 0-.36.21-.533.21-.175.652-.175h1.784v-6.573h-.697q-.995 0-1.241-.158-.246-.16-.246-.58 0-.36.2-.538.2-.18.61-.18h2.338q.276 0 .42.108a.37.37 0 0 1 .144.313v1.743q.974-1.22 2.03-1.815a4.56 4.56 0 0 1 2.276-.595q.913 0 1.477.37.564.369.564.953a.94.94 0 0 1-.282.672q-.282.292-.62.292-.237 0-.795-.313-.56-.312-1-.313-.8 0-1.687.57-.887.569-1.963 1.8zm29.295-7.413V67.1q0-.339.195-.498t.605-.159q.42 0 .58.246.158.247.158 1.016v1.907q0 .379-.195.569-.194.19-.584.19a.74.74 0 0 1-.477-.16q-.2-.158-.487-.66-.492-.831-1.195-1.257-.702-.425-1.615-.425-1.599 0-2.599.943t-1 2.44q0 1.528.959 2.497.96.97 2.466.97.687 0 1.307-.19a4.3 4.3 0 0 0 1.175-.57q.195-.123.522-.379.667-.543 1.046-.543a.7.7 0 0 1 .518.2.7.7 0 0 1 .2.517q0 .81-1.533 1.656a6.64 6.64 0 0 1-3.255.846q-2.226 0-3.707-1.425-1.482-1.425-1.482-3.558t1.477-3.563 3.691-1.43q.779 0 1.564.21a9 9 0 0 1 1.666.65m9.516 7.68q1.578 0 2.589-1t1.01-2.548q0-1.548-1.015-2.558t-2.584-1.01-2.58 1.01-1.01 2.558q0 1.558 1.006 2.553 1.004.995 2.584.995m5.383-3.548q0 2.195-1.497 3.589t-3.886 1.394q-2.379 0-3.876-1.394-1.497-1.395-1.497-3.59 0-2.193 1.497-3.583t3.876-1.39q2.38 0 3.88 1.395 1.503 1.395 1.503 3.579m11.023-.984q0-1.446-.262-1.954-.261-.507-.897-.507-.758 0-1.205.656-.446.656-.446 1.805v4.265h.185q.625 0 .836.149.21.148.21.559 0 .369-.175.553-.173.185-.533.185h-1.302q-.441 0-.6-.205t-.159-.882V69.49q0-.77-.348-1.215-.349-.447-.954-.446-.462 0-.846.271-.385.273-.661.805v5.65h.38q.615 0 .83.154t.215.554q0 .42-.174.58-.175.158-.667.158h-2.727q-.4 0-.59-.18t-.19-.558q0-.41.241-.56.24-.148.939-.148h.205v-6.573h-.185q-.717 0-.98-.164-.26-.163-.26-.574 0-.36.204-.538.205-.18.616-.18H314q.339 0 .447.118t.128.498q.42-.451.902-.667a2.6 2.6 0 0 1 1.087-.215q.717 0 1.184.313.467.312.692.948.432-.646.995-.954a2.65 2.65 0 0 1 1.292-.307q1.323 0 1.933.861t.61 2.79v4.644h.164q.636 0 .851.154t.215.554q0 .369-.184.553t-.544.185h-1.24q-.41 0-.605-.246t-.195-.78zm6.152 8.336h2.461q.39 0 .585.185.195.184.194.553 0 .4-.19.564-.19.165-.67.164h-4.523q-.41 0-.62-.184t-.21-.544q0-.41.261-.574.26-.165.97-.164h.194V67.981h-.195q-.708 0-.969-.164-.261-.163-.261-.574 0-.36.21-.538.21-.18.62-.18h1.559q.308 0 .446.103.138.102.138.318v.994q.698-.717 1.543-1.076a4.6 4.6 0 0 1 1.82-.36q2.062 0 3.446 1.395t1.384 3.497q0 2.02-1.312 3.322t-3.353 1.303a5.1 5.1 0 0 1-2-.385 4.05 4.05 0 0 1-1.528-1.102zm3.179-4.112q1.425 0 2.338-.897.912-.897.912-2.323 0-1.395-.917-2.302-.918-.907-2.333-.907t-2.317.902-.903 2.307q0 1.415.897 2.318.898.902 2.323.902m12.069.308q1.58 0 2.589-1 1.01-1 1.01-2.548t-1.015-2.558-2.584-1.01q-1.57 0-2.579 1.01t-1.01 2.558q0 1.558 1.005 2.553t2.584.995m5.383-3.548q0 2.195-1.497 3.589t-3.886 1.394q-2.379 0-3.876-1.394-1.497-1.395-1.497-3.59 0-2.193 1.497-3.583t3.876-1.39q2.38 0 3.88 1.395 1.503 1.395 1.503 3.579m3.404 3.281v-6.573h-.194q-.697 0-.96-.164-.26-.163-.26-.574 0-.38.215-.548.215-.17.697-.17h1.466q.277 0 .43.113a.36.36 0 0 1 .155.308v.697q.749-.697 1.481-1.03a3.6 3.6 0 0 1 1.523-.334q1.548 0 2.435.964.888.964.887 2.666v4.645h.482q.513 0 .739.17.225.168.225.538 0 .4-.24.569-.242.17-.857.169h-2.266q-.657 0-.84-.154-.186-.153-.185-.584 0-.4.215-.554.214-.154.81-.154h.359V70.29q0-1.2-.544-1.83-.543-.631-1.579-.631-1.046 0-1.845.707-.8.707-.8 1.754v4.265h.359q.615 0 .83.154.216.154.216.554 0 .43-.185.584t-.902.154h-2.42q-.42 0-.63-.18t-.211-.558q0-.41.24-.56.241-.148.94-.148zm12.951-2.84q.082 1.476 1 2.281t2.507.805q1.2 0 2.615-.64 1.415-.642 1.712-.641.308 0 .513.194.204.195.205.482 0 .298-.215.544-.216.245-.687.482-1.026.502-2.118.769a9 9 0 0 1-2.169.266q-2.337 0-3.742-1.348t-1.405-3.574q0-2.266 1.487-3.67 1.486-1.405 3.876-1.405 2.163 0 3.589 1.312 1.425 1.313 1.425 3.179 0 .575-.241.769t-1.307.195zm.051-1.343h6.676q-.154-1.22-1.02-1.964-.867-.743-2.128-.743-1.365 0-2.297.717-.933.718-1.23 1.99m12.203 4.183v-6.573h-.195q-.697 0-.96-.164-.26-.163-.26-.574 0-.38.215-.548.215-.17.697-.17h1.466q.278 0 .431.113a.36.36 0 0 1 .154.308v.697q.748-.697 1.482-1.03a3.6 3.6 0 0 1 1.522-.334q1.548 0 2.436.964.886.964.887 2.666v4.645h.481q.513 0 .739.17.225.168.225.538 0 .4-.24.569-.242.17-.857.169h-2.266q-.656 0-.84-.154-.186-.153-.185-.584 0-.4.215-.554.216-.154.81-.154h.359V70.29q0-1.2-.544-1.83-.543-.631-1.579-.631-1.046 0-1.845.707-.8.707-.8 1.754v4.265h.359q.615 0 .83.154.216.154.216.554 0 .43-.185.584t-.902.154h-2.42q-.42 0-.63-.18t-.211-.558q0-.41.24-.56.242-.148.94-.148zM396.34 67.1q.503 0 .733.174.231.173.231.554 0 .358-.215.538-.216.18-.646.18h-4.153v3.424q0 1.682.436 2.215t1.492.533q.933 0 2.235-.543 1.302-.544 1.61-.544.287 0 .487.205.2.206.2.503a.8.8 0 0 1-.251.59q-.252.251-.856.487-1.005.4-1.81.584a6.8 6.8 0 0 1-1.513.185q-1.2 0-2.015-.385a2.57 2.57 0 0 1-1.215-1.143 2.6 2.6 0 0 1-.292-.851q-.087-.492-.087-1.518v-3.743h-1.743q-.43 0-.626-.169-.195-.169-.195-.548 0-.42.267-.575.267-.153 1.138-.153h1.159v-2.646q0-.44.19-.651.19-.21.59-.21.45 0 .625.256.174.256.174 1.17v2.08zm5.332 8.162v-1.825q0-.452.17-.646.168-.195.548-.195.42 0 .667.574.163.349.297.523.43.554 1.271.887.842.333 1.856.333 1.087 0 1.744-.44.656-.442.656-1.16 0-.727-.528-1.035t-1.81-.308h-.564q-2.093 0-3.189-.728t-1.097-2.112q0-1.353 1.071-2.102 1.072-.75 3.01-.749.79 0 1.61.22.82.221.861.221.113 0 .43-.2.319-.2.626-.2.349 0 .518.257.17.255.17.769v1.2q0 .543-.165.784-.164.24-.523.24-.307 0-.759-.522a7 7 0 0 0-.522-.544 3.4 3.4 0 0 0-1.16-.723q-.615-.22-1.445-.22-.964 0-1.553.426-.59.425-.59 1.081 0 .647.605.923.605.277 2.604.318 2.133.051 3.118.743.984.693.984 2.138 0 1.385-1.087 2.215t-2.933.83a9 9 0 0 1-1.302-.107 23 23 0 0 1-1.804-.364 5 5 0 0 1-.616.354q-.256.118-.43.118-.36 0-.549-.251-.19-.252-.19-.723m30.27-8.06 2.707-1.159.143-.04a.4.4 0 0 1 .113-.021q.082 0 .139.077.056.076.128.282l.256.78q.03.122.046.2.015.075.016.107 0 .081-.082.143a.6.6 0 0 1-.236.093l-2.871.646 1.928 2.235a.4.4 0 0 1 .107.138.35.35 0 0 1 .036.149q0 .051-.067.128a1.5 1.5 0 0 1-.179.17l-.677.481a1.4 1.4 0 0 1-.195.129.3.3 0 0 1-.123.035q-.06 0-.133-.061a.7.7 0 0 1-.133-.164l-1.518-2.543-1.507 2.543a.6.6 0 0 1-.149.169.25.25 0 0 1-.149.056.3.3 0 0 1-.123-.04 1 1 0 0 1-.184-.124l-.656-.482a1.3 1.3 0 0 1-.205-.169q-.072-.076-.072-.148 0-.052.04-.129a.5.5 0 0 1 .114-.138l1.927-2.235-2.85-.646a.6.6 0 0 1-.252-.098q-.087-.066-.087-.159 0-.02.036-.128t.046-.159l.257-.78a.9.9 0 0 1 .123-.281q.061-.077.143-.077.083 0 .144.01a.5.5 0 0 1 .113.03l2.707 1.18-.277-2.943v-.123q0-.174.092-.236.093-.06.37-.061h.8q.286 0 .373.061.087.062.087.236v.123zm9.7 9.075q-.225.513-.425.697a.68.68 0 0 1-.477.185.7.7 0 0 1-.503-.21.68.68 0 0 1-.184-.698q.03-.108.082-.23l6.398-13.792q.256-.532.451-.723a.65.65 0 0 1 .472-.19.73.73 0 0 1 .523.205q.215.205.215.493a.798.798 0 0 1-.103.38z"}))))};var y=s(3013);const j="hero",f=(...e)=>(0,y.rx)(j,...e),b=f,S="hero__root",w="hero__logo",N="hero__buttons",_="hero__getStarted";var C=s(4848);function E(e){let{className:t}=e;return(0,C.jsx)("header",{className:b(S,"hero hero--primary",t),children:(0,C.jsxs)("div",{className:"container",children:[(0,C.jsx)(g,{className:w}),(0,C.jsx)("div",{className:N,children:(0,C.jsx)(u.A,{className:b(_,"button button--outline button--secondary button--lg"),to:(0,x.Ay)("docs/getting-started/intro"),children:"Get Started"})})]})})}var k=s(5453);const A="responsive-embed__root";function z(e){let{src:t}=e;return(0,C.jsx)("div",{className:A,children:(0,C.jsx)("iframe",{src:t,frameBorder:"0",allowFullScreen:!0})})}s(6114),s(4183);const M="index",I=(...e)=>(0,y.rx)(M,...e),T=I,V="index__root",W="index__hero",B="index__features",D="index__feature",P="index__section",X="index__sectionAlt",F="index__heart",G="index__quote",H="index__lspDemo",L="index__playWithIt";const J=function(){const e=(0,p.A)(),{siteConfig:t}=e;return(0,C.jsxs)(q.A,{wrapperClassName:V,title:t.title,description:"A modern CSS pre-processor built for components",children:[(0,C.jsx)(E,{className:W}),(0,C.jsxs)("main",{children:[(0,C.jsx)("section",{className:B,children:(0,C.jsx)("div",{className:"container",children:(0,C.jsxs)("div",{className:"row",children:[(0,C.jsx)(k.X,{className:D,title:"CSS Superset",image:"img/component.svg",children:"Extending CSS so that it is easier to use in a component ecosystem, but without losing any of the declarative, familiar, static and fast aspects of CSS."}),(0,C.jsx)(k.X,{className:D,title:"Style API",image:"img/api.svg",children:"Each component exposes a Style API that maps its internal parts and states so you can reuse components across teams without sacrificing stylability or scalability."}),(0,C.jsx)(k.X,{className:D,title:"Type Safety",image:"img/stethoscope.svg",children:"Provide the ability to see errors at build time or even while working in your IDE. Wave goodbye to silent run-time breakage misery!"}),(0,C.jsx)(k.X,{className:D,title:"Performant",image:"img/checklist.svg",children:"Perform build-time transpilation and require only a minimal runtime. Use custom states and properties for dynamic interactions."}),(0,C.jsx)(k.X,{className:D,title:"Mixins & Formatters",image:"img/prototype.svg",children:"Easily create complex designs using CSS or JavaScript and reuse them across projects."}),(0,C.jsx)(k.X,{className:D,title:"Developer Tooling",image:"img/tool.svg",children:"Use our language-intelligence IDE extension for a better development experience including completions, defintions, hinting, diagnostics and more."})]})})}),(0,C.jsx)("section",{className:T(P,X),children:(0,C.jsxs)("div",{className:"container",children:[(0,C.jsx)("h2",{children:"What is Stylable?"}),(0,C.jsxs)("p",{children:["At ",(0,C.jsx)(u.A,{to:"https://www.wix.engineering/",children:"Wix"}),", we"," ",(0,C.jsx)("span",{className:F,children:"\u2665 "}),"CSS. Its simple, declarative syntax that is native in browsers is easily the fastest way to add styles to web pages and web apps. But when writing CSS that is scoped to individual components, developers have to maintain highly-specific selectors, using elaborate conventions to fake namespacing. Writing and maintaining CSS across large teams and large projects can be tricky."]}),(0,C.jsxs)("p",{children:["We also ",(0,C.jsx)("span",{className:F,children:"\u2665"})," TypeScript. TypeScript helps us manage these large projects, exposing at build-time what we could once only see at run-time."]}),(0,C.jsxs)("div",{children:["We want to give CSS a ",(0,C.jsx)("em",{children:"type system"})," \u2014 to do for CSS what TypeScript does for JavaScript.",(0,C.jsx)("ul",{})]}),"So we created ",(0,C.jsx)("strong",{children:"Stylable"})," \u2014 a CSS preprocessor that enables you to write style rules in CSS syntax, with some extensions that we believe adhere to the spirit of CSS."]})}),(0,C.jsx)("section",{className:P,children:(0,C.jsxs)("div",{className:"container",children:[(0,C.jsx)("h2",{children:"What Does Stylable Do?"}),(0,C.jsxs)("ul",{children:[(0,C.jsx)("li",{children:'Stylable scopes styles to components so they don\u2019t "leak" and clash with other styles.'}),(0,C.jsx)("li",{children:"Stylable enables custom pseudo-classes and pseudo-elements that abstract the internal state and structure of a component. These can then be styled externally. For example, you can style the label inside a button, or style the play button of a video player from outside these components."}),(0,C.jsx)("li",{children:"At build time, the preprocessor converts the Stylable CSS into flat, static, valid, vanilla CSS that works cross-browser."})]})]})}),(0,C.jsx)("section",{className:T(P,X),children:(0,C.jsxs)("div",{className:"container",children:[(0,C.jsx)("h2",{children:"Tooling"}),(0,C.jsx)("img",{className:H,src:"img/stylable-lsp-opt.gif",alt:"Stylable Intelligence Demo"}),(0,C.jsx)("p",{children:"Treating CSS as a type system opens up a whole new world of tooling. You can:"}),(0,C.jsxs)("ul",{children:[(0,C.jsx)("li",{children:"Get code completion that hints at the internal structure of components."}),(0,C.jsx)("li",{children:"Get types for your parameters. And so much more."})]}),(0,C.jsx)("strong",{children:"Stylable"})," enhances the styling development process. To get the full"," ",(0,C.jsx)("strong",{children:"Stylable"})," experience, install our"," ",(0,C.jsx)(u.A,{to:"https://marketplace.visualstudio.com/items?itemName=wix.stylable-intelligence",children:"VSCode Intellisense Extension"}),". It supports code completions, diagnostics, go to definitions, syntax highlighting and more."]})}),(0,C.jsx)("section",{className:P,children:(0,C.jsxs)("div",{className:"container",children:[(0,C.jsx)("h2",{children:"Videos"}),(0,C.jsx)("h3",{children:"Introduction to Stylable"}),(0,C.jsx)(z,{src:"https://www.youtube-nocookie.com/embed/Cx-JyJ9eXks?rel=0"}),(0,C.jsx)("h3",{children:"The Official Stylable Musical!"}),(0,C.jsx)(z,{src:"https://www.youtube.com/embed/jK88TqyXSWs?rel=0"})]})}),(0,C.jsx)("section",{className:T(P,X),children:(0,C.jsxs)("div",{className:"container",children:[(0,C.jsx)("h2",{children:"Documentation"}),(0,C.jsx)(u.A,{to:"./docs/getting-started/intro",children:"Learn more about Stylable"})," and get started with step by step instructions and code examples."]})}),(0,C.jsx)("section",{className:P,children:(0,C.jsxs)("div",{className:"container",children:[(0,C.jsx)("h2",{children:"Demo Project"}),(0,C.jsxs)("p",{children:["You can download our"," ",(0,C.jsxs)(u.A,{to:"https://github.com/wix/potato-bruce",children:["Learn more about ",(0,C.jsx)("strong",{children:"Mr. Potato Bruce project"})]})," ","from GitHub. It's a"," ",(0,C.jsx)(u.A,{to:"https://wix.github.io/potato-bruce/",children:(0,C.jsx)("strong",{children:"demo application"})})," ","showcasing the features and typed style API. Bruce explains it in his React Europe 2018 talk:"]}),(0,C.jsx)("div",{children:(0,C.jsx)(z,{src:"https://www.youtube.com/embed/YRhJZZsTEvQ"})}),(0,C.jsx)("p",{className:L,children:"Play with it and let us know what you think!"})]})}),(0,C.jsx)("section",{className:T(P,X),children:(0,C.jsx)("div",{className:"container",children:(0,C.jsxs)("div",{children:[(0,C.jsx)("h2",{children:"Shut up and take my money!"}),(0,C.jsxs)("p",{children:["No need! ",(0,C.jsx)("strong",{children:"Stylable"})," is open-source. Take it, use it, make your development easier and your apps faster. Viva CSS, and welcome ",(0,C.jsx)("strong",{children:"Stylable"}),". We hope you like it."]}),(0,C.jsxs)("p",{children:["Click here to access the MIT-licensed"," ",(0,C.jsx)(u.A,{to:"https://github.com/wix/stylable",children:"Stylable GitHub project"}),"."]}),(0,C.jsxs)("blockquote",{className:G,children:[(0,C.jsx)("p",{children:"New ideas will come along, but they will extend CSS rather than replace it. I believe that the CSS code we write today will be readable by computers 500 years from now."}),(0,C.jsxs)("small",{children:["\u2014"," ",(0,C.jsx)(u.A,{to:"https://dev.opera.com/articles/css-twenty-years-hakon/",children:"H\xe5kon Wium Lie"}),", co-creator of CSS."]})]})]})})})]})]})}},4160:(e,t,s)=>{e.exports=s.p+"f4bc9dffc19ff19f.svg"},3013:(e,t,s)=>{function a(e,t,s){if(!1===s||null==s||s!=s)return"";if(!0===s)return e+"--"+t;var a=s.toString();return e+"---"+t+"-"+a.length+"-"+a.replace(/\s/gm,"_")}function l(e){for(var t=[],s=1;s l})}}]); \ No newline at end of file diff --git a/assets/js/1f7dc951.289a336c.js b/assets/js/1f7dc951.67324d4b.js similarity index 98% rename from assets/js/1f7dc951.289a336c.js rename to assets/js/1f7dc951.67324d4b.js index 0c9d6516..9d987f65 100644 --- a/assets/js/1f7dc951.289a336c.js +++ b/assets/js/1f7dc951.67324d4b.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[9597],{6919:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>r,contentTitle:()=>c,default:()=>h,frontMatter:()=>i,metadata:()=>o,toc:()=>l});const o=JSON.parse('{"id":"guides/shared-classes","title":"Shared Classes","description":"When building a component library or an application, it is useful to reuse classes that can be shared across components to achieve common CSS with lower specificity.","source":"@site/docs/guides/shared-classes.md","sourceDirName":"guides","slug":"/guides/shared-classes","permalink":"/docs/guides/shared-classes","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/guides/shared-classes.md","tags":[],"version":"current","frontMatter":{"id":"shared-classes","title":"Shared Classes"},"sidebar":"Guides","previous":{"title":"Project Commons","permalink":"/docs/guides/project-commons"},"next":{"title":"Component Variants","permalink":"/docs/guides/component-variants"}}');var t=n(4848),a=n(8453);const i={id:"shared-classes",title:"Shared Classes"},c=void 0,r={},l=[{value:"Defining a shared class",id:"defining-a-shared-class",level:2},{value:"Use shared classes in components",id:"use-shared-classes-in-components",level:2}];function d(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",strong:"strong",...(0,a.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.p,{children:"When building a component library or an application, it is useful to reuse classes that can be shared across components to achieve common CSS with lower specificity."}),"\n",(0,t.jsx)(s.h2,{id:"defining-a-shared-class",children:"Defining a shared class"}),"\n",(0,t.jsxs)(s.p,{children:["In the ",(0,t.jsx)(s.a,{href:"/docs/guides/project-commons",children:"commons stylable stylesheet"})," of your project (usually named ",(0,t.jsx)(s.code,{children:"project.st.css"}),"), you define a CSS class with a descriptive name like ",(0,t.jsx)(s.code,{children:"emphasisBox"}),"."]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",metastring:'title="project.st.css"',children:".emphasisBox {\n background: pink;\n color: white;\n}\n"})}),"\n",(0,t.jsx)(s.h2,{id:"use-shared-classes-in-components",children:"Use shared classes in components"}),"\n",(0,t.jsxs)(s.p,{children:["A component's ",(0,t.jsx)(s.strong,{children:"Stylable"})," stylesheet can use and extend shared classes:"]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",metastring:'title="comp.st.css"',children:'@st-import [emphasisBox] from "./project.st.css";\n/*\nselector: .comp__root .project__emphasisBox\njs value: "project__emphasisBox"\n*/\n.root .emphasisBox {}\n/*\nselector: .comp__messageBox.project__emphasisBox\njs value: "comp__messageBox project__emphasisBox"\n*/\n.messageBox {\n -st-extends: emphasisBox;\n}\n'})}),"\n",(0,t.jsx)(s.admonition,{type:"note",children:(0,t.jsxs)(s.p,{children:["For the ",(0,t.jsx)(s.code,{children:".emphasisBox"})," selector, we manually added the ",(0,t.jsx)(s.code,{children:".root"})," class to avoid overriding ",(0,t.jsx)(s.code,{children:"emphasisBox"})," outside this scope."]})})]})}function h(e={}){const{wrapper:s}={...(0,a.R)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},8453:(e,s,n)=>{n.d(s,{R:()=>i,x:()=>c});var o=n(6540);const t={},a=o.createContext(t);function i(e){const s=o.useContext(a);return o.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function c(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:i(e.components),o.createElement(a.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[9597],{1459:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>r,contentTitle:()=>c,default:()=>h,frontMatter:()=>i,metadata:()=>o,toc:()=>l});const o=JSON.parse('{"id":"guides/shared-classes","title":"Shared Classes","description":"When building a component library or an application, it is useful to reuse classes that can be shared across components to achieve common CSS with lower specificity.","source":"@site/docs/guides/shared-classes.md","sourceDirName":"guides","slug":"/guides/shared-classes","permalink":"/docs/guides/shared-classes","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/guides/shared-classes.md","tags":[],"version":"current","frontMatter":{"id":"shared-classes","title":"Shared Classes"},"sidebar":"Guides","previous":{"title":"Project Commons","permalink":"/docs/guides/project-commons"},"next":{"title":"Component Variants","permalink":"/docs/guides/component-variants"}}');var t=n(4848),a=n(8453);const i={id:"shared-classes",title:"Shared Classes"},c=void 0,r={},l=[{value:"Defining a shared class",id:"defining-a-shared-class",level:2},{value:"Use shared classes in components",id:"use-shared-classes-in-components",level:2}];function d(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",strong:"strong",...(0,a.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.p,{children:"When building a component library or an application, it is useful to reuse classes that can be shared across components to achieve common CSS with lower specificity."}),"\n",(0,t.jsx)(s.h2,{id:"defining-a-shared-class",children:"Defining a shared class"}),"\n",(0,t.jsxs)(s.p,{children:["In the ",(0,t.jsx)(s.a,{href:"/docs/guides/project-commons",children:"commons stylable stylesheet"})," of your project (usually named ",(0,t.jsx)(s.code,{children:"project.st.css"}),"), you define a CSS class with a descriptive name like ",(0,t.jsx)(s.code,{children:"emphasisBox"}),"."]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",metastring:'title="project.st.css"',children:".emphasisBox {\n background: pink;\n color: white;\n}\n"})}),"\n",(0,t.jsx)(s.h2,{id:"use-shared-classes-in-components",children:"Use shared classes in components"}),"\n",(0,t.jsxs)(s.p,{children:["A component's ",(0,t.jsx)(s.strong,{children:"Stylable"})," stylesheet can use and extend shared classes:"]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",metastring:'title="comp.st.css"',children:'@st-import [emphasisBox] from "./project.st.css";\n/*\nselector: .comp__root .project__emphasisBox\njs value: "project__emphasisBox"\n*/\n.root .emphasisBox {}\n/*\nselector: .comp__messageBox.project__emphasisBox\njs value: "comp__messageBox project__emphasisBox"\n*/\n.messageBox {\n -st-extends: emphasisBox;\n}\n'})}),"\n",(0,t.jsx)(s.admonition,{type:"note",children:(0,t.jsxs)(s.p,{children:["For the ",(0,t.jsx)(s.code,{children:".emphasisBox"})," selector, we manually added the ",(0,t.jsx)(s.code,{children:".root"})," class to avoid overriding ",(0,t.jsx)(s.code,{children:"emphasisBox"})," outside this scope."]})})]})}function h(e={}){const{wrapper:s}={...(0,a.R)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},8453:(e,s,n)=>{n.d(s,{R:()=>i,x:()=>c});var o=n(6540);const t={},a=o.createContext(t);function i(e){const s=o.useContext(a);return o.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function c(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:i(e.components),o.createElement(a.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/2560.9c924c04.js b/assets/js/2237.b76b95a8.js similarity index 80% rename from assets/js/2560.9c924c04.js rename to assets/js/2237.b76b95a8.js index 6033aac6..aa5e1b6f 100644 --- a/assets/js/2560.9c924c04.js +++ b/assets/js/2237.b76b95a8.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[2560],{3510:(e,t,i)=>{i.d(t,{A:()=>l});i(6540);var n=i(4164),o=i(3230),s=i(5225),a=i(4848);function l(e){let{className:t}=e;return(0,a.jsx)("main",{className:(0,n.A)("container margin-vert--xl",t),children:(0,a.jsx)("div",{className:"row",children:(0,a.jsxs)("div",{className:"col col--6 col--offset-3",children:[(0,a.jsx)(s.A,{as:"h1",className:"hero__title",children:(0,a.jsx)(o.A,{id:"theme.NotFound.title",description:"The title of the 404 page",children:"Page Not Found"})}),(0,a.jsx)("p",{children:(0,a.jsx)(o.A,{id:"theme.NotFound.p1",description:"The first paragraph of the 404 page",children:"We could not find what you were looking for."})}),(0,a.jsx)("p",{children:(0,a.jsx)(o.A,{id:"theme.NotFound.p2",description:"The 2nd paragraph of the 404 page",children:"Please contact the owner of the site that linked you to the original URL and let them know their link is broken."})})]})})})}},2560:(e,t,i)=>{i.r(t),i.d(t,{default:()=>r});i(6540);var n=i(3230),o=i(6644),s=i(7635),a=i(3510),l=i(4848);function r(){const e=(0,n.T)({id:"theme.NotFound.title",message:"Page Not Found"});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(o.be,{title:e}),(0,l.jsx)(s.A,{children:(0,l.jsx)(a.A,{})})]})}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[2237],{3363:(e,t,i)=>{i.d(t,{A:()=>l});i(6540);var n=i(4164),o=i(1312),s=i(1107),a=i(4848);function l(e){let{className:t}=e;return(0,a.jsx)("main",{className:(0,n.A)("container margin-vert--xl",t),children:(0,a.jsx)("div",{className:"row",children:(0,a.jsxs)("div",{className:"col col--6 col--offset-3",children:[(0,a.jsx)(s.A,{as:"h1",className:"hero__title",children:(0,a.jsx)(o.A,{id:"theme.NotFound.title",description:"The title of the 404 page",children:"Page Not Found"})}),(0,a.jsx)("p",{children:(0,a.jsx)(o.A,{id:"theme.NotFound.p1",description:"The first paragraph of the 404 page",children:"We could not find what you were looking for."})}),(0,a.jsx)("p",{children:(0,a.jsx)(o.A,{id:"theme.NotFound.p2",description:"The 2nd paragraph of the 404 page",children:"Please contact the owner of the site that linked you to the original URL and let them know their link is broken."})})]})})})}},2237:(e,t,i)=>{i.r(t),i.d(t,{default:()=>r});i(6540);var n=i(1312),o=i(1213),s=i(7823),a=i(3363),l=i(4848);function r(){const e=(0,n.T)({id:"theme.NotFound.title",message:"Page Not Found"});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(o.be,{title:e}),(0,l.jsx)(s.A,{children:(0,l.jsx)(a.A,{})})]})}}}]); \ No newline at end of file diff --git a/assets/js/24352365.d82f4c13.js b/assets/js/24352365.0cdd2c1d.js similarity index 97% rename from assets/js/24352365.d82f4c13.js rename to assets/js/24352365.0cdd2c1d.js index 5bb41c47..d899a326 100644 --- a/assets/js/24352365.d82f4c13.js +++ b/assets/js/24352365.0cdd2c1d.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[5395],{8365:(t,e,o)=>{o.r(e),o.d(e,{assets:()=>a,contentTitle:()=>l,default:()=>u,frontMatter:()=>r,metadata:()=>n,toc:()=>c});const n=JSON.parse('{"id":"getting-started/storybook-integration","title":"Storybook","description":"To integrate Stylable with Storybook, you need to do two things:","source":"@site/docs/getting-started/storybook-integration.md","sourceDirName":"getting-started","slug":"/getting-started/storybook-integration","permalink":"/docs/getting-started/storybook-integration","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/getting-started/storybook-integration.md","tags":[],"version":"current","frontMatter":{"id":"storybook-integration","title":"Storybook"},"sidebar":"Discover","previous":{"title":"Rollup","permalink":"/docs/getting-started/rollup-integration"},"next":{"title":"TypeScript","permalink":"/docs/getting-started/typescript-integration"}}');var i=o(4848),s=o(8453);const r={id:"storybook-integration",title:"Storybook"},l=void 0,a={},c=[];function d(t){const e={admonition:"admonition",code:"code",li:"li",ol:"ol",p:"p",pre:"pre",...(0,s.R)(),...t.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e.p,{children:"To integrate Stylable with Storybook, you need to do two things:"}),"\n",(0,i.jsxs)(e.ol,{children:["\n",(0,i.jsxs)(e.li,{children:["Exclude Stylable files (",(0,i.jsx)(e.code,{children:"*.st.css"}),") from all other existing CSS loaders."]}),"\n",(0,i.jsxs)(e.li,{children:["Add ",(0,i.jsx)(e.code,{children:"StylableWebpackPlugin"})," to the webpack configuration."]}),"\n"]}),"\n",(0,i.jsx)(e.p,{children:"Add the following snippit to your Storybook webpack configuration to get these two actions done:"}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-js",children:"const {\n StylableWebpackPlugin,\n applyWebpackConfigStylableExcludes\n} = require('@stylable/webpack-plugin');\n\nmodule.exports = {\n stories: ...,\n addons: ...,\n webpackFinal: (config) => {\n /* find all css loaders and add exclude .st.css files from them */\n applyWebpackConfigStylableExcludes(config);\n\n /* inject StylableWebpackPlugin */\n config.plugins.push(new StylableWebpackPlugin());\n return config;\n }\n}\n"})}),"\n",(0,i.jsx)(e.admonition,{type:"caution",children:(0,i.jsx)(e.p,{children:"This snippet should work with default Storybook configuration. It assumes some things about the structure of the file which might not be true in future releases of Storybook."})})]})}function u(t={}){const{wrapper:e}={...(0,s.R)(),...t.components};return e?(0,i.jsx)(e,{...t,children:(0,i.jsx)(d,{...t})}):d(t)}},8453:(t,e,o)=>{o.d(e,{R:()=>r,x:()=>l});var n=o(6540);const i={},s=n.createContext(i);function r(t){const e=n.useContext(s);return n.useMemo((function(){return"function"==typeof t?t(e):{...e,...t}}),[e,t])}function l(t){let e;return e=t.disableParentContext?"function"==typeof t.components?t.components(i):t.components||i:r(t.components),n.createElement(s.Provider,{value:e},t.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[5395],{8033:(t,e,o)=>{o.r(e),o.d(e,{assets:()=>a,contentTitle:()=>l,default:()=>u,frontMatter:()=>r,metadata:()=>n,toc:()=>c});const n=JSON.parse('{"id":"getting-started/storybook-integration","title":"Storybook","description":"To integrate Stylable with Storybook, you need to do two things:","source":"@site/docs/getting-started/storybook-integration.md","sourceDirName":"getting-started","slug":"/getting-started/storybook-integration","permalink":"/docs/getting-started/storybook-integration","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/getting-started/storybook-integration.md","tags":[],"version":"current","frontMatter":{"id":"storybook-integration","title":"Storybook"},"sidebar":"Discover","previous":{"title":"Rollup","permalink":"/docs/getting-started/rollup-integration"},"next":{"title":"TypeScript","permalink":"/docs/getting-started/typescript-integration"}}');var i=o(4848),s=o(8453);const r={id:"storybook-integration",title:"Storybook"},l=void 0,a={},c=[];function d(t){const e={admonition:"admonition",code:"code",li:"li",ol:"ol",p:"p",pre:"pre",...(0,s.R)(),...t.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e.p,{children:"To integrate Stylable with Storybook, you need to do two things:"}),"\n",(0,i.jsxs)(e.ol,{children:["\n",(0,i.jsxs)(e.li,{children:["Exclude Stylable files (",(0,i.jsx)(e.code,{children:"*.st.css"}),") from all other existing CSS loaders."]}),"\n",(0,i.jsxs)(e.li,{children:["Add ",(0,i.jsx)(e.code,{children:"StylableWebpackPlugin"})," to the webpack configuration."]}),"\n"]}),"\n",(0,i.jsx)(e.p,{children:"Add the following snippit to your Storybook webpack configuration to get these two actions done:"}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-js",children:"const {\n StylableWebpackPlugin,\n applyWebpackConfigStylableExcludes\n} = require('@stylable/webpack-plugin');\n\nmodule.exports = {\n stories: ...,\n addons: ...,\n webpackFinal: (config) => {\n /* find all css loaders and add exclude .st.css files from them */\n applyWebpackConfigStylableExcludes(config);\n\n /* inject StylableWebpackPlugin */\n config.plugins.push(new StylableWebpackPlugin());\n return config;\n }\n}\n"})}),"\n",(0,i.jsx)(e.admonition,{type:"caution",children:(0,i.jsx)(e.p,{children:"This snippet should work with default Storybook configuration. It assumes some things about the structure of the file which might not be true in future releases of Storybook."})})]})}function u(t={}){const{wrapper:e}={...(0,s.R)(),...t.components};return e?(0,i.jsx)(e,{...t,children:(0,i.jsx)(d,{...t})}):d(t)}},8453:(t,e,o)=>{o.d(e,{R:()=>r,x:()=>l});var n=o(6540);const i={},s=n.createContext(i);function r(t){const e=n.useContext(s);return n.useMemo((function(){return"function"==typeof t?t(e):{...e,...t}}),[e,t])}function l(t){let e;return e=t.disableParentContext?"function"==typeof t.components?t.components(i):t.components||i:r(t.components),n.createElement(s.Provider,{value:e},t.children)}}}]); \ No newline at end of file diff --git a/assets/js/24ff752b.bfda4846.js b/assets/js/24ff752b.68406a9b.js similarity index 99% rename from assets/js/24ff752b.bfda4846.js rename to assets/js/24ff752b.68406a9b.js index c9227c43..76585735 100644 --- a/assets/js/24ff752b.bfda4846.js +++ b/assets/js/24ff752b.68406a9b.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[825],{6520:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>a,contentTitle:()=>d,default:()=>h,frontMatter:()=>o,metadata:()=>i,toc:()=>c});const i=JSON.parse('{"id":"guides/migration-v5","title":"Stylable v5","description":"The purpose of this document is to help migrate projects using Stylable to v5.","source":"@site/docs/guides/migration-v5.md","sourceDirName":"guides","slug":"/guides/migration-v5","permalink":"/docs/guides/migration-v5","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/guides/migration-v5.md","tags":[],"version":"current","frontMatter":{"id":"migration-v5","title":"Stylable v5"},"sidebar":"Guides","previous":{"title":"Stylable v3","permalink":"/docs/guides/migration-v3"}}');var t=n(4848),l=n(8453);const o={id:"migration-v5",title:"Stylable v5"},d=void 0,a={},c=[{value:" @stylable/core
",id:"stylablecore",level:2},{value:"Diagnostics overhaul",id:"diagnostics-overhaul",level:3},{value:"Reducing public facing APIs",id:"reducing-public-facing-apis",level:3},{value:"API changes",id:"api-changes",level:4},{value:"Missing APIs?",id:"missing-apis",level:4},{value:"@stylable/cli
",id:"stylablecli",level:2},{value:"Default arguments changed",id:"default-arguments-changed",level:3},{value:"Build index file and other outputs simultaneously",id:"build-index-file-and-other-outputs-simultaneously",level:3}];function r(e){const s={a:"a",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",p:"p",ul:"ul",...(0,l.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(s.p,{children:["The purpose of this document is to help migrate projects using Stylable to ",(0,t.jsx)(s.code,{children:"v5"}),"."]}),"\n",(0,t.jsxs)(s.p,{children:["We have taken the opportunity of node dropping LTS support for ",(0,t.jsx)(s.code,{children:"v12"})," and we have decided to include a number of additional breaking changes to the ",(0,t.jsx)(s.code,{children:"v5"})," release. These changes are primarily to the programmatic API of Stylable and not to user facing features, syntax or integrations."]}),"\n",(0,t.jsxs)(s.p,{children:["You can find the plan for this major version ",(0,t.jsx)(s.a,{href:"https://github.com/wix/stylable/issues/2410",children:"here"}),"."]}),"\n",(0,t.jsx)(s.h2,{id:"stylablecore",children:(0,t.jsx)(s.code,{children:"@stylable/core"})}),"\n",(0,t.jsx)(s.h3,{id:"diagnostics-overhaul",children:"Diagnostics overhaul"}),"\n",(0,t.jsxs)(s.p,{children:["All diagnostics in ",(0,t.jsx)(s.code,{children:"@stylable/core"})," had diagnostics code added, and were reviewed for consistency. Many diagnostics have had their severity increased to ",(0,t.jsx)(s.code,{children:"error"}),"."]}),"\n",(0,t.jsx)(s.p,{children:"We plan on starting to map out the diagnostics in this site to help users understand what they are seeing, and why it happened."}),"\n",(0,t.jsx)(s.h3,{id:"reducing-public-facing-apis",children:"Reducing public facing APIs"}),"\n",(0,t.jsx)(s.p,{children:"In the past, Stylable exposed all of its functionalities as public facing APIs. Over time, this has proven difficult to maintain and develop further, and so we have decided to limit what Stylable exposes, and to segment its APIs under a few different namespaces."}),"\n",(0,t.jsxs)(s.p,{children:["In addition, most APIs have been refactored to match our new ",(0,t.jsx)(s.a,{href:"https://github.com/wix/stylable/wiki/Programmatic-API",children:"programmatic API model"}),"."]}),"\n",(0,t.jsx)(s.h4,{id:"api-changes",children:"API changes"}),"\n",(0,t.jsx)(s.p,{children:"The following APIs have been changed:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"StylableMeta"})," renamed ",(0,t.jsx)(s.code,{children:"rawAst"})," to ",(0,t.jsx)(s.code,{children:"sourceAst"})," and ",(0,t.jsx)(s.code,{children:"outputAst"})," to ",(0,t.jsx)(s.code,{children:"targetAst"})]}),"\n",(0,t.jsxs)(s.li,{children:["The Stylable constructor now accepts options as an object (similar to ",(0,t.jsx)(s.code,{children:"Stylable.create()"})," options)"]}),"\n"]}),"\n",(0,t.jsx)(s.p,{children:"The following APIs have been removed:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["The ",(0,t.jsx)(s.code,{children:"Stylable.create()"})," method has been removed"]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"StylableMeta"})," removed ",(0,t.jsx)(s.code,{children:"ast"})," field"]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"StylableTransformer"})," is no longer considered public API, there relevant functionality has been moved to ",(0,t.jsx)(s.code,{children:"stylable.transform"}),", ",(0,t.jsx)(s.code,{children:"stylable.transformSelector"}),", etc."]}),"\n",(0,t.jsxs)(s.li,{children:["custom pseudo state parameter type ",(0,t.jsx)(s.code,{children:"tag"})," has been removed - can be replaced by ",(0,t.jsx)(s.code,{children:"-st-states: stateName(string)"})," (see ",(0,t.jsx)(s.a,{href:"https://github.com/wix/stylable/issues/1552#issuecomment-874559161",children:"issue"}),")"]}),"\n"]}),"\n",(0,t.jsx)(s.h4,{id:"missing-apis",children:"Missing APIs?"}),"\n",(0,t.jsxs)(s.p,{children:["If we have removed an API that you have found useful, and provided no alternative, please let us know by opening an issue over at ",(0,t.jsx)(s.a,{href:"https://github.com/wix/stylable/issues/new/choose",children:"GitHub"}),"."]}),"\n",(0,t.jsx)(s.h2,{id:"stylablecli",children:(0,t.jsx)(s.code,{children:"@stylable/cli"})}),"\n",(0,t.jsx)(s.h3,{id:"default-arguments-changed",children:"Default arguments changed"}),"\n",(0,t.jsxs)(s.p,{children:["The ",(0,t.jsx)(s.code,{children:"@stylable/cli"})," ",(0,t.jsx)(s.code,{children:"stc"})," command now has no default output defined, previously this was set to emit ",(0,t.jsx)(s.code,{children:".cjs"})," files."]}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["If you were using the ",(0,t.jsx)(s.code,{children:"stc"})," command without the ",(0,t.jsx)(s.code,{children:"--cjs"})," flag, you will need to update your code to use the new default output"]}),"\n",(0,t.jsxs)(s.li,{children:["If were explictly setting the output to not emit ",(0,t.jsx)(s.code,{children:".cjs"})," files (e.g. ",(0,t.jsx)(s.code,{children:"--no-cjs"})," or ",(0,t.jsx)(s.code,{children:"--cjs=false"}),"), you can now remove this parameter from your command"]}),"\n"]}),"\n",(0,t.jsx)(s.h3,{id:"build-index-file-and-other-outputs-simultaneously",children:"Build index file and other outputs simultaneously"}),"\n",(0,t.jsxs)(s.p,{children:["The ",(0,t.jsx)(s.code,{children:"@stylable/cli"})," ",(0,t.jsx)(s.code,{children:"stc"})," command now supports building an indexFile and other outputs (",(0,t.jsx)(s.code,{children:".js"}),", ",(0,t.jsx)(s.code,{children:".css"}),", ",(0,t.jsx)(s.code,{children:".st.css"}),", etc.) at once."]}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsx)(s.li,{children:"If you were previously running separate commands to build the index file and other outputs, you can now run a single command to build them all at once"}),"\n"]})]})}function h(e={}){const{wrapper:s}={...(0,l.R)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(r,{...e})}):r(e)}},8453:(e,s,n)=>{n.d(s,{R:()=>o,x:()=>d});var i=n(6540);const t={},l=i.createContext(t);function o(e){const s=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function d(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),i.createElement(l.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[825],{3701:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>a,contentTitle:()=>d,default:()=>h,frontMatter:()=>o,metadata:()=>i,toc:()=>c});const i=JSON.parse('{"id":"guides/migration-v5","title":"Stylable v5","description":"The purpose of this document is to help migrate projects using Stylable to v5.","source":"@site/docs/guides/migration-v5.md","sourceDirName":"guides","slug":"/guides/migration-v5","permalink":"/docs/guides/migration-v5","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/guides/migration-v5.md","tags":[],"version":"current","frontMatter":{"id":"migration-v5","title":"Stylable v5"},"sidebar":"Guides","previous":{"title":"Stylable v3","permalink":"/docs/guides/migration-v3"}}');var t=n(4848),l=n(8453);const o={id:"migration-v5",title:"Stylable v5"},d=void 0,a={},c=[{value:"@stylable/core
",id:"stylablecore",level:2},{value:"Diagnostics overhaul",id:"diagnostics-overhaul",level:3},{value:"Reducing public facing APIs",id:"reducing-public-facing-apis",level:3},{value:"API changes",id:"api-changes",level:4},{value:"Missing APIs?",id:"missing-apis",level:4},{value:"@stylable/cli
",id:"stylablecli",level:2},{value:"Default arguments changed",id:"default-arguments-changed",level:3},{value:"Build index file and other outputs simultaneously",id:"build-index-file-and-other-outputs-simultaneously",level:3}];function r(e){const s={a:"a",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",p:"p",ul:"ul",...(0,l.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(s.p,{children:["The purpose of this document is to help migrate projects using Stylable to ",(0,t.jsx)(s.code,{children:"v5"}),"."]}),"\n",(0,t.jsxs)(s.p,{children:["We have taken the opportunity of node dropping LTS support for ",(0,t.jsx)(s.code,{children:"v12"})," and we have decided to include a number of additional breaking changes to the ",(0,t.jsx)(s.code,{children:"v5"})," release. These changes are primarily to the programmatic API of Stylable and not to user facing features, syntax or integrations."]}),"\n",(0,t.jsxs)(s.p,{children:["You can find the plan for this major version ",(0,t.jsx)(s.a,{href:"https://github.com/wix/stylable/issues/2410",children:"here"}),"."]}),"\n",(0,t.jsx)(s.h2,{id:"stylablecore",children:(0,t.jsx)(s.code,{children:"@stylable/core"})}),"\n",(0,t.jsx)(s.h3,{id:"diagnostics-overhaul",children:"Diagnostics overhaul"}),"\n",(0,t.jsxs)(s.p,{children:["All diagnostics in ",(0,t.jsx)(s.code,{children:"@stylable/core"})," had diagnostics code added, and were reviewed for consistency. Many diagnostics have had their severity increased to ",(0,t.jsx)(s.code,{children:"error"}),"."]}),"\n",(0,t.jsx)(s.p,{children:"We plan on starting to map out the diagnostics in this site to help users understand what they are seeing, and why it happened."}),"\n",(0,t.jsx)(s.h3,{id:"reducing-public-facing-apis",children:"Reducing public facing APIs"}),"\n",(0,t.jsx)(s.p,{children:"In the past, Stylable exposed all of its functionalities as public facing APIs. Over time, this has proven difficult to maintain and develop further, and so we have decided to limit what Stylable exposes, and to segment its APIs under a few different namespaces."}),"\n",(0,t.jsxs)(s.p,{children:["In addition, most APIs have been refactored to match our new ",(0,t.jsx)(s.a,{href:"https://github.com/wix/stylable/wiki/Programmatic-API",children:"programmatic API model"}),"."]}),"\n",(0,t.jsx)(s.h4,{id:"api-changes",children:"API changes"}),"\n",(0,t.jsx)(s.p,{children:"The following APIs have been changed:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"StylableMeta"})," renamed ",(0,t.jsx)(s.code,{children:"rawAst"})," to ",(0,t.jsx)(s.code,{children:"sourceAst"})," and ",(0,t.jsx)(s.code,{children:"outputAst"})," to ",(0,t.jsx)(s.code,{children:"targetAst"})]}),"\n",(0,t.jsxs)(s.li,{children:["The Stylable constructor now accepts options as an object (similar to ",(0,t.jsx)(s.code,{children:"Stylable.create()"})," options)"]}),"\n"]}),"\n",(0,t.jsx)(s.p,{children:"The following APIs have been removed:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["The ",(0,t.jsx)(s.code,{children:"Stylable.create()"})," method has been removed"]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"StylableMeta"})," removed ",(0,t.jsx)(s.code,{children:"ast"})," field"]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"StylableTransformer"})," is no longer considered public API, there relevant functionality has been moved to ",(0,t.jsx)(s.code,{children:"stylable.transform"}),", ",(0,t.jsx)(s.code,{children:"stylable.transformSelector"}),", etc."]}),"\n",(0,t.jsxs)(s.li,{children:["custom pseudo state parameter type ",(0,t.jsx)(s.code,{children:"tag"})," has been removed - can be replaced by ",(0,t.jsx)(s.code,{children:"-st-states: stateName(string)"})," (see ",(0,t.jsx)(s.a,{href:"https://github.com/wix/stylable/issues/1552#issuecomment-874559161",children:"issue"}),")"]}),"\n"]}),"\n",(0,t.jsx)(s.h4,{id:"missing-apis",children:"Missing APIs?"}),"\n",(0,t.jsxs)(s.p,{children:["If we have removed an API that you have found useful, and provided no alternative, please let us know by opening an issue over at ",(0,t.jsx)(s.a,{href:"https://github.com/wix/stylable/issues/new/choose",children:"GitHub"}),"."]}),"\n",(0,t.jsx)(s.h2,{id:"stylablecli",children:(0,t.jsx)(s.code,{children:"@stylable/cli"})}),"\n",(0,t.jsx)(s.h3,{id:"default-arguments-changed",children:"Default arguments changed"}),"\n",(0,t.jsxs)(s.p,{children:["The ",(0,t.jsx)(s.code,{children:"@stylable/cli"})," ",(0,t.jsx)(s.code,{children:"stc"})," command now has no default output defined, previously this was set to emit ",(0,t.jsx)(s.code,{children:".cjs"})," files."]}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["If you were using the ",(0,t.jsx)(s.code,{children:"stc"})," command without the ",(0,t.jsx)(s.code,{children:"--cjs"})," flag, you will need to update your code to use the new default output"]}),"\n",(0,t.jsxs)(s.li,{children:["If were explictly setting the output to not emit ",(0,t.jsx)(s.code,{children:".cjs"})," files (e.g. ",(0,t.jsx)(s.code,{children:"--no-cjs"})," or ",(0,t.jsx)(s.code,{children:"--cjs=false"}),"), you can now remove this parameter from your command"]}),"\n"]}),"\n",(0,t.jsx)(s.h3,{id:"build-index-file-and-other-outputs-simultaneously",children:"Build index file and other outputs simultaneously"}),"\n",(0,t.jsxs)(s.p,{children:["The ",(0,t.jsx)(s.code,{children:"@stylable/cli"})," ",(0,t.jsx)(s.code,{children:"stc"})," command now supports building an indexFile and other outputs (",(0,t.jsx)(s.code,{children:".js"}),", ",(0,t.jsx)(s.code,{children:".css"}),", ",(0,t.jsx)(s.code,{children:".st.css"}),", etc.) at once."]}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsx)(s.li,{children:"If you were previously running separate commands to build the index file and other outputs, you can now run a single command to build them all at once"}),"\n"]})]})}function h(e={}){const{wrapper:s}={...(0,l.R)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(r,{...e})}):r(e)}},8453:(e,s,n)=>{n.d(s,{R:()=>o,x:()=>d});var i=n(6540);const t={},l=i.createContext(t);function o(e){const s=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function d(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),i.createElement(l.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/26a8bbe9.ac4aa30b.js b/assets/js/26a8bbe9.1a9976db.js similarity index 99% rename from assets/js/26a8bbe9.ac4aa30b.js rename to assets/js/26a8bbe9.1a9976db.js index 27fc46fd..60b0b396 100644 --- a/assets/js/26a8bbe9.ac4aa30b.js +++ b/assets/js/26a8bbe9.1a9976db.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[5666],{6042:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>r,contentTitle:()=>s,default:()=>d,frontMatter:()=>l,metadata:()=>n,toc:()=>h});var n=o(5958),a=o(4848),i=o(8453);const l={title:"Welcome to Stylable v5",description:"Launching Stylable Version 5",slug:"welcome-to-stylable-v5",authors:[{name:"Barak Igal",title:"Co-creator of Stylable",url:"https://github.com/barak007",image_url:"https://github.com/barak007.png"},{name:"Ido Rosenthal",title:"Co-creator of Stylable",url:"https://twitter.com/idoros",image_url:"https://github.com/idoros.png"},{name:"Tom Raviv",title:"Co-creator of Stylable",url:"https://twitter.com/RavivTom",image_url:"https://github.com/tomrav.png"}],tags:["intro","release"],image:"/img/synthwave-space-logo.png",hide_table_of_contents:!1},s=void 0,r={authorsImageUrls:[void 0,void 0,void 0]},h=[{value:"First time hearing about Stylable?",id:"first-time-hearing-about-stylable",level:2},{value:"What went on behind the scenes?",id:"what-went-on-behind-the-scenes",level:2},{value:"What have we been up to recently?",id:"what-have-we-been-up-to-recently",level:2},{value:"Additional highlights",id:"additional-highlights",level:3},{value:"What's next for Stylable?",id:"whats-next-for-stylable",level:2}];function c(e){const t={a:"a",admonition:"admonition",em:"em",h2:"h2",h3:"h3",li:"li",p:"p",ul:"ul",...(0,i.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.h2,{id:"first-time-hearing-about-stylable",children:"First time hearing about Stylable?"}),"\n",(0,a.jsx)(t.p,{children:"No worries! Stylable is a tool that empowers you to create safe, reusable style APIs for your components. It's a superset of CSS that adds a type system to it, providing type safety, and powerful language capabilities."}),"\n",(0,a.jsxs)(t.p,{children:["Want to learn more? We recently started writing a ",(0,a.jsx)(t.a,{href:"/docs/guides/handbook/intro",children:"new handbook"})," to help get you up to speed, and more content is on its way over the coming weeks."]}),"\n",(0,a.jsx)(t.h2,{id:"what-went-on-behind-the-scenes",children:"What went on behind the scenes?"}),"\n",(0,a.jsx)(t.p,{children:"Over the last couple of years, we focused on developing Stylable internally in Wix, building it into an entire tooling ecosystem."}),"\n",(0,a.jsx)(t.p,{children:"We integrated Stylable across Wix.com, both for internal tools and user-facing components. We stress-tested the project, making sure it meets our requirements. Today, Stylable helps power over 50 million user websites, and is the de facto styling solution for new projects and new user-facing components."}),"\n",(0,a.jsx)(t.h2,{id:"what-have-we-been-up-to-recently",children:"What have we been up to recently?"}),"\n",(0,a.jsxs)(t.p,{children:["We recently released ",(0,a.jsx)(t.a,{href:"https://github.com/wix/stylable/releases/tag/v5.0.0",children:"Stylable v5"}),", and we're excited to share it with the community."]}),"\n",(0,a.jsx)(t.p,{children:"Version 5 includes considerable refactoring and clean up of the Stylable core package to make it more robust, and its programmatic API more accessible."}),"\n",(0,a.jsxs)(t.p,{children:["If you encounter any bugs or issues, please open an issue on our ",(0,a.jsx)(t.a,{href:"https://github.com/wix/stylable/issues",children:"GitHub repository"}),"."]}),"\n",(0,a.jsx)(t.h3,{id:"additional-highlights",children:"Additional highlights"}),"\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsxs)(t.li,{children:["We added a ",(0,a.jsx)(t.a,{href:"https://stylable.io/playground",children:"new playground"})," to help developers learn and experiment with Stylable."]}),"\n",(0,a.jsx)(t.li,{children:"With monorepo projects becoming more and more common, we've made (and continue to make) improvements to how Stylable and our CLI handle them."}),"\n",(0,a.jsx)(t.li,{children:"Lastly, we've been focused on refining and expanding our documentation, adding new guides, refactoring our API reference to a standard format, and improving the overall reading experience."}),"\n"]}),"\n",(0,a.jsx)(t.h2,{id:"whats-next-for-stylable",children:"What's next for Stylable?"}),"\n",(0,a.jsx)(t.p,{children:"Many new features are planned for Stylable, including the expansion of the type system to cover even more of CSS, and to create new integrations for emerging tools and technologies."}),"\n",(0,a.jsx)(t.p,{children:"CSS as a language has been rapidly progressing recently, with functionality increasing as the language expands. We're following the language closely as its specs progress, and we'll focus our efforts so that Stylable continues to offer the best possible experience over CSS at any time."}),"\n",(0,a.jsx)(t.p,{children:"Although it's always been open-source, we feel like this is the time for us to introduce Stylable back to the web development community, and to hopefully show people how Stylable can make their development experience better. In the coming weeks, we'll be expanding our guides, examples, and documentation to make it even easier to onboard new users."}),"\n",(0,a.jsx)(t.admonition,{title:"join the community",type:"tip",children:(0,a.jsxs)(t.p,{children:["Want to be a part of the discussion? See our ongoing development on ",(0,a.jsx)(t.a,{href:"https://github.com/wix/stylable",children:"GitHub"}),", follow us on ",(0,a.jsx)(t.a,{href:"https://twitter.com/stylableio",children:"Twitter"}),", and join the ",(0,a.jsx)(t.a,{href:"https://discord.gg/C5ZhENSbV7",children:"Discord"})," where we're always up for a chat about styling."]})}),"\n",(0,a.jsx)(t.p,{children:"We hope you'll join us on this journey, and we're looking forward to hearing your feedback."}),"\n",(0,a.jsxs)(t.p,{children:["- ",(0,a.jsx)(t.em,{children:"The Stylable team"})]})]})}function d(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,a.jsx)(t,{...e,children:(0,a.jsx)(c,{...e})}):c(e)}},8453:(e,t,o)=>{o.d(t,{R:()=>l,x:()=>s});var n=o(6540);const a={},i=n.createContext(a);function l(e){const t=n.useContext(i);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:l(e.components),n.createElement(i.Provider,{value:t},e.children)}},5958:e=>{e.exports=JSON.parse('{"permalink":"/blog/welcome-to-stylable-v5","editUrl":"https://github.com/wixplosives/stylable.io/edit/master/blog/2022-08-04-welcome-to-stylable-v5.md","source":"@site/blog/2022-08-04-welcome-to-stylable-v5.md","title":"Welcome to Stylable v5","description":"Launching Stylable Version 5","date":"2022-08-04T00:00:00.000Z","tags":[{"inline":true,"label":"intro","permalink":"/blog/tags/intro"},{"inline":true,"label":"release","permalink":"/blog/tags/release"}],"readingTime":2.355,"hasTruncateMarker":true,"authors":[{"name":"Barak Igal","title":"Co-creator of Stylable","url":"https://github.com/barak007","image_url":"https://github.com/barak007.png","imageURL":"https://github.com/barak007.png","socials":{},"key":null,"page":null},{"name":"Ido Rosenthal","title":"Co-creator of Stylable","url":"https://twitter.com/idoros","image_url":"https://github.com/idoros.png","imageURL":"https://github.com/idoros.png","socials":{},"key":null,"page":null},{"name":"Tom Raviv","title":"Co-creator of Stylable","url":"https://twitter.com/RavivTom","image_url":"https://github.com/tomrav.png","imageURL":"https://github.com/tomrav.png","socials":{},"key":null,"page":null}],"frontMatter":{"title":"Welcome to Stylable v5","description":"Launching Stylable Version 5","slug":"welcome-to-stylable-v5","authors":[{"name":"Barak Igal","title":"Co-creator of Stylable","url":"https://github.com/barak007","image_url":"https://github.com/barak007.png","imageURL":"https://github.com/barak007.png"},{"name":"Ido Rosenthal","title":"Co-creator of Stylable","url":"https://twitter.com/idoros","image_url":"https://github.com/idoros.png","imageURL":"https://github.com/idoros.png"},{"name":"Tom Raviv","title":"Co-creator of Stylable","url":"https://twitter.com/RavivTom","image_url":"https://github.com/tomrav.png","imageURL":"https://github.com/tomrav.png"}],"tags":["intro","release"],"image":"/img/synthwave-space-logo.png","hide_table_of_contents":false},"unlisted":false}')}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[5666],{8090:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>r,contentTitle:()=>s,default:()=>d,frontMatter:()=>l,metadata:()=>n,toc:()=>h});var n=o(5958),a=o(4848),i=o(8453);const l={title:"Welcome to Stylable v5",description:"Launching Stylable Version 5",slug:"welcome-to-stylable-v5",authors:[{name:"Barak Igal",title:"Co-creator of Stylable",url:"https://github.com/barak007",image_url:"https://github.com/barak007.png"},{name:"Ido Rosenthal",title:"Co-creator of Stylable",url:"https://twitter.com/idoros",image_url:"https://github.com/idoros.png"},{name:"Tom Raviv",title:"Co-creator of Stylable",url:"https://twitter.com/RavivTom",image_url:"https://github.com/tomrav.png"}],tags:["intro","release"],image:"/img/synthwave-space-logo.png",hide_table_of_contents:!1},s=void 0,r={authorsImageUrls:[void 0,void 0,void 0]},h=[{value:"First time hearing about Stylable?",id:"first-time-hearing-about-stylable",level:2},{value:"What went on behind the scenes?",id:"what-went-on-behind-the-scenes",level:2},{value:"What have we been up to recently?",id:"what-have-we-been-up-to-recently",level:2},{value:"Additional highlights",id:"additional-highlights",level:3},{value:"What's next for Stylable?",id:"whats-next-for-stylable",level:2}];function c(e){const t={a:"a",admonition:"admonition",em:"em",h2:"h2",h3:"h3",li:"li",p:"p",ul:"ul",...(0,i.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.h2,{id:"first-time-hearing-about-stylable",children:"First time hearing about Stylable?"}),"\n",(0,a.jsx)(t.p,{children:"No worries! Stylable is a tool that empowers you to create safe, reusable style APIs for your components. It's a superset of CSS that adds a type system to it, providing type safety, and powerful language capabilities."}),"\n",(0,a.jsxs)(t.p,{children:["Want to learn more? We recently started writing a ",(0,a.jsx)(t.a,{href:"/docs/guides/handbook/intro",children:"new handbook"})," to help get you up to speed, and more content is on its way over the coming weeks."]}),"\n",(0,a.jsx)(t.h2,{id:"what-went-on-behind-the-scenes",children:"What went on behind the scenes?"}),"\n",(0,a.jsx)(t.p,{children:"Over the last couple of years, we focused on developing Stylable internally in Wix, building it into an entire tooling ecosystem."}),"\n",(0,a.jsx)(t.p,{children:"We integrated Stylable across Wix.com, both for internal tools and user-facing components. We stress-tested the project, making sure it meets our requirements. Today, Stylable helps power over 50 million user websites, and is the de facto styling solution for new projects and new user-facing components."}),"\n",(0,a.jsx)(t.h2,{id:"what-have-we-been-up-to-recently",children:"What have we been up to recently?"}),"\n",(0,a.jsxs)(t.p,{children:["We recently released ",(0,a.jsx)(t.a,{href:"https://github.com/wix/stylable/releases/tag/v5.0.0",children:"Stylable v5"}),", and we're excited to share it with the community."]}),"\n",(0,a.jsx)(t.p,{children:"Version 5 includes considerable refactoring and clean up of the Stylable core package to make it more robust, and its programmatic API more accessible."}),"\n",(0,a.jsxs)(t.p,{children:["If you encounter any bugs or issues, please open an issue on our ",(0,a.jsx)(t.a,{href:"https://github.com/wix/stylable/issues",children:"GitHub repository"}),"."]}),"\n",(0,a.jsx)(t.h3,{id:"additional-highlights",children:"Additional highlights"}),"\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsxs)(t.li,{children:["We added a ",(0,a.jsx)(t.a,{href:"https://stylable.io/playground",children:"new playground"})," to help developers learn and experiment with Stylable."]}),"\n",(0,a.jsx)(t.li,{children:"With monorepo projects becoming more and more common, we've made (and continue to make) improvements to how Stylable and our CLI handle them."}),"\n",(0,a.jsx)(t.li,{children:"Lastly, we've been focused on refining and expanding our documentation, adding new guides, refactoring our API reference to a standard format, and improving the overall reading experience."}),"\n"]}),"\n",(0,a.jsx)(t.h2,{id:"whats-next-for-stylable",children:"What's next for Stylable?"}),"\n",(0,a.jsx)(t.p,{children:"Many new features are planned for Stylable, including the expansion of the type system to cover even more of CSS, and to create new integrations for emerging tools and technologies."}),"\n",(0,a.jsx)(t.p,{children:"CSS as a language has been rapidly progressing recently, with functionality increasing as the language expands. We're following the language closely as its specs progress, and we'll focus our efforts so that Stylable continues to offer the best possible experience over CSS at any time."}),"\n",(0,a.jsx)(t.p,{children:"Although it's always been open-source, we feel like this is the time for us to introduce Stylable back to the web development community, and to hopefully show people how Stylable can make their development experience better. In the coming weeks, we'll be expanding our guides, examples, and documentation to make it even easier to onboard new users."}),"\n",(0,a.jsx)(t.admonition,{title:"join the community",type:"tip",children:(0,a.jsxs)(t.p,{children:["Want to be a part of the discussion? See our ongoing development on ",(0,a.jsx)(t.a,{href:"https://github.com/wix/stylable",children:"GitHub"}),", follow us on ",(0,a.jsx)(t.a,{href:"https://twitter.com/stylableio",children:"Twitter"}),", and join the ",(0,a.jsx)(t.a,{href:"https://discord.gg/C5ZhENSbV7",children:"Discord"})," where we're always up for a chat about styling."]})}),"\n",(0,a.jsx)(t.p,{children:"We hope you'll join us on this journey, and we're looking forward to hearing your feedback."}),"\n",(0,a.jsxs)(t.p,{children:["- ",(0,a.jsx)(t.em,{children:"The Stylable team"})]})]})}function d(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,a.jsx)(t,{...e,children:(0,a.jsx)(c,{...e})}):c(e)}},8453:(e,t,o)=>{o.d(t,{R:()=>l,x:()=>s});var n=o(6540);const a={},i=n.createContext(a);function l(e){const t=n.useContext(i);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:l(e.components),n.createElement(i.Provider,{value:t},e.children)}},5958:e=>{e.exports=JSON.parse('{"permalink":"/blog/welcome-to-stylable-v5","editUrl":"https://github.com/wixplosives/stylable.io/edit/master/blog/2022-08-04-welcome-to-stylable-v5.md","source":"@site/blog/2022-08-04-welcome-to-stylable-v5.md","title":"Welcome to Stylable v5","description":"Launching Stylable Version 5","date":"2022-08-04T00:00:00.000Z","tags":[{"inline":true,"label":"intro","permalink":"/blog/tags/intro"},{"inline":true,"label":"release","permalink":"/blog/tags/release"}],"readingTime":2.355,"hasTruncateMarker":true,"authors":[{"name":"Barak Igal","title":"Co-creator of Stylable","url":"https://github.com/barak007","image_url":"https://github.com/barak007.png","imageURL":"https://github.com/barak007.png","socials":{},"key":null,"page":null},{"name":"Ido Rosenthal","title":"Co-creator of Stylable","url":"https://twitter.com/idoros","image_url":"https://github.com/idoros.png","imageURL":"https://github.com/idoros.png","socials":{},"key":null,"page":null},{"name":"Tom Raviv","title":"Co-creator of Stylable","url":"https://twitter.com/RavivTom","image_url":"https://github.com/tomrav.png","imageURL":"https://github.com/tomrav.png","socials":{},"key":null,"page":null}],"frontMatter":{"title":"Welcome to Stylable v5","description":"Launching Stylable Version 5","slug":"welcome-to-stylable-v5","authors":[{"name":"Barak Igal","title":"Co-creator of Stylable","url":"https://github.com/barak007","image_url":"https://github.com/barak007.png","imageURL":"https://github.com/barak007.png"},{"name":"Ido Rosenthal","title":"Co-creator of Stylable","url":"https://twitter.com/idoros","image_url":"https://github.com/idoros.png","imageURL":"https://github.com/idoros.png"},{"name":"Tom Raviv","title":"Co-creator of Stylable","url":"https://twitter.com/RavivTom","image_url":"https://github.com/tomrav.png","imageURL":"https://github.com/tomrav.png"}],"tags":["intro","release"],"image":"/img/synthwave-space-logo.png","hide_table_of_contents":false},"unlisted":false}')}}]); \ No newline at end of file diff --git a/assets/js/2ce01146.6918bacc.js b/assets/js/2ce01146.3ea843c5.js similarity index 98% rename from assets/js/2ce01146.6918bacc.js rename to assets/js/2ce01146.3ea843c5.js index f2171f07..20b85df7 100644 --- a/assets/js/2ce01146.6918bacc.js +++ b/assets/js/2ce01146.3ea843c5.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[9169],{3980:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>i,default:()=>u,frontMatter:()=>o,metadata:()=>r,toc:()=>d});const r=JSON.parse('{"id":"references/formatters","title":"Formatters","description":"Formatters are functions that return a single CSS declaration value. They can receive arguments, process them and return the value.","source":"@site/docs/references/formatters.md","sourceDirName":"references","slug":"/references/formatters","permalink":"/docs/references/formatters","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/formatters.md","tags":[],"version":"current","frontMatter":{"id":"formatters","title":"Formatters"},"sidebar":"Specification Reference","previous":{"title":"Scope","permalink":"/docs/references/st-scope"},"next":{"title":"Mixins","permalink":"/docs/references/mixins"}}');var s=t(4848),a=t(8453);const o={id:"formatters",title:"Formatters"},i=void 0,c={},d=[{value:"Formatters with variables",id:"formatters-with-variables",level:2},{value:"Nested formatters",id:"nested-formatters",level:2}];function l(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",strong:"strong",...(0,a.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.p,{children:"Formatters are functions that return a single CSS declaration value. They can receive arguments, process them and return the value."}),"\n",(0,s.jsx)(n.admonition,{type:"note",children:(0,s.jsxs)(n.p,{children:["Currently, any argument passed through to a formatter is of type ",(0,s.jsx)(n.code,{children:"string"}),". We are in the process of adding support for more complex types."]})}),"\n",(0,s.jsxs)(n.p,{children:["For example a ",(0,s.jsx)(n.code,{children:"calc-font-size"})," formatter can return a different value for the font size depending on the provided argument."]}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["If you need to return multiple declaration values, we recommend using ",(0,s.jsx)(n.strong,{children:"Stylable"})," ",(0,s.jsx)(n.a,{href:"/docs/references/mixins",children:"mixins"}),"."]})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"/* ./calc-font-size.js */\nmodule.exports = function (baseSize, modifier) {\n switch (modifier) {\n case 'header':\n return `${Number(baseSize) * 2}px`;\n case 'aside':\n return `${Number(baseSize) * 0.75}px`;\n default:\n return baseSize + 'px';\n }\n};\n"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:'@st-import calcFontSize from "./calc-font-size";\n\n.header {\n font-size: calcFontSize(16, header);\n}\n\n.form {\n font-size: calcFontSize(16, body);\n}\n'})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:"/* CSS output */\n.header {\n font-size: 32px;\n}\n\n.form {\n font-size: 16px;\n}\n"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:"/* CSS output */\n.header {\n font-size: 32px;\n}\n\n.form {\n font-size: 16px;\n}\n"})}),"\n",(0,s.jsx)(n.admonition,{type:"note",children:(0,s.jsx)(n.p,{children:"Currently you cannot use formatters inside a native URL function. As a suggested workaround, you can return a URL function from a formattter."})}),"\n",(0,s.jsx)(n.h2,{id:"formatters-with-variables",children:"Formatters with variables"}),"\n",(0,s.jsxs)(n.p,{children:["When the formatter is imported into the CSS, it can also be used with a ",(0,s.jsx)(n.a,{href:"/docs/references/st-variables",children:"variable"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["In this example the CSS imports the same formatter as the previous example, ",(0,s.jsx)(n.code,{children:"calc-font-size"}),", but the variable ",(0,s.jsx)(n.code,{children:"baseFontSize"})," is added to the calculation."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:'@st-import calcFontSize from "./calc-font-size";\n\n:vars {\n baseFontSize: 12;\n}\n\n.header {\n font-size: calcFontSize(value(baseFontSize), header);\n}\n\n.form {\n font-size: calcFontSize(value(baseFontSize), body);\n}\n'})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:"/* CSS output */\n.header {\n font-size: 24px;\n}\n.form {\n font-size: 12px;\n}\n"})}),"\n",(0,s.jsx)(n.h2,{id:"nested-formatters",children:"Nested formatters"}),"\n",(0,s.jsx)(n.p,{children:"You can also nest formatters to provide functions that are modular, composable and reusable."}),"\n",(0,s.jsxs)(n.p,{children:["In this example the formatter ",(0,s.jsx)(n.code,{children:"divBy2"})," is nested in the ",(0,s.jsx)(n.code,{children:"round"})," formatter. Both are imported into the CSS file and the output value is calculated from both. The formatters expose to the CSS mathematical calculations that are used in the JavaScript functions."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"/* ./math.js */\nmodule.export = {\n divBy2: function (num) {\n return Number(Number(num) / 2);\n },\n round: function (num) {\n return Math.round(Number(num));\n },\n};\n"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:'@st-import [divBy2, round] from "./math";\n\n:vars {\n baseSize: 17px;\n}\n\n.header {\n font-size: round(divBy2(value(baseSize))) px;\n}\n'})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:"/* CSS output */\n.header {\n font-size: 9px;\n}\n"})})]})}function u(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>o,x:()=>i});var r=t(6540);const s={},a=r.createContext(s);function o(e){const n=r.useContext(a);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),r.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[9169],{7214:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>i,default:()=>u,frontMatter:()=>o,metadata:()=>r,toc:()=>d});const r=JSON.parse('{"id":"references/formatters","title":"Formatters","description":"Formatters are functions that return a single CSS declaration value. They can receive arguments, process them and return the value.","source":"@site/docs/references/formatters.md","sourceDirName":"references","slug":"/references/formatters","permalink":"/docs/references/formatters","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/formatters.md","tags":[],"version":"current","frontMatter":{"id":"formatters","title":"Formatters"},"sidebar":"Specification Reference","previous":{"title":"Scope","permalink":"/docs/references/st-scope"},"next":{"title":"Mixins","permalink":"/docs/references/mixins"}}');var s=t(4848),a=t(8453);const o={id:"formatters",title:"Formatters"},i=void 0,c={},d=[{value:"Formatters with variables",id:"formatters-with-variables",level:2},{value:"Nested formatters",id:"nested-formatters",level:2}];function l(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",strong:"strong",...(0,a.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.p,{children:"Formatters are functions that return a single CSS declaration value. They can receive arguments, process them and return the value."}),"\n",(0,s.jsx)(n.admonition,{type:"note",children:(0,s.jsxs)(n.p,{children:["Currently, any argument passed through to a formatter is of type ",(0,s.jsx)(n.code,{children:"string"}),". We are in the process of adding support for more complex types."]})}),"\n",(0,s.jsxs)(n.p,{children:["For example a ",(0,s.jsx)(n.code,{children:"calc-font-size"})," formatter can return a different value for the font size depending on the provided argument."]}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["If you need to return multiple declaration values, we recommend using ",(0,s.jsx)(n.strong,{children:"Stylable"})," ",(0,s.jsx)(n.a,{href:"/docs/references/mixins",children:"mixins"}),"."]})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"/* ./calc-font-size.js */\nmodule.exports = function (baseSize, modifier) {\n switch (modifier) {\n case 'header':\n return `${Number(baseSize) * 2}px`;\n case 'aside':\n return `${Number(baseSize) * 0.75}px`;\n default:\n return baseSize + 'px';\n }\n};\n"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:'@st-import calcFontSize from "./calc-font-size";\n\n.header {\n font-size: calcFontSize(16, header);\n}\n\n.form {\n font-size: calcFontSize(16, body);\n}\n'})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:"/* CSS output */\n.header {\n font-size: 32px;\n}\n\n.form {\n font-size: 16px;\n}\n"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:"/* CSS output */\n.header {\n font-size: 32px;\n}\n\n.form {\n font-size: 16px;\n}\n"})}),"\n",(0,s.jsx)(n.admonition,{type:"note",children:(0,s.jsx)(n.p,{children:"Currently you cannot use formatters inside a native URL function. As a suggested workaround, you can return a URL function from a formattter."})}),"\n",(0,s.jsx)(n.h2,{id:"formatters-with-variables",children:"Formatters with variables"}),"\n",(0,s.jsxs)(n.p,{children:["When the formatter is imported into the CSS, it can also be used with a ",(0,s.jsx)(n.a,{href:"/docs/references/st-variables",children:"variable"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["In this example the CSS imports the same formatter as the previous example, ",(0,s.jsx)(n.code,{children:"calc-font-size"}),", but the variable ",(0,s.jsx)(n.code,{children:"baseFontSize"})," is added to the calculation."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:'@st-import calcFontSize from "./calc-font-size";\n\n:vars {\n baseFontSize: 12;\n}\n\n.header {\n font-size: calcFontSize(value(baseFontSize), header);\n}\n\n.form {\n font-size: calcFontSize(value(baseFontSize), body);\n}\n'})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:"/* CSS output */\n.header {\n font-size: 24px;\n}\n.form {\n font-size: 12px;\n}\n"})}),"\n",(0,s.jsx)(n.h2,{id:"nested-formatters",children:"Nested formatters"}),"\n",(0,s.jsx)(n.p,{children:"You can also nest formatters to provide functions that are modular, composable and reusable."}),"\n",(0,s.jsxs)(n.p,{children:["In this example the formatter ",(0,s.jsx)(n.code,{children:"divBy2"})," is nested in the ",(0,s.jsx)(n.code,{children:"round"})," formatter. Both are imported into the CSS file and the output value is calculated from both. The formatters expose to the CSS mathematical calculations that are used in the JavaScript functions."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"/* ./math.js */\nmodule.export = {\n divBy2: function (num) {\n return Number(Number(num) / 2);\n },\n round: function (num) {\n return Math.round(Number(num));\n },\n};\n"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:'@st-import [divBy2, round] from "./math";\n\n:vars {\n baseSize: 17px;\n}\n\n.header {\n font-size: round(divBy2(value(baseSize))) px;\n}\n'})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:"/* CSS output */\n.header {\n font-size: 9px;\n}\n"})})]})}function u(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>o,x:()=>i});var r=t(6540);const s={},a=r.createContext(s);function o(e){const n=r.useContext(a);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),r.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/2de44985.33640f61.js b/assets/js/2de44985.be3847f0.js similarity index 99% rename from assets/js/2de44985.33640f61.js rename to assets/js/2de44985.be3847f0.js index e627f69a..a521b0b5 100644 --- a/assets/js/2de44985.33640f61.js +++ b/assets/js/2de44985.be3847f0.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[7678],{8761:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>r,contentTitle:()=>a,default:()=>p,frontMatter:()=>o,metadata:()=>t,toc:()=>d});const t=JSON.parse('{"id":"guides/migration-v3","title":"Stylable v3","description":"This guide is intended to help migrate Stylable version 1 to Stylable version 2 or 3.","source":"@site/docs/guides/migration-v3.md","sourceDirName":"guides","slug":"/guides/migration-v3","permalink":"/docs/guides/migration-v3","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/guides/migration-v3.md","tags":[],"version":"current","frontMatter":{"id":"migration-v3","title":"Stylable v3"},"sidebar":"Guides","previous":{"title":"Server Side Rendering","permalink":"/docs/guides/ssr"},"next":{"title":"Stylable v5","permalink":"/docs/guides/migration-v5"}}');var i=n(4848),l=n(8453);const o={id:"migration-v3",title:"Stylable v3"},a="Suggested steps of migration",r={},d=[{value:"Update dependencies",id:"update-dependencies",level:2},{value:"Update.st.css
file imports",id:"update-stcss-file-imports",level:2},{value:"CSS custom properties",id:"css-custom-properties",level:3},{value:"Update usage in React components",id:"update-usage-in-react-components",level:2},{value:"Update tests",id:"update-tests",level:2}];function c(e){const s={a:"a",admonition:"admonition",br:"br",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",ul:"ul",...(0,l.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.p,{children:"This guide is intended to help migrate Stylable version 1 to Stylable version 2 or 3.\nIt is mainly geared towards Stylable integration in React projects."}),"\n",(0,i.jsx)(s.header,{children:(0,i.jsx)(s.h1,{id:"suggested-steps-of-migration",children:"Suggested steps of migration"})}),"\n",(0,i.jsx)(s.p,{children:"Follow these steps for a smooth transition. Each step is explained in\nmore detail below."}),"\n",(0,i.jsxs)(s.ol,{children:["\n",(0,i.jsx)(s.li,{children:"Update dependencies"}),"\n",(0,i.jsx)(s.li,{children:"Update global typings"}),"\n",(0,i.jsxs)(s.li,{children:["Update ",(0,i.jsx)(s.code,{children:".st.css"})," file imports"]}),"\n",(0,i.jsx)(s.li,{children:"Update usage in React components"}),"\n",(0,i.jsx)(s.li,{children:"Update tests"}),"\n"]}),"\n",(0,i.jsx)(s.h2,{id:"update-dependencies",children:"Update dependencies"}),"\n",(0,i.jsxs)(s.p,{children:["Ensure you have v3 Stylable dependencies available. You may need to\nupdate your ",(0,i.jsx)(s.code,{children:"package.json"})," or ensure that other dependencies bring you\nv3 Stylable:"]}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.code,{children:"@stylable/cli"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.code,{children:"@stylable/core"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.code,{children:"@stylable/runtime"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.code,{children:"@stylable/node"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.code,{children:"@stylable/webpack-plugin"})}),"\n"]}),"\n",(0,i.jsx)(s.admonition,{type:"tip",children:(0,i.jsxs)(s.p,{children:["all Stylable packages in v3 are scoped under the ",(0,i.jsx)(s.code,{children:"@stylable"})," namespace.\nif you have dependencies like ",(0,i.jsx)(s.code,{children:"stylable"})," (without scope), it is the old one and should be changed to scoped version."]})}),"\n",(0,i.jsx)(s.h1,{id:"update-global-typings",children:"Update global typings"}),"\n",(0,i.jsxs)(s.p,{children:["If TypeScript is used in the project, we recommend updating the global typings\n(usually ",(0,i.jsx)(s.code,{children:"globals.d.ts"}),") with an ",(0,i.jsx)(s.code,{children:".st.css"})," module declaration:"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-ts",children:"declare module '*.st.css' {\n const stylesheet: import('@stylable/runtime').RuntimeStylesheet;\n export = stylesheet;\n}\n"})}),"\n",(0,i.jsx)(s.p,{children:"This way the TypeScript compiler will help refactor most of the\nrequired changes and provide typings for other Stylable use cases."}),"\n",(0,i.jsxs)(s.h2,{id:"update-stcss-file-imports",children:["Update ",(0,i.jsx)(s.code,{children:".st.css"})," file imports"]}),"\n",(0,i.jsxs)(s.p,{children:["Prior to v2 all ",(0,i.jsx)(s.code,{children:".st.css"})," files would export a default ",(0,i.jsx)(s.code,{children:"style"})," function. In v2\nthis has changed: ",(0,i.jsx)(s.code,{children:".st.css"})," files now export a named object."]}),"\n",(0,i.jsx)(s.p,{children:"List of all exported keys:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-js",children:"import {\n st, // alias to `style`\n classes,\n cssStates,\n keyframes,\n namespace,\n stVars,\n style,\n vars,\n} from './style.st.css';\n"})}),"\n",(0,i.jsxs)(s.p,{children:["This means that all imports of ",(0,i.jsx)(s.code,{children:".st.css"})," files have to be changed, for example:"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-diff",children:"-import style from './Component.st.css';\n+import { st, classes, /* ... */ } from './Component.st.css';\n"})}),"\n",(0,i.jsxs)(s.p,{children:["However, most often ",(0,i.jsx)(s.code,{children:"{ st, classes }"})," is enough:"]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.code,{children:"import { st, classes } from './Component.st.css';"})}),"\n",(0,i.jsx)(s.admonition,{type:"tip",children:(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.code,{children:".st.css"})," files export a ",(0,i.jsx)(s.code,{children:"style"})," function and an alias to it -\n",(0,i.jsx)(s.code,{children:"st"}),". It is recommended to use ",(0,i.jsx)(s.code,{children:"st"})," in order to avoid name clashing\nwith other variables (for example, some other inline style)."]})}),"\n",(0,i.jsx)(s.h3,{id:"css-custom-properties",children:"CSS custom properties"}),"\n",(0,i.jsxs)(s.p,{children:["Stylable now localizes CSS Custom Properties. This means that any usage of Custom Proprties (e.g. ",(0,i.jsx)(s.code,{children:"--prop"}),") should now be incorparated in the component code."]}),"\n",(0,i.jsxs)(s.p,{children:["See the docs about ",(0,i.jsx)(s.a,{href:"https://stylable.io/docs/references/css-vars",children:"CSS custom properties"})," for usage examples."]}),"\n",(0,i.jsx)(s.h2,{id:"update-usage-in-react-components",children:"Update usage in React components"}),"\n",(0,i.jsxs)(s.p,{children:["Once ",(0,i.jsx)(s.code,{children:".st.css"})," imports are updated, React components should be updated too:"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-diff",children:"-\n+\n"})}),"\n",(0,i.jsx)(s.p,{children:"There are subtle but very important nuances in this change."}),"\n",(0,i.jsxs)(s.ol,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Stylable v1 used spread pattern. It would take the output of ",(0,i.jsx)(s.code,{children:"style('root', states, this.props)"})," function and spread it on component."]}),"\n",(0,i.jsx)(s.p,{children:"This way one or more props would be applied to the component. Thus, code that looks like this:"}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-jsx",children:'\n'})}),"\n",(0,i.jsx)(s.p,{children:"once evaluated, would behave like this:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-jsx",children:'\n'})}),"\n",(0,i.jsx)(s.p,{children:"Stylable v2 and v3 usage is like so:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-js",children:"className={st(classes.root, states, this.props.className)}\n"})}),"\n",(0,i.jsxs)(s.p,{children:["There is no props spreading anymore and Stylable requires only\n",(0,i.jsx)(s.code,{children:"className"})," to be used."]}),"\n",(0,i.jsx)(s.p,{children:"However, if you were relying on the props spread pattern, in v2 and v3 you\nmight find some props missing."}),"\n",(0,i.jsx)(s.p,{children:"Therefore, with Stylable v3 it is up to you to apply any additional props:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-jsx",children:'\n'})}),"\n",(0,i.jsxs)(s.ol,{start:"2",children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Stylable v1 ",(0,i.jsx)(s.code,{children:"style()"})," would accept unscoped css class name as a string",(0,i.jsx)(s.br,{}),"\n","This is no longer acceptable in Stylable v2 or v3, for example:"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-diff",children:"-\n+\n"})}),"\n",(0,i.jsxs)(s.p,{children:["note that ",(0,i.jsx)(s.code,{children:"classes.root"})," comes from ",(0,i.jsx)(s.code,{children:".st.css"}),", which is the correct\nway to import class names."]}),"\n",(0,i.jsxs)(s.p,{children:["Similar scoping is applied to css variables too, imported from ",(0,i.jsx)(s.code,{children:"vars"})]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.p,{children:["Note: find more details and examples in our ",(0,i.jsx)(s.a,{href:"../references/runtime",children:"Runtime reference"}),"."]}),"\n",(0,i.jsx)(s.h2,{id:"update-tests",children:"Update tests"}),"\n",(0,i.jsxs)(s.p,{children:["If you were using ",(0,i.jsx)(s.code,{children:"@stylable/dom-test-kit"})," in Stylable v1, it's usage is\nslightly different in v2 and v3:"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-diff",children:"import { StylableDOMUtil } from '@Stylable/dom-test-kit';\n-import style from './Component.st.css';\n+import * as styleSheet from './Component.st.css';\n\n-const StylableDOMUtil = new StylableDOMUtil(style);\n+const StylableDOMUtil = new StylableDOMUtil(styleSheet);\n"})}),"\n",(0,i.jsxs)(s.p,{children:["Stylable v2 and v3 ",(0,i.jsx)(s.code,{children:"StylableDOMUtil"})," expects to receive an argument which is the whole stylesheet exported from a ",(0,i.jsx)(s.code,{children:".st.css"})," file"]}),"\n",(0,i.jsxs)(s.p,{children:["Prior to v2 it was only one thing - the ",(0,i.jsx)(s.code,{children:"style"})," function."]})]})}function p(e={}){const{wrapper:s}={...(0,l.R)(),...e.components};return s?(0,i.jsx)(s,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},8453:(e,s,n)=>{n.d(s,{R:()=>o,x:()=>a});var t=n(6540);const i={},l=t.createContext(i);function o(e){const s=t.useContext(l);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function a(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),t.createElement(l.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[7678],{5397:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>r,contentTitle:()=>a,default:()=>p,frontMatter:()=>o,metadata:()=>t,toc:()=>d});const t=JSON.parse('{"id":"guides/migration-v3","title":"Stylable v3","description":"This guide is intended to help migrate Stylable version 1 to Stylable version 2 or 3.","source":"@site/docs/guides/migration-v3.md","sourceDirName":"guides","slug":"/guides/migration-v3","permalink":"/docs/guides/migration-v3","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/guides/migration-v3.md","tags":[],"version":"current","frontMatter":{"id":"migration-v3","title":"Stylable v3"},"sidebar":"Guides","previous":{"title":"Server Side Rendering","permalink":"/docs/guides/ssr"},"next":{"title":"Stylable v5","permalink":"/docs/guides/migration-v5"}}');var i=n(4848),l=n(8453);const o={id:"migration-v3",title:"Stylable v3"},a="Suggested steps of migration",r={},d=[{value:"Update dependencies",id:"update-dependencies",level:2},{value:"Update.st.css
file imports",id:"update-stcss-file-imports",level:2},{value:"CSS custom properties",id:"css-custom-properties",level:3},{value:"Update usage in React components",id:"update-usage-in-react-components",level:2},{value:"Update tests",id:"update-tests",level:2}];function c(e){const s={a:"a",admonition:"admonition",br:"br",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",ul:"ul",...(0,l.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.p,{children:"This guide is intended to help migrate Stylable version 1 to Stylable version 2 or 3.\nIt is mainly geared towards Stylable integration in React projects."}),"\n",(0,i.jsx)(s.header,{children:(0,i.jsx)(s.h1,{id:"suggested-steps-of-migration",children:"Suggested steps of migration"})}),"\n",(0,i.jsx)(s.p,{children:"Follow these steps for a smooth transition. Each step is explained in\nmore detail below."}),"\n",(0,i.jsxs)(s.ol,{children:["\n",(0,i.jsx)(s.li,{children:"Update dependencies"}),"\n",(0,i.jsx)(s.li,{children:"Update global typings"}),"\n",(0,i.jsxs)(s.li,{children:["Update ",(0,i.jsx)(s.code,{children:".st.css"})," file imports"]}),"\n",(0,i.jsx)(s.li,{children:"Update usage in React components"}),"\n",(0,i.jsx)(s.li,{children:"Update tests"}),"\n"]}),"\n",(0,i.jsx)(s.h2,{id:"update-dependencies",children:"Update dependencies"}),"\n",(0,i.jsxs)(s.p,{children:["Ensure you have v3 Stylable dependencies available. You may need to\nupdate your ",(0,i.jsx)(s.code,{children:"package.json"})," or ensure that other dependencies bring you\nv3 Stylable:"]}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.code,{children:"@stylable/cli"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.code,{children:"@stylable/core"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.code,{children:"@stylable/runtime"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.code,{children:"@stylable/node"})}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.code,{children:"@stylable/webpack-plugin"})}),"\n"]}),"\n",(0,i.jsx)(s.admonition,{type:"tip",children:(0,i.jsxs)(s.p,{children:["all Stylable packages in v3 are scoped under the ",(0,i.jsx)(s.code,{children:"@stylable"})," namespace.\nif you have dependencies like ",(0,i.jsx)(s.code,{children:"stylable"})," (without scope), it is the old one and should be changed to scoped version."]})}),"\n",(0,i.jsx)(s.h1,{id:"update-global-typings",children:"Update global typings"}),"\n",(0,i.jsxs)(s.p,{children:["If TypeScript is used in the project, we recommend updating the global typings\n(usually ",(0,i.jsx)(s.code,{children:"globals.d.ts"}),") with an ",(0,i.jsx)(s.code,{children:".st.css"})," module declaration:"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-ts",children:"declare module '*.st.css' {\n const stylesheet: import('@stylable/runtime').RuntimeStylesheet;\n export = stylesheet;\n}\n"})}),"\n",(0,i.jsx)(s.p,{children:"This way the TypeScript compiler will help refactor most of the\nrequired changes and provide typings for other Stylable use cases."}),"\n",(0,i.jsxs)(s.h2,{id:"update-stcss-file-imports",children:["Update ",(0,i.jsx)(s.code,{children:".st.css"})," file imports"]}),"\n",(0,i.jsxs)(s.p,{children:["Prior to v2 all ",(0,i.jsx)(s.code,{children:".st.css"})," files would export a default ",(0,i.jsx)(s.code,{children:"style"})," function. In v2\nthis has changed: ",(0,i.jsx)(s.code,{children:".st.css"})," files now export a named object."]}),"\n",(0,i.jsx)(s.p,{children:"List of all exported keys:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-js",children:"import {\n st, // alias to `style`\n classes,\n cssStates,\n keyframes,\n namespace,\n stVars,\n style,\n vars,\n} from './style.st.css';\n"})}),"\n",(0,i.jsxs)(s.p,{children:["This means that all imports of ",(0,i.jsx)(s.code,{children:".st.css"})," files have to be changed, for example:"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-diff",children:"-import style from './Component.st.css';\n+import { st, classes, /* ... */ } from './Component.st.css';\n"})}),"\n",(0,i.jsxs)(s.p,{children:["However, most often ",(0,i.jsx)(s.code,{children:"{ st, classes }"})," is enough:"]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.code,{children:"import { st, classes } from './Component.st.css';"})}),"\n",(0,i.jsx)(s.admonition,{type:"tip",children:(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.code,{children:".st.css"})," files export a ",(0,i.jsx)(s.code,{children:"style"})," function and an alias to it -\n",(0,i.jsx)(s.code,{children:"st"}),". It is recommended to use ",(0,i.jsx)(s.code,{children:"st"})," in order to avoid name clashing\nwith other variables (for example, some other inline style)."]})}),"\n",(0,i.jsx)(s.h3,{id:"css-custom-properties",children:"CSS custom properties"}),"\n",(0,i.jsxs)(s.p,{children:["Stylable now localizes CSS Custom Properties. This means that any usage of Custom Proprties (e.g. ",(0,i.jsx)(s.code,{children:"--prop"}),") should now be incorparated in the component code."]}),"\n",(0,i.jsxs)(s.p,{children:["See the docs about ",(0,i.jsx)(s.a,{href:"https://stylable.io/docs/references/css-vars",children:"CSS custom properties"})," for usage examples."]}),"\n",(0,i.jsx)(s.h2,{id:"update-usage-in-react-components",children:"Update usage in React components"}),"\n",(0,i.jsxs)(s.p,{children:["Once ",(0,i.jsx)(s.code,{children:".st.css"})," imports are updated, React components should be updated too:"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-diff",children:"-\n+\n"})}),"\n",(0,i.jsx)(s.p,{children:"There are subtle but very important nuances in this change."}),"\n",(0,i.jsxs)(s.ol,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Stylable v1 used spread pattern. It would take the output of ",(0,i.jsx)(s.code,{children:"style('root', states, this.props)"})," function and spread it on component."]}),"\n",(0,i.jsx)(s.p,{children:"This way one or more props would be applied to the component. Thus, code that looks like this:"}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-jsx",children:'\n'})}),"\n",(0,i.jsx)(s.p,{children:"once evaluated, would behave like this:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-jsx",children:'\n'})}),"\n",(0,i.jsx)(s.p,{children:"Stylable v2 and v3 usage is like so:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-js",children:"className={st(classes.root, states, this.props.className)}\n"})}),"\n",(0,i.jsxs)(s.p,{children:["There is no props spreading anymore and Stylable requires only\n",(0,i.jsx)(s.code,{children:"className"})," to be used."]}),"\n",(0,i.jsx)(s.p,{children:"However, if you were relying on the props spread pattern, in v2 and v3 you\nmight find some props missing."}),"\n",(0,i.jsx)(s.p,{children:"Therefore, with Stylable v3 it is up to you to apply any additional props:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-jsx",children:'\n'})}),"\n",(0,i.jsxs)(s.ol,{start:"2",children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Stylable v1 ",(0,i.jsx)(s.code,{children:"style()"})," would accept unscoped css class name as a string",(0,i.jsx)(s.br,{}),"\n","This is no longer acceptable in Stylable v2 or v3, for example:"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-diff",children:"-\n+\n"})}),"\n",(0,i.jsxs)(s.p,{children:["note that ",(0,i.jsx)(s.code,{children:"classes.root"})," comes from ",(0,i.jsx)(s.code,{children:".st.css"}),", which is the correct\nway to import class names."]}),"\n",(0,i.jsxs)(s.p,{children:["Similar scoping is applied to css variables too, imported from ",(0,i.jsx)(s.code,{children:"vars"})]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.p,{children:["Note: find more details and examples in our ",(0,i.jsx)(s.a,{href:"../references/runtime",children:"Runtime reference"}),"."]}),"\n",(0,i.jsx)(s.h2,{id:"update-tests",children:"Update tests"}),"\n",(0,i.jsxs)(s.p,{children:["If you were using ",(0,i.jsx)(s.code,{children:"@stylable/dom-test-kit"})," in Stylable v1, it's usage is\nslightly different in v2 and v3:"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-diff",children:"import { StylableDOMUtil } from '@Stylable/dom-test-kit';\n-import style from './Component.st.css';\n+import * as styleSheet from './Component.st.css';\n\n-const StylableDOMUtil = new StylableDOMUtil(style);\n+const StylableDOMUtil = new StylableDOMUtil(styleSheet);\n"})}),"\n",(0,i.jsxs)(s.p,{children:["Stylable v2 and v3 ",(0,i.jsx)(s.code,{children:"StylableDOMUtil"})," expects to receive an argument which is the whole stylesheet exported from a ",(0,i.jsx)(s.code,{children:".st.css"})," file"]}),"\n",(0,i.jsxs)(s.p,{children:["Prior to v2 it was only one thing - the ",(0,i.jsx)(s.code,{children:"style"})," function."]})]})}function p(e={}){const{wrapper:s}={...(0,l.R)(),...e.components};return s?(0,i.jsx)(s,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},8453:(e,s,n)=>{n.d(s,{R:()=>o,x:()=>a});var t=n(6540);const i={},l=t.createContext(i);function o(e){const s=t.useContext(l);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function a(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),t.createElement(l.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/32382f69.1f52c00d.js b/assets/js/32382f69.1f361507.js similarity index 97% rename from assets/js/32382f69.1f52c00d.js rename to assets/js/32382f69.1f361507.js index 01cbe47e..8b3f6b4f 100644 --- a/assets/js/32382f69.1f52c00d.js +++ b/assets/js/32382f69.1f361507.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[1858],{1874:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>i,contentTitle:()=>r,default:()=>p,frontMatter:()=>c,metadata:()=>t,toc:()=>l});const t=JSON.parse('{"id":"references/namespace","title":"Namespace","description":"Manual Namespace","source":"@site/docs/references/namespace.md","sourceDirName":"references","slug":"/references/namespace","permalink":"/docs/references/namespace","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/namespace.md","tags":[],"version":"current","frontMatter":{"id":"namespace","title":"Namespace"},"sidebar":"Specification Reference","previous":{"title":"Import","permalink":"/docs/references/imports"},"next":{"title":"Root","permalink":"/docs/references/root"}}');var a=s(4848),o=s(8453);const c={id:"namespace",title:"Namespace"},r=void 0,i={},l=[{value:"Manual Namespace",id:"manual-namespace",level:2}];function d(e){const n={admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",strong:"strong",...(0,o.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.h2,{id:"manual-namespace",children:"Manual Namespace"}),"\n",(0,a.jsxs)(n.p,{children:["When you develop your application in ",(0,a.jsx)(n.strong,{children:"Stylable"}),", you can manually namespace classes so you can more easily identify them when they are displayed in the CSS output. You do this in your ",(0,a.jsx)(n.strong,{children:"Stylable"})," stylesheet by adding the syntax ",(0,a.jsx)(n.code,{children:"@st-namespace"})," to provide better display names to your classes."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",metastring:'title="x.st.css"',children:'@st-namespace "y";\n.root {\n color: red;\n}\n\n/* OUTPUT */\n.y__root {/* use @st-namespace value instead of file name */\n color: red;\n}\n'})}),"\n",(0,a.jsx)(n.admonition,{type:"note",children:(0,a.jsxs)(n.p,{children:["Because ",(0,a.jsx)(n.code,{children:"@st-namespace"})," is not unique, the scoped name may still have a suffix added to it to make it unique during build."]})})]})}function p(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>c,x:()=>r});var t=s(6540);const a={},o=t.createContext(a);function c(e){const n=t.useContext(o);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:c(e.components),t.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[1858],{7370:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>i,contentTitle:()=>r,default:()=>p,frontMatter:()=>c,metadata:()=>t,toc:()=>l});const t=JSON.parse('{"id":"references/namespace","title":"Namespace","description":"Manual Namespace","source":"@site/docs/references/namespace.md","sourceDirName":"references","slug":"/references/namespace","permalink":"/docs/references/namespace","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/namespace.md","tags":[],"version":"current","frontMatter":{"id":"namespace","title":"Namespace"},"sidebar":"Specification Reference","previous":{"title":"Import","permalink":"/docs/references/imports"},"next":{"title":"Root","permalink":"/docs/references/root"}}');var a=s(4848),o=s(8453);const c={id:"namespace",title:"Namespace"},r=void 0,i={},l=[{value:"Manual Namespace",id:"manual-namespace",level:2}];function d(e){const n={admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",strong:"strong",...(0,o.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.h2,{id:"manual-namespace",children:"Manual Namespace"}),"\n",(0,a.jsxs)(n.p,{children:["When you develop your application in ",(0,a.jsx)(n.strong,{children:"Stylable"}),", you can manually namespace classes so you can more easily identify them when they are displayed in the CSS output. You do this in your ",(0,a.jsx)(n.strong,{children:"Stylable"})," stylesheet by adding the syntax ",(0,a.jsx)(n.code,{children:"@st-namespace"})," to provide better display names to your classes."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",metastring:'title="x.st.css"',children:'@st-namespace "y";\n.root {\n color: red;\n}\n\n/* OUTPUT */\n.y__root {/* use @st-namespace value instead of file name */\n color: red;\n}\n'})}),"\n",(0,a.jsx)(n.admonition,{type:"note",children:(0,a.jsxs)(n.p,{children:["Because ",(0,a.jsx)(n.code,{children:"@st-namespace"})," is not unique, the scoped name may still have a suffix added to it to make it unique during build."]})})]})}function p(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>c,x:()=>r});var t=s(6540);const a={},o=t.createContext(a);function c(e){const n=t.useContext(o);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:c(e.components),t.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/35811679.acc0117d.js b/assets/js/35811679.88cce2c2.js similarity index 99% rename from assets/js/35811679.acc0117d.js rename to assets/js/35811679.88cce2c2.js index e85847be..6eee81fa 100644 --- a/assets/js/35811679.acc0117d.js +++ b/assets/js/35811679.88cce2c2.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[7135],{6119:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>r,default:()=>h,frontMatter:()=>a,metadata:()=>i,toc:()=>d});const i=JSON.parse('{"id":"guides/handbook/intro","title":"Introduction","description":"What am I reading?","source":"@site/docs/guides/handbook/intro.md","sourceDirName":"guides/handbook","slug":"/guides/handbook/intro","permalink":"/docs/guides/handbook/intro","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/guides/handbook/intro.md","tags":[],"version":"current","frontMatter":{"id":"intro","title":"Introduction"},"sidebar":"Guides","next":{"title":"Classes","permalink":"/docs/guides/handbook/class"}}');var s=n(4848),o=n(8453);const a={id:"intro",title:"Introduction"},r=void 0,l={},d=[{value:"What am I reading?",id:"what-am-i-reading",level:2},{value:"What is Stylable?",id:"what-is-stylable",level:2},{value:"Pre-processor",id:"pre-processor",level:3},{value:"Type system",id:"type-system",level:3},{value:"Language server",id:"language-server",level:3},{value:"Tooling",id:"tooling",level:3},{value:"Who is Stylable for?",id:"who-is-stylable-for",level:2},{value:"Component libraries",id:"component-libraries",level:3},{value:"Applications",id:"applications",level:3}];function c(e){const t={a:"a",br:"br",em:"em",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",strong:"strong",ul:"ul",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h2,{id:"what-am-i-reading",children:"What am I reading?"}),"\n",(0,s.jsx)(t.p,{children:"This document provides an overview of Stylable and its features, and serves as a quick guide for getting started. Each chapter focuses on one core feature of Stylable, introducing a problem or need, showing how CSS might address it, and then how Stylable can be used to simplify the solution. This handbook is not a complete reference for Stylable, but merely a starting point for learning to use it."}),"\n",(0,s.jsx)(t.h2,{id:"what-is-stylable",children:"What is Stylable?"}),"\n",(0,s.jsxs)(t.p,{children:["Stylable is a ",(0,s.jsx)(t.strong,{children:"superset of the CSS language"})," - it introduces additional syntax to CSS to allow us to add features to styling during pre-processing time. It is designed for working with components, variants, themes, and various modern design patterns."]}),"\n",(0,s.jsx)(t.p,{children:"There are different aspects to Stylable, and the tooling and capabilities that it provides:"}),"\n",(0,s.jsx)(t.h3,{id:"pre-processor",children:"Pre-processor"}),"\n",(0,s.jsxs)(t.p,{children:["The Stylable pre-processor works at build-time, meaning that we can use all of its features while writing the code. Its input is a Stylable stylesheet, and its output is ",(0,s.jsx)(t.strong,{children:"valid vanilla CSS"}),". The pre-processing it performs adds the following to CSS:"]}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:"Namespace all parts of CSS that can conflict so that multiple stylesheets can be loaded together safely."}),"\n",(0,s.jsx)(t.li,{children:"A module system to CSS so that individual symbols can be re-used across stylesheets."}),"\n",(0,s.jsx)(t.li,{children:"Template capabilities for creating complex design patterns using variables, mixins, and formatters."}),"\n",(0,s.jsxs)(t.li,{children:["The ability to perform external customization of any component or theme by using its ",(0,s.jsx)(t.em,{children:"Style API"})," through extensions, compositions and overrides."]}),"\n"]}),"\n",(0,s.jsx)(t.h3,{id:"type-system",children:"Type system"}),"\n",(0,s.jsx)(t.p,{children:"We love working with TypeScript and the developer experience that it provides in terms of validations and rich language features."}),"\n",(0,s.jsxs)(t.p,{children:["We aspire for ",(0,s.jsx)(t.strong,{children:"Stylable to be for CSS, what TypeScript is for JavaScript"}),", and so Stylable is in itself a type system, providing interface support for selectors, and reporting syntactic and semantic diagnostics."]}),"\n",(0,s.jsx)(t.h3,{id:"language-server",children:"Language server"}),"\n",(0,s.jsxs)(t.p,{children:["When working in a modern IDE, a language server makes a huge difference in the development experience. For Stylable, we created the ",(0,s.jsx)(t.a,{href:"../../getting-started/tooling/stylable-intelligence",children:"Stylable Intelligence"})," VS Code extension to provide a better development experience through completions, definitions, hinting and more."]}),"\n",(0,s.jsx)(t.h3,{id:"tooling",children:"Tooling"}),"\n",(0,s.jsx)(t.p,{children:"Pre-processing and language features are not all that Stylable offers. It also includes a set of tools and integrations that help develop, build, and ship better CSS:"}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:"Stylable CLI - a command line interface to help build, manage, and validate stylesheets for production and CI/CD workflows."}),"\n",(0,s.jsx)(t.li,{children:"Optimization tools - Stylable has a deep awareness of how your stylesheets are used, and can optimize them to shorten names or remove dead code."}),"\n",(0,s.jsx)(t.li,{children:"Bundling - choose one of our supported bundler integrations to bundle your stylesheets for production."}),"\n"]}),"\n",(0,s.jsx)(t.h2,{id:"who-is-stylable-for",children:"Who is Stylable for?"}),"\n",(0,s.jsx)(t.p,{children:"We modeled Stylable after TypeScript, and like TypeScript, the more complex the project and the more people it involves, the greater the value it provides."}),"\n",(0,s.jsx)(t.p,{children:"Having said that, even a single developer working on a simple, standalone project could gain a lot of value from Stylable."}),"\n",(0,s.jsx)(t.h3,{id:"component-libraries",children:"Component libraries"}),"\n",(0,s.jsx)(t.p,{children:"Library authors can use Stylable to create reusable components, variants, and themes. It helps organize component and theme styling while controlling the elements and styles that are exposed as public interfaces."}),"\n",(0,s.jsx)(t.h3,{id:"applications",children:"Applications"}),"\n",(0,s.jsx)(t.p,{children:"Application creators can use Stylable to compose their own components alongside 3rd party libraries and to theme the final application to their UX and product requirements."}),"\n",(0,s.jsx)(t.hr,{}),"\n",(0,s.jsxs)(t.p,{children:["Sounds interesting? Ready to start?",(0,s.jsx)(t.br,{}),"\n","Head on over to the ",(0,s.jsx)(t.a,{href:"/docs/guides/handbook/class",children:"first chapter"}),", where we discuss classes, and what they mean in Stylable."]})]})}function h(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>a,x:()=>r});var i=n(6540);const s={},o=i.createContext(s);function a(e){const t=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),i.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[7135],{2998:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>r,default:()=>h,frontMatter:()=>a,metadata:()=>i,toc:()=>d});const i=JSON.parse('{"id":"guides/handbook/intro","title":"Introduction","description":"What am I reading?","source":"@site/docs/guides/handbook/intro.md","sourceDirName":"guides/handbook","slug":"/guides/handbook/intro","permalink":"/docs/guides/handbook/intro","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/guides/handbook/intro.md","tags":[],"version":"current","frontMatter":{"id":"intro","title":"Introduction"},"sidebar":"Guides","next":{"title":"Classes","permalink":"/docs/guides/handbook/class"}}');var s=n(4848),o=n(8453);const a={id:"intro",title:"Introduction"},r=void 0,l={},d=[{value:"What am I reading?",id:"what-am-i-reading",level:2},{value:"What is Stylable?",id:"what-is-stylable",level:2},{value:"Pre-processor",id:"pre-processor",level:3},{value:"Type system",id:"type-system",level:3},{value:"Language server",id:"language-server",level:3},{value:"Tooling",id:"tooling",level:3},{value:"Who is Stylable for?",id:"who-is-stylable-for",level:2},{value:"Component libraries",id:"component-libraries",level:3},{value:"Applications",id:"applications",level:3}];function c(e){const t={a:"a",br:"br",em:"em",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",strong:"strong",ul:"ul",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h2,{id:"what-am-i-reading",children:"What am I reading?"}),"\n",(0,s.jsx)(t.p,{children:"This document provides an overview of Stylable and its features, and serves as a quick guide for getting started. Each chapter focuses on one core feature of Stylable, introducing a problem or need, showing how CSS might address it, and then how Stylable can be used to simplify the solution. This handbook is not a complete reference for Stylable, but merely a starting point for learning to use it."}),"\n",(0,s.jsx)(t.h2,{id:"what-is-stylable",children:"What is Stylable?"}),"\n",(0,s.jsxs)(t.p,{children:["Stylable is a ",(0,s.jsx)(t.strong,{children:"superset of the CSS language"})," - it introduces additional syntax to CSS to allow us to add features to styling during pre-processing time. It is designed for working with components, variants, themes, and various modern design patterns."]}),"\n",(0,s.jsx)(t.p,{children:"There are different aspects to Stylable, and the tooling and capabilities that it provides:"}),"\n",(0,s.jsx)(t.h3,{id:"pre-processor",children:"Pre-processor"}),"\n",(0,s.jsxs)(t.p,{children:["The Stylable pre-processor works at build-time, meaning that we can use all of its features while writing the code. Its input is a Stylable stylesheet, and its output is ",(0,s.jsx)(t.strong,{children:"valid vanilla CSS"}),". The pre-processing it performs adds the following to CSS:"]}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:"Namespace all parts of CSS that can conflict so that multiple stylesheets can be loaded together safely."}),"\n",(0,s.jsx)(t.li,{children:"A module system to CSS so that individual symbols can be re-used across stylesheets."}),"\n",(0,s.jsx)(t.li,{children:"Template capabilities for creating complex design patterns using variables, mixins, and formatters."}),"\n",(0,s.jsxs)(t.li,{children:["The ability to perform external customization of any component or theme by using its ",(0,s.jsx)(t.em,{children:"Style API"})," through extensions, compositions and overrides."]}),"\n"]}),"\n",(0,s.jsx)(t.h3,{id:"type-system",children:"Type system"}),"\n",(0,s.jsx)(t.p,{children:"We love working with TypeScript and the developer experience that it provides in terms of validations and rich language features."}),"\n",(0,s.jsxs)(t.p,{children:["We aspire for ",(0,s.jsx)(t.strong,{children:"Stylable to be for CSS, what TypeScript is for JavaScript"}),", and so Stylable is in itself a type system, providing interface support for selectors, and reporting syntactic and semantic diagnostics."]}),"\n",(0,s.jsx)(t.h3,{id:"language-server",children:"Language server"}),"\n",(0,s.jsxs)(t.p,{children:["When working in a modern IDE, a language server makes a huge difference in the development experience. For Stylable, we created the ",(0,s.jsx)(t.a,{href:"../../getting-started/tooling/stylable-intelligence",children:"Stylable Intelligence"})," VS Code extension to provide a better development experience through completions, definitions, hinting and more."]}),"\n",(0,s.jsx)(t.h3,{id:"tooling",children:"Tooling"}),"\n",(0,s.jsx)(t.p,{children:"Pre-processing and language features are not all that Stylable offers. It also includes a set of tools and integrations that help develop, build, and ship better CSS:"}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:"Stylable CLI - a command line interface to help build, manage, and validate stylesheets for production and CI/CD workflows."}),"\n",(0,s.jsx)(t.li,{children:"Optimization tools - Stylable has a deep awareness of how your stylesheets are used, and can optimize them to shorten names or remove dead code."}),"\n",(0,s.jsx)(t.li,{children:"Bundling - choose one of our supported bundler integrations to bundle your stylesheets for production."}),"\n"]}),"\n",(0,s.jsx)(t.h2,{id:"who-is-stylable-for",children:"Who is Stylable for?"}),"\n",(0,s.jsx)(t.p,{children:"We modeled Stylable after TypeScript, and like TypeScript, the more complex the project and the more people it involves, the greater the value it provides."}),"\n",(0,s.jsx)(t.p,{children:"Having said that, even a single developer working on a simple, standalone project could gain a lot of value from Stylable."}),"\n",(0,s.jsx)(t.h3,{id:"component-libraries",children:"Component libraries"}),"\n",(0,s.jsx)(t.p,{children:"Library authors can use Stylable to create reusable components, variants, and themes. It helps organize component and theme styling while controlling the elements and styles that are exposed as public interfaces."}),"\n",(0,s.jsx)(t.h3,{id:"applications",children:"Applications"}),"\n",(0,s.jsx)(t.p,{children:"Application creators can use Stylable to compose their own components alongside 3rd party libraries and to theme the final application to their UX and product requirements."}),"\n",(0,s.jsx)(t.hr,{}),"\n",(0,s.jsxs)(t.p,{children:["Sounds interesting? Ready to start?",(0,s.jsx)(t.br,{}),"\n","Head on over to the ",(0,s.jsx)(t.a,{href:"/docs/guides/handbook/class",children:"first chapter"}),", where we discuss classes, and what they mean in Stylable."]})]})}function h(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>a,x:()=>r});var i=n(6540);const s={},o=i.createContext(s);function a(e){const t=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),i.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/371f5dc2.e2912076.js b/assets/js/371f5dc2.dd91d3d5.js similarity index 57% rename from assets/js/371f5dc2.e2912076.js rename to assets/js/371f5dc2.dd91d3d5.js index f17b2be0..813e5baa 100644 --- a/assets/js/371f5dc2.e2912076.js +++ b/assets/js/371f5dc2.dd91d3d5.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[5184],{3940:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>d,contentTitle:()=>c,default:()=>b,frontMatter:()=>u,metadata:()=>r,toc:()=>p});const r=JSON.parse('{"id":"getting-started/boilerplate","title":"Boilerplate","description":"To get started quickly, Stylable offers a boilerplate utility that can be used to bootstrap new projects from a list of templates.","source":"@site/docs/getting-started/boilerplate.mdx","sourceDirName":"getting-started","slug":"/getting-started/boilerplate","permalink":"/docs/getting-started/boilerplate","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/getting-started/boilerplate.mdx","tags":[],"version":"current","frontMatter":{"id":"boilerplate","title":"Boilerplate"},"sidebar":"Discover","previous":{"title":"Intro","permalink":"/docs/getting-started/intro"},"next":{"title":"Manual Integration","permalink":"/docs/getting-started/manual-integration"}}');var n=a(4848),l=a(8453),s=a(9489),i=a(7227),o=a(2250);const u={id:"boilerplate",title:"Boilerplate"},c=void 0,d={},p=[{value:"ts-react-webpack
(app)",id:"ts-react-webpack-app",level:2},{value:"ts-react-rollup
(app)",id:"ts-react-rollup-app",level:2},{value:"Integrated and ready to learn?",id:"integrated-and-ready-to-learn",level:2}];function h(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",hr:"hr",li:"li",p:"p",strong:"strong",ul:"ul",...(0,l.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(t.p,{children:["To get started quickly, ",(0,n.jsx)(t.strong,{children:"Stylable"})," offers a boilerplate utility that can be used to bootstrap new projects from a list of templates."]}),"\n",(0,n.jsxs)(t.h2,{id:"ts-react-webpack-app",children:[(0,n.jsx)(t.code,{children:"ts-react-webpack"})," (app)"]}),"\n",(0,n.jsx)(t.p,{children:"This is the default template, it creates a new project and includes:"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:["A ",(0,n.jsx)(t.strong,{children:"React"})," application"]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Webpack"})," bundling including production optimizations"]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"TypeScript"})," support with automatically generated stylesheet type definitions"]}),"\n"]}),"\n",(0,n.jsx)(t.p,{children:"To use this template, run the following command:"}),"\n",(0,n.jsxs)(s.A,{groupId:"packageManager",children:[(0,n.jsx)(i.A,{value:"npm",label:"NPM",default:!0,children:(0,n.jsx)(o.A,{language:"bash",children:"npm init stylable-app [PROJECT_NAME]"})}),(0,n.jsx)(i.A,{value:"yarn",label:"Yarn",children:(0,n.jsx)(o.A,{language:"bash",children:"yarn create stylable-app [PROJECT_NAME]"})})]}),"\n",(0,n.jsxs)(t.h2,{id:"ts-react-rollup-app",children:[(0,n.jsx)(t.code,{children:"ts-react-rollup"})," (app)"]}),"\n",(0,n.jsx)(t.p,{children:"This is an alternative template, it creates a new project and includes:"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:["A ",(0,n.jsx)(t.strong,{children:"React"})," application"]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Rollup"})," bundling"]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"TypeScript"})," support with automatically generated stylesheet type definitions"]}),"\n"]}),"\n",(0,n.jsx)(t.p,{children:"To use this template, run the following command:"}),"\n",(0,n.jsxs)(s.A,{groupId:"packageManager",children:[(0,n.jsx)(i.A,{value:"npm",label:"NPM",default:!0,children:(0,n.jsx)(o.A,{language:"bash",children:"npm init stylable-app -- [PROJECT_NAME] --template ts-react-rollup"})}),(0,n.jsx)(i.A,{value:"yarn",label:"Yarn",children:(0,n.jsx)(o.A,{language:"bash",children:"yarn create stylable-app [PROJECT_NAME] --template ts-react-rollup"})})]}),"\n",(0,n.jsx)(t.admonition,{title:"Missing a template?",type:"note",children:(0,n.jsxs)(t.p,{children:["Got a use-case we don't support? A template you would like us to add? Let us know by ",(0,n.jsx)(t.a,{href:"https://github.com/wix/stylable/issues/new?assignees=&labels=triage&template=proposal.yaml",children:"creating a new template proposal"}),"."]})}),"\n",(0,n.jsx)(t.hr,{}),"\n",(0,n.jsx)(t.h2,{id:"integrated-and-ready-to-learn",children:"Integrated and ready to learn?"}),"\n",(0,n.jsxs)(t.p,{children:["Once your project is up and running, you can begin styling with ",(0,n.jsx)(t.strong,{children:"Stylable"}),". Read through the ",(0,n.jsx)(t.a,{href:"/docs/guides/handbook/intro",children:"Handbook"})," or explore the ",(0,n.jsx)(t.a,{href:"/docs/references/cheatsheet",children:"API References"})," to help guide you in your work."]})]})}function b(e={}){const{wrapper:t}={...(0,l.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(h,{...e})}):h(e)}},7227:(e,t,a)=>{a.d(t,{A:()=>s});a(6540);var r=a(4164);const n={tabItem:"tabItem_Ymn6"};var l=a(4848);function s(e){let{children:t,hidden:a,className:s}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,r.A)(n.tabItem,s),hidden:a,children:t})}},9489:(e,t,a)=>{a.d(t,{A:()=>w});var r=a(6540),n=a(4164),l=a(4245),s=a(6347),i=a(6494),o=a(2814),u=a(5167),c=a(9900);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Badchild <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:t,children:a}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:a,attributes:r,default:n}}=e;return{value:t,label:a,attributes:r,default:n}}))}(a);return function(e){const t=(0,u.XI)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,a])}function h(e){let{value:t,tabValues:a}=e;return a.some((e=>e.value===t))}function b(e){let{queryString:t=!1,groupId:a}=e;const n=(0,s.W6)(),l=function(e){let{queryString:t=!1,groupId:a}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!a)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return a??null}({queryString:t,groupId:a});return[(0,o.aZ)(l),(0,r.useCallback)((e=>{if(!l)return;const t=new URLSearchParams(n.location.search);t.set(l,e),n.replace({...n.location,search:t.toString()})}),[l,n])]}function g(e){const{defaultValue:t,queryString:a=!1,groupId:n}=e,l=p(e),[s,o]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:a}=e;if(0===a.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!h({value:t,tabValues:a}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${a.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=a.find((e=>e.default))??a[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:l}))),[u,d]=b({queryString:a,groupId:n}),[g,m]=function(e){let{groupId:t}=e;const a=function(e){return e?`docusaurus.tab.${e}`:null}(t),[n,l]=(0,c.Dv)(a);return[n,(0,r.useCallback)((e=>{a&&l.set(e)}),[a,l])]}({groupId:n}),f=(()=>{const e=u??g;return h({value:e,tabValues:l})?e:null})();(0,i.A)((()=>{f&&o(f)}),[f]);return{selectedValue:s,selectValue:(0,r.useCallback)((e=>{if(!h({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);o(e),d(e),m(e)}),[d,m,l]),tabValues:l}}var m=a(1062);const f={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var x=a(4848);function y(e){let{className:t,block:a,selectedValue:r,selectValue:s,tabValues:i}=e;const o=[],{blockElementScrollPositionUntilNextRender:u}=(0,l.a_)(),c=e=>{const t=e.currentTarget,a=o.indexOf(t),n=i[a].value;n!==r&&(u(t),s(n))},d=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const a=o.indexOf(e.currentTarget)+1;t=o[a]??o[0];break}case"ArrowLeft":{const a=o.indexOf(e.currentTarget)-1;t=o[a]??o[o.length-1];break}}t?.focus()};return(0,x.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,n.A)("tabs",{"tabs--block":a},t),children:i.map((e=>{let{value:t,label:a,attributes:l}=e;return(0,x.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>o.push(e),onKeyDown:d,onClick:c,...l,className:(0,n.A)("tabs__item",f.tabItem,l?.className,{"tabs__item--active":r===t}),children:a??t},t)}))})}function j(e){let{lazy:t,children:a,selectedValue:l}=e;const s=(Array.isArray(a)?a:[a]).filter(Boolean);if(t){const e=s.find((e=>e.props.value===l));return e?(0,r.cloneElement)(e,{className:(0,n.A)("margin-top--md",e.props.className)}):null}return(0,x.jsx)("div",{className:"margin-top--md",children:s.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==l})))})}function v(e){const t=g(e);return(0,x.jsxs)("div",{className:(0,n.A)("tabs-container",f.tabList),children:[(0,x.jsx)(y,{...t,...e}),(0,x.jsx)(j,{...t,...e})]})}function w(e){const t=(0,m.A)();return(0,x.jsx)(v,{...e,children:d(e.children)},String(t))}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[5184],{6590:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>d,contentTitle:()=>c,default:()=>b,frontMatter:()=>u,metadata:()=>r,toc:()=>p});const r=JSON.parse('{"id":"getting-started/boilerplate","title":"Boilerplate","description":"To get started quickly, Stylable offers a boilerplate utility that can be used to bootstrap new projects from a list of templates.","source":"@site/docs/getting-started/boilerplate.mdx","sourceDirName":"getting-started","slug":"/getting-started/boilerplate","permalink":"/docs/getting-started/boilerplate","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/getting-started/boilerplate.mdx","tags":[],"version":"current","frontMatter":{"id":"boilerplate","title":"Boilerplate"},"sidebar":"Discover","previous":{"title":"Intro","permalink":"/docs/getting-started/intro"},"next":{"title":"Manual Integration","permalink":"/docs/getting-started/manual-integration"}}');var n=a(4848),l=a(8453),s=a(1470),i=a(9365),o=a(1432);const u={id:"boilerplate",title:"Boilerplate"},c=void 0,d={},p=[{value:" ts-react-webpack
(app)",id:"ts-react-webpack-app",level:2},{value:"ts-react-rollup
(app)",id:"ts-react-rollup-app",level:2},{value:"Integrated and ready to learn?",id:"integrated-and-ready-to-learn",level:2}];function h(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",hr:"hr",li:"li",p:"p",strong:"strong",ul:"ul",...(0,l.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(t.p,{children:["To get started quickly, ",(0,n.jsx)(t.strong,{children:"Stylable"})," offers a boilerplate utility that can be used to bootstrap new projects from a list of templates."]}),"\n",(0,n.jsxs)(t.h2,{id:"ts-react-webpack-app",children:[(0,n.jsx)(t.code,{children:"ts-react-webpack"})," (app)"]}),"\n",(0,n.jsx)(t.p,{children:"This is the default template, it creates a new project and includes:"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:["A ",(0,n.jsx)(t.strong,{children:"React"})," application"]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Webpack"})," bundling including production optimizations"]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"TypeScript"})," support with automatically generated stylesheet type definitions"]}),"\n"]}),"\n",(0,n.jsx)(t.p,{children:"To use this template, run the following command:"}),"\n",(0,n.jsxs)(s.A,{groupId:"packageManager",children:[(0,n.jsx)(i.A,{value:"npm",label:"NPM",default:!0,children:(0,n.jsx)(o.A,{language:"bash",children:"npm init stylable-app [PROJECT_NAME]"})}),(0,n.jsx)(i.A,{value:"yarn",label:"Yarn",children:(0,n.jsx)(o.A,{language:"bash",children:"yarn create stylable-app [PROJECT_NAME]"})})]}),"\n",(0,n.jsxs)(t.h2,{id:"ts-react-rollup-app",children:[(0,n.jsx)(t.code,{children:"ts-react-rollup"})," (app)"]}),"\n",(0,n.jsx)(t.p,{children:"This is an alternative template, it creates a new project and includes:"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:["A ",(0,n.jsx)(t.strong,{children:"React"})," application"]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Rollup"})," bundling"]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"TypeScript"})," support with automatically generated stylesheet type definitions"]}),"\n"]}),"\n",(0,n.jsx)(t.p,{children:"To use this template, run the following command:"}),"\n",(0,n.jsxs)(s.A,{groupId:"packageManager",children:[(0,n.jsx)(i.A,{value:"npm",label:"NPM",default:!0,children:(0,n.jsx)(o.A,{language:"bash",children:"npm init stylable-app -- [PROJECT_NAME] --template ts-react-rollup"})}),(0,n.jsx)(i.A,{value:"yarn",label:"Yarn",children:(0,n.jsx)(o.A,{language:"bash",children:"yarn create stylable-app [PROJECT_NAME] --template ts-react-rollup"})})]}),"\n",(0,n.jsx)(t.admonition,{title:"Missing a template?",type:"note",children:(0,n.jsxs)(t.p,{children:["Got a use-case we don't support? A template you would like us to add? Let us know by ",(0,n.jsx)(t.a,{href:"https://github.com/wix/stylable/issues/new?assignees=&labels=triage&template=proposal.yaml",children:"creating a new template proposal"}),"."]})}),"\n",(0,n.jsx)(t.hr,{}),"\n",(0,n.jsx)(t.h2,{id:"integrated-and-ready-to-learn",children:"Integrated and ready to learn?"}),"\n",(0,n.jsxs)(t.p,{children:["Once your project is up and running, you can begin styling with ",(0,n.jsx)(t.strong,{children:"Stylable"}),". Read through the ",(0,n.jsx)(t.a,{href:"/docs/guides/handbook/intro",children:"Handbook"})," or explore the ",(0,n.jsx)(t.a,{href:"/docs/references/cheatsheet",children:"API References"})," to help guide you in your work."]})]})}function b(e={}){const{wrapper:t}={...(0,l.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(h,{...e})}):h(e)}},9365:(e,t,a)=>{a.d(t,{A:()=>s});a(6540);var r=a(4164);const n={tabItem:"tabItem_Ymn6"};var l=a(4848);function s(e){let{children:t,hidden:a,className:s}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,r.A)(n.tabItem,s),hidden:a,children:t})}},1470:(e,t,a)=>{a.d(t,{A:()=>w});var r=a(6540),n=a(4164),l=a(3104),s=a(6347),i=a(205),o=a(7485),u=a(1682),c=a(679);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Badchild <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:t,children:a}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:a,attributes:r,default:n}}=e;return{value:t,label:a,attributes:r,default:n}}))}(a);return function(e){const t=(0,u.XI)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,a])}function h(e){let{value:t,tabValues:a}=e;return a.some((e=>e.value===t))}function b(e){let{queryString:t=!1,groupId:a}=e;const n=(0,s.W6)(),l=function(e){let{queryString:t=!1,groupId:a}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!a)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return a??null}({queryString:t,groupId:a});return[(0,o.aZ)(l),(0,r.useCallback)((e=>{if(!l)return;const t=new URLSearchParams(n.location.search);t.set(l,e),n.replace({...n.location,search:t.toString()})}),[l,n])]}function g(e){const{defaultValue:t,queryString:a=!1,groupId:n}=e,l=p(e),[s,o]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:a}=e;if(0===a.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!h({value:t,tabValues:a}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${a.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=a.find((e=>e.default))??a[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:l}))),[u,d]=b({queryString:a,groupId:n}),[g,m]=function(e){let{groupId:t}=e;const a=function(e){return e?`docusaurus.tab.${e}`:null}(t),[n,l]=(0,c.Dv)(a);return[n,(0,r.useCallback)((e=>{a&&l.set(e)}),[a,l])]}({groupId:n}),f=(()=>{const e=u??g;return h({value:e,tabValues:l})?e:null})();(0,i.A)((()=>{f&&o(f)}),[f]);return{selectedValue:s,selectValue:(0,r.useCallback)((e=>{if(!h({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);o(e),d(e),m(e)}),[d,m,l]),tabValues:l}}var m=a(2303);const f={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var x=a(4848);function y(e){let{className:t,block:a,selectedValue:r,selectValue:s,tabValues:i}=e;const o=[],{blockElementScrollPositionUntilNextRender:u}=(0,l.a_)(),c=e=>{const t=e.currentTarget,a=o.indexOf(t),n=i[a].value;n!==r&&(u(t),s(n))},d=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const a=o.indexOf(e.currentTarget)+1;t=o[a]??o[0];break}case"ArrowLeft":{const a=o.indexOf(e.currentTarget)-1;t=o[a]??o[o.length-1];break}}t?.focus()};return(0,x.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,n.A)("tabs",{"tabs--block":a},t),children:i.map((e=>{let{value:t,label:a,attributes:l}=e;return(0,x.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>{o.push(e)},onKeyDown:d,onClick:c,...l,className:(0,n.A)("tabs__item",f.tabItem,l?.className,{"tabs__item--active":r===t}),children:a??t},t)}))})}function j(e){let{lazy:t,children:a,selectedValue:l}=e;const s=(Array.isArray(a)?a:[a]).filter(Boolean);if(t){const e=s.find((e=>e.props.value===l));return e?(0,r.cloneElement)(e,{className:(0,n.A)("margin-top--md",e.props.className)}):null}return(0,x.jsx)("div",{className:"margin-top--md",children:s.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==l})))})}function v(e){const t=g(e);return(0,x.jsxs)("div",{className:(0,n.A)("tabs-container",f.tabList),children:[(0,x.jsx)(y,{...t,...e}),(0,x.jsx)(j,{...t,...e})]})}function w(e){const t=(0,m.A)();return(0,x.jsx)(v,{...e,children:d(e.children)},String(t))}}}]); \ No newline at end of file diff --git a/assets/js/4491.82a2b9c4.js b/assets/js/4491.82a2b9c4.js deleted file mode 100644 index 37e85071..00000000 --- a/assets/js/4491.82a2b9c4.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see 4491.82a2b9c4.js.LICENSE.txt */ -(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[4491],{4491:(e,t,r)=>{"use strict";const n=Symbol("Comlink.proxy"),i=Symbol("Comlink.endpoint"),s=Symbol("Comlink.releaseProxy"),o=Symbol("Comlink.finalizer"),a=Symbol("Comlink.thrown"),u=e=>"object"==typeof e&&null!==e||"function"==typeof e,l={canHandle:e=>u(e)&&e[n],serialize(e){const{port1:t,port2:r}=new MessageChannel;return h(e,t),[r,[r]]},deserialize:e=>(e.start(),function(e,t){const r=new Map;return e.addEventListener("message",(function(e){const{data:t}=e;if(!t||!t.id)return;const n=r.get(t.id);if(n)try{n(t)}finally{r.delete(t.id)}})),g(e,r,[],t)}(e))},c=new Map([["proxy",l],["throw",{canHandle:e=>u(e)&&a in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function h(e,t=globalThis,r=["*"]){t.addEventListener("message",(function i(s){if(!s||!s.data)return;if(!function(e,t){for(const r of e){if(t===r||"*"===r)return!0;if(r instanceof RegExp&&r.test(t))return!0}return!1}(r,s.origin))return void console.warn(`Invalid origin '${s.origin}' for comlink proxy`);const{id:u,type:l,path:c}=Object.assign({path:[]},s.data),f=(s.data.argumentList||[]).map(E);let p;try{const t=c.slice(0,-1).reduce(((e,t)=>e[t]),e),r=c.reduce(((e,t)=>e[t]),e);switch(l){case"GET":p=r;break;case"SET":t[c.slice(-1)[0]]=E(s.data.value),p=!0;break;case"APPLY":p=r.apply(t,f);break;case"CONSTRUCT":p=function(e){return Object.assign(e,{[n]:!0})}(new r(...f));break;case"ENDPOINT":{const{port1:t,port2:r}=new MessageChannel;h(e,r),p=function(e,t){return v.set(e,t),e}(t,[t])}break;case"RELEASE":p=void 0;break;default:return}}catch(y){p={value:y,[a]:0}}Promise.resolve(p).catch((e=>({value:e,[a]:0}))).then((r=>{const[n,s]=w(r);t.postMessage(Object.assign(Object.assign({},n),{id:u}),s),"RELEASE"===l&&(t.removeEventListener("message",i),d(t),o in e&&"function"==typeof e[o]&&e[o]())})).catch((e=>{const[r,n]=w({value:new TypeError("Unserializable return value"),[a]:0});t.postMessage(Object.assign(Object.assign({},r),{id:u}),n)}))})),t.start&&t.start()}function d(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function f(e){if(e)throw new Error("Proxy has been released and is not useable")}function p(e){return Q(e,new Map,{type:"RELEASE"}).then((()=>{d(e)}))}const y=new WeakMap,m="FinalizationRegistry"in globalThis&&new FinalizationRegistry((e=>{const t=(y.get(e)||0)-1;y.set(e,t),0===t&&p(e)}));function g(e,t,r=[],n=function(){}){let o=!1;const a=new Proxy(n,{get(n,i){if(f(o),i===s)return()=>{!function(e){m&&m.unregister(e)}(a),p(e),t.clear(),o=!0};if("then"===i){if(0===r.length)return{then:()=>a};const n=Q(e,t,{type:"GET",path:r.map((e=>e.toString()))}).then(E);return n.then.bind(n)}return g(e,t,[...r,i])},set(n,i,s){f(o);const[a,u]=w(s);return Q(e,t,{type:"SET",path:[...r,i].map((e=>e.toString())),value:a},u).then(E)},apply(n,s,a){f(o);const u=r[r.length-1];if(u===i)return Q(e,t,{type:"ENDPOINT"}).then(E);if("bind"===u)return g(e,t,r.slice(0,-1));const[l,c]=x(a);return Q(e,t,{type:"APPLY",path:r.map((e=>e.toString())),argumentList:l},c).then(E)},construct(n,i){f(o);const[s,a]=x(i);return Q(e,t,{type:"CONSTRUCT",path:r.map((e=>e.toString())),argumentList:s},a).then(E)}});return function(e,t){const r=(y.get(t)||0)+1;y.set(t,r),m&&m.register(e,t,e)}(a,e),a}function x(e){const t=e.map(w);return[t.map((e=>e[0])),(r=t.map((e=>e[1])),Array.prototype.concat.apply([],r))];var r}const v=new WeakMap;function w(e){for(const[t,r]of c)if(r.canHandle(e)){const[n,i]=r.serialize(e);return[{type:"HANDLER",name:t,value:n},i]}return[{type:"RAW",value:e},v.get(e)||[]]}function E(e){switch(e.type){case"HANDLER":return c.get(e.name).deserialize(e.value);case"RAW":return e.value}}function Q(e,t,r,n){return new Promise((i=>{const s=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");t.set(s,i),e.start&&e.start(),e.postMessage(Object.assign({id:s},r),n)}))}var k=r(8291),b=r.n(k),S=r(7812);const L=12;function T(e,t){const r=function(e,t){const r=e.map((e=>/\p{Unified_Ideograph}/u.test(e)?function(e,t){const r=[];return function e(n,i){let s=0,o=!1;for(const a of t)if(n.substr(0,a.length)===a){const t={missed:i.missed,term:i.term.concat({value:a})};n.length>a.length?e(n.substr(a.length),t):r.push(t),o=!0}else for(let t=a.length-1;t>s;t-=1){const u=a.substr(0,t);if(n.substr(0,t)===u){s=t;const a={missed:i.missed,term:i.term.concat({value:u,trailing:!0})};n.length>t?e(n.substr(t),a):r.push(a),o=!0;break}}o||(n.length>0?e(n.substr(1),{missed:i.missed+1,term:i.term}):i.term.length>0&&r.push(i))}(e,{missed:0,term:[]}),r.sort(((e,t)=>{const r=e.missed>0?1:0,n=t.missed>0?1:0;return r!==n?r-n:e.term.length-t.term.length})).map((e=>e.term))}(e,t):[{value:e}])).slice(0,L),n=r.filter((e=>e.length>1));let i=1,s=!1;for(const a of n)if(s)a.splice(1,a.length-1);else{a.length>6&&a.splice(6,a.length-6);const e=i*a.length;if(e>=L){if(e>L){const e=Math.floor(L/i);a.splice(e,a.length-e),i*=e}else i=e;i>6&&(s=!0)}else i=e}const o=[];return function e(t,n){if(t===r.length||n.length>=L)o.push(n.slice(0,L));else for(const i of r[t])e(t+1,n.concat(i))}(0,[]),o}(e,t);if(0===r.length)return[{tokens:e,term:e.map((e=>({value:e,presence:b().Query.presence.REQUIRED,wildcard:b().Query.wildcard.LEADING|b().Query.wildcard.TRAILING})))}];for(const o of r)o[o.length-1].maybeTyping=!0;const n=[];for(const o of S.BH)if("en"===o)S.sx||n.unshift(b().stopWordFilter);else{const e=b()[o];e.stopWordFilter&&n.unshift(e.stopWordFilter)}let i;if(n.length>0){const e=e=>n.reduce(((e,t)=>e.filter((e=>t(e.value)))),e);i=[];const t=[];for(const n of r){const r=e(n);i.push(r),r.length 0&&t.push(r)}r.push(...t)}else i=r.slice();const s=[];for(const o of i)if(o.length>2)for(let e=o.length-1;e>=0;e-=1)s.push(o.slice(0,e).concat(o.slice(e+1)));return P(r).concat(P(s))}function P(e){return I(e).concat(I(e.filter((e=>{const t=e[e.length-1];return!t.trailing&&t.maybeTyping})),!0))}function I(e,t){return e.map((e=>({tokens:e.map((e=>e.value)),term:e.map((e=>({value:e.value,presence:b().Query.presence.REQUIRED,wildcard:(t?e.trailing||e.maybeTyping:e.trailing)?b().Query.wildcard.TRAILING:b().Query.wildcard.NONE})))})))}var O;!function(e){e[e.Title=0]="Title",e[e.Heading=1]="Heading",e[e.Description=2]="Description",e[e.Keywords=3]="Keywords",e[e.Content=4]="Content"}(O||(O={}));const R=new Map;h(class{async fetchIndexes(e,t){await this.lowLevelFetchIndexes(e,t)}async lowLevelFetchIndexes(e,t){const r=`${e}${t}`;let n=R.get(r);return n||(n=async function(e,t){const r=`${e}${S.IH.replace("{dir}",t?`-${t.replace(/\//g,"-")}`:"")}`;if(new URL(r,location.origin).origin!==location.origin)throw new Error("Unexpected version url");const n=await(await fetch(r)).json(),i=n.map(((e,t)=>{let{documents:r,index:n}=e;return{type:t,documents:r,index:b().Index.load(n)}})),s=n.reduce(((e,t)=>{for(const r of t.index.invertedIndex)/\p{Unified_Ideograph}/u.test(r[0][0])&&e.add(r[0]);return e}),new Set);return{wrappedIndexes:i,zhDictionary:Array.from(s)}}(e,t),R.set(r,n)),n}async search(e,t,r){const n=function(e,t){if(1===t.length&&["ja","jp","th"].includes(t[0]))return b()[t[0]].tokenizer(e).map((e=>e.toString()));let r=/[^-\s]+/g;return t.includes("zh")&&(r=/\w+|\p{Unified_Ideograph}+/gu),e.toLowerCase().match(r)||[]}(r,S.BH);if(0===n.length)return[];const{wrappedIndexes:i,zhDictionary:s}=await this.lowLevelFetchIndexes(e,t),o=T(n,s),a=[];e:for(const{term:u,tokens:l}of o)for(const{documents:e,index:t,type:r}of i)if(a.push(...t.query((e=>{for(const t of u)e.term(t.value,{wildcard:t.wildcard,presence:t.presence})})).slice(0,S.AT).filter((e=>!a.some((t=>t.document.i.toString()===e.ref)))).slice(0,S.AT-a.length).map((t=>{const n=e.find((e=>e.i.toString()===t.ref));return{document:n,type:r,page:r!==O.Title&&i[0].documents.find((e=>e.i===n.p)),metadata:t.matchData.metadata,tokens:l,score:t.score}}))),a.length>=S.AT)break e;return function(e){e.forEach(((e,t)=>{e.index=t})),e.sort(((t,r)=>{let n=t.type!==O.Heading&&t.type!==O.Content&&t.type!==O.Description||!t.page?t.index:e.findIndex((e=>e.document===t.page)),i=r.type!==O.Heading&&r.type!==O.Content&&r.type!==O.Description||!r.page?r.index:e.findIndex((e=>e.document===r.page));if(-1===n&&(n=t.index),-1===i&&(i=r.index),n===i){const e=(0===r.type?1:0)-(0===t.type?1:0);return 0===e?t.index-r.index:e}return n-i}))}(a),function(e){e.forEach(((t,r)=>{r>0&&t.page&&e.slice(0,r).some((e=>(e.type===O.Keywords?e.page:e.document)===t.page))&&(r {var n,i;!function(){var s,o,a,u,l,c,h,d,f,p,y,m,g,x,v,w,E,Q,k,b,S,L,T,P,I,O,R,C,F,N,j=function(e){var t=new j.Builder;return t.pipeline.add(j.trimmer,j.stopWordFilter,j.stemmer),t.searchPipeline.add(j.stemmer),e.call(t,t),t.build()};j.version="2.3.9",j.utils={},j.utils.warn=(s=this,function(e){s.console&&console.warn&&console.warn(e)}),j.utils.asString=function(e){return null==e?"":e.toString()},j.utils.clone=function(e){if(null==e)return e;for(var t=Object.create(null),r=Object.keys(e),n=0;n 0){var u=j.utils.clone(t)||{};u.position=[o,a],u.index=i.length,i.push(new j.Token(r.slice(o,s),u))}o=s+1}}return i},j.tokenizer.separator=/[\s\-]+/,j.Pipeline=function(){this._stack=[]},j.Pipeline.registeredFunctions=Object.create(null),j.Pipeline.registerFunction=function(e,t){t in this.registeredFunctions&&j.utils.warn("Overwriting existing registered function: "+t),e.label=t,j.Pipeline.registeredFunctions[e.label]=e},j.Pipeline.warnIfFunctionNotRegistered=function(e){e.label&&e.label in this.registeredFunctions||j.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},j.Pipeline.load=function(e){var t=new j.Pipeline;return e.forEach((function(e){var r=j.Pipeline.registeredFunctions[e];if(!r)throw new Error("Cannot load unregistered function: "+e);t.add(r)})),t},j.Pipeline.prototype.add=function(){Array.prototype.slice.call(arguments).forEach((function(e){j.Pipeline.warnIfFunctionNotRegistered(e),this._stack.push(e)}),this)},j.Pipeline.prototype.after=function(e,t){j.Pipeline.warnIfFunctionNotRegistered(t);var r=this._stack.indexOf(e);if(-1==r)throw new Error("Cannot find existingFn");r+=1,this._stack.splice(r,0,t)},j.Pipeline.prototype.before=function(e,t){j.Pipeline.warnIfFunctionNotRegistered(t);var r=this._stack.indexOf(e);if(-1==r)throw new Error("Cannot find existingFn");this._stack.splice(r,0,t)},j.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);-1!=t&&this._stack.splice(t,1)},j.Pipeline.prototype.run=function(e){for(var t=this._stack.length,r=0;r 1&&(s e&&(r=i),s!=e);)n=r-t,i=t+Math.floor(n/2),s=this.elements[2*i];return s==e||s>e?2*i:s a?l+=2:o==a&&(t+=r[u+1]*n[l+1],u+=2,l+=2);return t},j.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},j.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),t=1,r=0;t 0){var s,o=i.str.charAt(0);o in i.node.edges?s=i.node.edges[o]:(s=new j.TokenSet,i.node.edges[o]=s),1==i.str.length&&(s.final=!0),n.push({node:s,editsRemaining:i.editsRemaining,str:i.str.slice(1)})}if(0!=i.editsRemaining){if("*"in i.node.edges)var a=i.node.edges["*"];else{a=new j.TokenSet;i.node.edges["*"]=a}if(0==i.str.length&&(a.final=!0),n.push({node:a,editsRemaining:i.editsRemaining-1,str:i.str}),i.str.length>1&&n.push({node:i.node,editsRemaining:i.editsRemaining-1,str:i.str.slice(1)}),1==i.str.length&&(i.node.final=!0),i.str.length>=1){if("*"in i.node.edges)var u=i.node.edges["*"];else{u=new j.TokenSet;i.node.edges["*"]=u}1==i.str.length&&(u.final=!0),n.push({node:u,editsRemaining:i.editsRemaining-1,str:i.str.slice(1)})}if(i.str.length>1){var l,c=i.str.charAt(0),h=i.str.charAt(1);h in i.node.edges?l=i.node.edges[h]:(l=new j.TokenSet,i.node.edges[h]=l),1==i.str.length&&(l.final=!0),n.push({node:l,editsRemaining:i.editsRemaining-1,str:c+i.str.slice(2)})}}}return r},j.TokenSet.fromString=function(e){for(var t=new j.TokenSet,r=t,n=0,i=e.length;n=e;t--){var r=this.uncheckedNodes[t],n=r.child.toString();n in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[n]:(r.child._str=n,this.minimizedNodes[n]=r.child),this.uncheckedNodes.pop()}},j.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},j.Index.prototype.search=function(e){return this.query((function(t){new j.QueryParser(e,t).parse()}))},j.Index.prototype.query=function(e){for(var t=new j.Query(this.fields),r=Object.create(null),n=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=0;a 1?1:e},j.Builder.prototype.k1=function(e){this._k1=e},j.Builder.prototype.add=function(e,t){var r=e[this._ref],n=Object.keys(this._fields);this._documents[r]=t||{},this.documentCount+=1;for(var i=0;i =this.length)return j.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},j.QueryLexer.prototype.width=function(){return this.pos-this.start},j.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},j.QueryLexer.prototype.backup=function(){this.pos-=1},j.QueryLexer.prototype.acceptDigitRun=function(){var e,t;do{t=(e=this.next()).charCodeAt(0)}while(t>47&&t<58);e!=j.QueryLexer.EOS&&this.backup()},j.QueryLexer.prototype.more=function(){return this.pos 1&&(e.backup(),e.emit(j.QueryLexer.TERM)),e.ignore(),e.more())return j.QueryLexer.lexText},j.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(j.QueryLexer.EDIT_DISTANCE),j.QueryLexer.lexText},j.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(j.QueryLexer.BOOST),j.QueryLexer.lexText},j.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(j.QueryLexer.TERM)},j.QueryLexer.termSeparator=j.tokenizer.separator,j.QueryLexer.lexText=function(e){for(;;){var t=e.next();if(t==j.QueryLexer.EOS)return j.QueryLexer.lexEOS;if(92!=t.charCodeAt(0)){if(":"==t)return j.QueryLexer.lexField;if("~"==t)return e.backup(),e.width()>0&&e.emit(j.QueryLexer.TERM),j.QueryLexer.lexEditDistance;if("^"==t)return e.backup(),e.width()>0&&e.emit(j.QueryLexer.TERM),j.QueryLexer.lexBoost;if("+"==t&&1===e.width())return e.emit(j.QueryLexer.PRESENCE),j.QueryLexer.lexText;if("-"==t&&1===e.width())return e.emit(j.QueryLexer.PRESENCE),j.QueryLexer.lexText;if(t.match(j.QueryLexer.termSeparator))return j.QueryLexer.lexTerm}else e.escapeCharacter()}},j.QueryParser=function(e,t){this.lexer=new j.QueryLexer(e),this.query=t,this.currentClause={},this.lexemeIdx=0},j.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=j.QueryParser.parseClause;e;)e=e(this);return this.query},j.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},j.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},j.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},j.QueryParser.parseClause=function(e){var t=e.peekLexeme();if(null!=t)switch(t.type){case j.QueryLexer.PRESENCE:return j.QueryParser.parsePresence;case j.QueryLexer.FIELD:return j.QueryParser.parseField;case j.QueryLexer.TERM:return j.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+t.type;throw t.str.length>=1&&(r+=" with value '"+t.str+"'"),new j.QueryParseError(r,t.start,t.end)}},j.QueryParser.parsePresence=function(e){var t=e.consumeLexeme();if(null!=t){switch(t.str){case"-":e.currentClause.presence=j.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=j.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+t.str+"'";throw new j.QueryParseError(r,t.start,t.end)}var n=e.peekLexeme();if(null==n){r="expecting term or field, found nothing";throw new j.QueryParseError(r,t.start,t.end)}switch(n.type){case j.QueryLexer.FIELD:return j.QueryParser.parseField;case j.QueryLexer.TERM:return j.QueryParser.parseTerm;default:r="expecting term or field, found '"+n.type+"'";throw new j.QueryParseError(r,n.start,n.end)}}},j.QueryParser.parseField=function(e){var t=e.consumeLexeme();if(null!=t){if(-1==e.query.allFields.indexOf(t.str)){var r=e.query.allFields.map((function(e){return"'"+e+"'"})).join(", "),n="unrecognised field '"+t.str+"', possible fields: "+r;throw new j.QueryParseError(n,t.start,t.end)}e.currentClause.fields=[t.str];var i=e.peekLexeme();if(null==i){n="expecting term, found nothing";throw new j.QueryParseError(n,t.start,t.end)}if(i.type===j.QueryLexer.TERM)return j.QueryParser.parseTerm;n="expecting term, found '"+i.type+"'";throw new j.QueryParseError(n,i.start,i.end)}},j.QueryParser.parseTerm=function(e){var t=e.consumeLexeme();if(null!=t){e.currentClause.term=t.str.toLowerCase(),-1!=t.str.indexOf("*")&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(null!=r)switch(r.type){case j.QueryLexer.TERM:return e.nextClause(),j.QueryParser.parseTerm;case j.QueryLexer.FIELD:return e.nextClause(),j.QueryParser.parseField;case j.QueryLexer.EDIT_DISTANCE:return j.QueryParser.parseEditDistance;case j.QueryLexer.BOOST:return j.QueryParser.parseBoost;case j.QueryLexer.PRESENCE:return e.nextClause(),j.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+r.type+"'";throw new j.QueryParseError(n,r.start,r.end)}else e.nextClause()}},j.QueryParser.parseEditDistance=function(e){var t=e.consumeLexeme();if(null!=t){var r=parseInt(t.str,10);if(isNaN(r)){var n="edit distance must be numeric";throw new j.QueryParseError(n,t.start,t.end)}e.currentClause.editDistance=r;var i=e.peekLexeme();if(null!=i)switch(i.type){case j.QueryLexer.TERM:return e.nextClause(),j.QueryParser.parseTerm;case j.QueryLexer.FIELD:return e.nextClause(),j.QueryParser.parseField;case j.QueryLexer.EDIT_DISTANCE:return j.QueryParser.parseEditDistance;case j.QueryLexer.BOOST:return j.QueryParser.parseBoost;case j.QueryLexer.PRESENCE:return e.nextClause(),j.QueryParser.parsePresence;default:n="Unexpected lexeme type '"+i.type+"'";throw new j.QueryParseError(n,i.start,i.end)}else e.nextClause()}},j.QueryParser.parseBoost=function(e){var t=e.consumeLexeme();if(null!=t){var r=parseInt(t.str,10);if(isNaN(r)){var n="boost must be numeric";throw new j.QueryParseError(n,t.start,t.end)}e.currentClause.boost=r;var i=e.peekLexeme();if(null!=i)switch(i.type){case j.QueryLexer.TERM:return e.nextClause(),j.QueryParser.parseTerm;case j.QueryLexer.FIELD:return e.nextClause(),j.QueryParser.parseField;case j.QueryLexer.EDIT_DISTANCE:return j.QueryParser.parseEditDistance;case j.QueryLexer.BOOST:return j.QueryParser.parseBoost;case j.QueryLexer.PRESENCE:return e.nextClause(),j.QueryParser.parsePresence;default:n="Unexpected lexeme type '"+i.type+"'";throw new j.QueryParseError(n,i.start,i.end)}else e.nextClause()}},void 0===(i="function"==typeof(n=function(){return j})?n.call(t,r,t,e):n)||(e.exports=i)}()}}]); \ No newline at end of file diff --git a/assets/js/46d93a8f.60d9bfdb.js b/assets/js/46d93a8f.d200022c.js similarity index 99% rename from assets/js/46d93a8f.60d9bfdb.js rename to assets/js/46d93a8f.d200022c.js index 95947b7f..f8e969ad 100644 --- a/assets/js/46d93a8f.60d9bfdb.js +++ b/assets/js/46d93a8f.d200022c.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[734],{9445:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>l,contentTitle:()=>a,default:()=>p,frontMatter:()=>o,metadata:()=>t,toc:()=>c});const t=JSON.parse('{"id":"guides/ssr","title":"Supporting Server Side Rendering","description":"Server side rendering (SSR) is an approach to serving JavaScript rendered web applications (such as React, Vue, Angular, etc...) that tries to improve time-to-paint, SEO support and more.","source":"@site/docs/guides/server-side-rendering.md","sourceDirName":"guides","slug":"/guides/ssr","permalink":"/docs/guides/ssr","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/guides/server-side-rendering.md","tags":[],"version":"current","frontMatter":{"id":"ssr","title":"Supporting Server Side Rendering","sidebar_label":"Server Side Rendering"},"sidebar":"Guides","previous":{"title":"Component Variants","permalink":"/docs/guides/component-variants"},"next":{"title":"Stylable v3","permalink":"/docs/guides/migration-v3"}}');var r=n(4848),i=n(8453);const o={id:"ssr",title:"Supporting Server Side Rendering",sidebar_label:"Server Side Rendering"},a=void 0,l={},c=[{value:"Transforming Stylable in the Server",id:"transforming-stylable-in-the-server",level:2},{value:"Matching namespaces",id:"matching-namespaces",level:2},{value:"Supporting multiple transpilation targets",id:"supporting-multiple-transpilation-targets",level:3},{value:"Publishing SSR-ready source files ( *.st.css
)",id:"publishing-ssr-ready-source-files-stcss",level:3}];function d(e){const s={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",pre:"pre",strong:"strong",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.p,{children:"Server side rendering (SSR) is an approach to serving JavaScript rendered web applications (such as React, Vue, Angular, etc...) that tries to improve time-to-paint, SEO support and more."}),"\n",(0,r.jsxs)(s.p,{children:["To learn more about SSR - see this ",(0,r.jsx)(s.a,{href:"https://dev.to/sunnysingh/the-benefits-and-origins-of-server-side-rendering-4doh",children:"introduction post"}),"."]}),"\n",(0,r.jsx)(s.p,{children:"When creating your library / application you will see that you might need to make some changes to your project publish / consumption process in order to integrate Stylable to your SSR flow."}),"\n",(0,r.jsx)(s.h2,{id:"transforming-stylable-in-the-server",children:"Transforming Stylable in the Server"}),"\n",(0,r.jsxs)(s.p,{children:["In order to use Stylable imports from your source files in ",(0,r.jsx)(s.code,{children:"nodeJS"}),", you will need to add ",(0,r.jsx)(s.code,{children:"@stylable/node"})," as a dependency."]}),"\n",(0,r.jsxs)(s.p,{children:["Import and use its ",(0,r.jsx)(s.code,{children:"requireHook"})," method before rendering to enable requiring Stylable stylesheets in their ",(0,r.jsx)(s.code,{children:"CommonJS"})," module format."]}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-js",children:"// server.js\nconst { attachHook } = require('@stylable/node');\n\nattachHook(); // enables requiring .st.css files as CommonJS\n\n// < render application ... >\n"})}),"\n",(0,r.jsx)(s.h2,{id:"matching-namespaces",children:"Matching namespaces"}),"\n",(0,r.jsxs)(s.p,{children:["In order to ensure full SSR compatibility, ",(0,r.jsx)(s.strong,{children:"generated namespaces for all stylesheets must match exactly"})," across all different build targets."]}),"\n",(0,r.jsxs)(s.p,{children:["The default Stylable ",(0,r.jsx)(s.code,{children:"namespaceResolver"})," uses a combination of file-system path, name and version from the ",(0,r.jsx)(s.code,{children:"package.json"})," file to create its namespace. This means that namespaces can be influenced by the published file path structure."]}),"\n",(0,r.jsx)(s.p,{children:"If you choose to provide an alternative namespace resolver that does not depend on file paths as part of its namespace creation, then you can avoid the problem described below."}),"\n",(0,r.jsx)(s.h3,{id:"supporting-multiple-transpilation-targets",children:"Supporting multiple transpilation targets"}),"\n",(0,r.jsx)(s.p,{children:"When building a library or application for consumption in both client and server environments it is common to output multiple transpilation targets for various module systems."}),"\n",(0,r.jsxs)(s.p,{children:["This means that a published project will usually have both ",(0,r.jsx)(s.code,{children:"CommonJS"})," and ",(0,r.jsx)(s.code,{children:"ES modules"}),", each with their own transpiled copy of the project, including the Stylable assets."]}),"\n",(0,r.jsx)(s.p,{children:"This can pose a problem when trying to synchronize namespace creation for SSR."}),"\n",(0,r.jsxs)(s.h3,{id:"publishing-ssr-ready-source-files-stcss",children:["Publishing SSR-ready source files (",(0,r.jsx)(s.code,{children:"*.st.css"}),")"]}),"\n",(0,r.jsxs)(s.p,{children:["The Stylable CLI offers a feature that allows you to sync your namespace across dist targets by inserting a custom header comment to the start of your ",(0,r.jsx)(s.code,{children:".st.css"})," file. This header comment is used to normalize namespacing paths across different build targets."]}),"\n",(0,r.jsxs)(s.p,{children:["When using ",(0,r.jsx)(s.code,{children:"@stylable/cli"})," to publish your source stylesheets, use the ",(0,r.jsx)(s.code,{children:"useNamespaceReference"})," flag to mark all targets as originating from the same original source."]}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-sh",children:"stc --srcDir ./src --outDir ./dist/cjs --cjs --stcss --useNamespaceReference\n"})}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-sh",children:"stc --srcDir ./src --outDir ./dist/esm --esm --stcss --useNamespaceReference\n"})}),"\n",(0,r.jsx)(s.p,{children:"For this to work properly, your source folder must be published along with your distribution build targets."})]})}function p(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,r.jsx)(s,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},8453:(e,s,n)=>{n.d(s,{R:()=>o,x:()=>a});var t=n(6540);const r={},i=t.createContext(r);function o(e){const s=t.useContext(i);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function a(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),t.createElement(i.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[734],{3691:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>l,contentTitle:()=>a,default:()=>p,frontMatter:()=>o,metadata:()=>t,toc:()=>c});const t=JSON.parse('{"id":"guides/ssr","title":"Supporting Server Side Rendering","description":"Server side rendering (SSR) is an approach to serving JavaScript rendered web applications (such as React, Vue, Angular, etc...) that tries to improve time-to-paint, SEO support and more.","source":"@site/docs/guides/server-side-rendering.md","sourceDirName":"guides","slug":"/guides/ssr","permalink":"/docs/guides/ssr","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/guides/server-side-rendering.md","tags":[],"version":"current","frontMatter":{"id":"ssr","title":"Supporting Server Side Rendering","sidebar_label":"Server Side Rendering"},"sidebar":"Guides","previous":{"title":"Component Variants","permalink":"/docs/guides/component-variants"},"next":{"title":"Stylable v3","permalink":"/docs/guides/migration-v3"}}');var r=n(4848),i=n(8453);const o={id:"ssr",title:"Supporting Server Side Rendering",sidebar_label:"Server Side Rendering"},a=void 0,l={},c=[{value:"Transforming Stylable in the Server",id:"transforming-stylable-in-the-server",level:2},{value:"Matching namespaces",id:"matching-namespaces",level:2},{value:"Supporting multiple transpilation targets",id:"supporting-multiple-transpilation-targets",level:3},{value:"Publishing SSR-ready source files (*.st.css
)",id:"publishing-ssr-ready-source-files-stcss",level:3}];function d(e){const s={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",pre:"pre",strong:"strong",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.p,{children:"Server side rendering (SSR) is an approach to serving JavaScript rendered web applications (such as React, Vue, Angular, etc...) that tries to improve time-to-paint, SEO support and more."}),"\n",(0,r.jsxs)(s.p,{children:["To learn more about SSR - see this ",(0,r.jsx)(s.a,{href:"https://dev.to/sunnysingh/the-benefits-and-origins-of-server-side-rendering-4doh",children:"introduction post"}),"."]}),"\n",(0,r.jsx)(s.p,{children:"When creating your library / application you will see that you might need to make some changes to your project publish / consumption process in order to integrate Stylable to your SSR flow."}),"\n",(0,r.jsx)(s.h2,{id:"transforming-stylable-in-the-server",children:"Transforming Stylable in the Server"}),"\n",(0,r.jsxs)(s.p,{children:["In order to use Stylable imports from your source files in ",(0,r.jsx)(s.code,{children:"nodeJS"}),", you will need to add ",(0,r.jsx)(s.code,{children:"@stylable/node"})," as a dependency."]}),"\n",(0,r.jsxs)(s.p,{children:["Import and use its ",(0,r.jsx)(s.code,{children:"requireHook"})," method before rendering to enable requiring Stylable stylesheets in their ",(0,r.jsx)(s.code,{children:"CommonJS"})," module format."]}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-js",children:"// server.js\nconst { attachHook } = require('@stylable/node');\n\nattachHook(); // enables requiring .st.css files as CommonJS\n\n// < render application ... >\n"})}),"\n",(0,r.jsx)(s.h2,{id:"matching-namespaces",children:"Matching namespaces"}),"\n",(0,r.jsxs)(s.p,{children:["In order to ensure full SSR compatibility, ",(0,r.jsx)(s.strong,{children:"generated namespaces for all stylesheets must match exactly"})," across all different build targets."]}),"\n",(0,r.jsxs)(s.p,{children:["The default Stylable ",(0,r.jsx)(s.code,{children:"namespaceResolver"})," uses a combination of file-system path, name and version from the ",(0,r.jsx)(s.code,{children:"package.json"})," file to create its namespace. This means that namespaces can be influenced by the published file path structure."]}),"\n",(0,r.jsx)(s.p,{children:"If you choose to provide an alternative namespace resolver that does not depend on file paths as part of its namespace creation, then you can avoid the problem described below."}),"\n",(0,r.jsx)(s.h3,{id:"supporting-multiple-transpilation-targets",children:"Supporting multiple transpilation targets"}),"\n",(0,r.jsx)(s.p,{children:"When building a library or application for consumption in both client and server environments it is common to output multiple transpilation targets for various module systems."}),"\n",(0,r.jsxs)(s.p,{children:["This means that a published project will usually have both ",(0,r.jsx)(s.code,{children:"CommonJS"})," and ",(0,r.jsx)(s.code,{children:"ES modules"}),", each with their own transpiled copy of the project, including the Stylable assets."]}),"\n",(0,r.jsx)(s.p,{children:"This can pose a problem when trying to synchronize namespace creation for SSR."}),"\n",(0,r.jsxs)(s.h3,{id:"publishing-ssr-ready-source-files-stcss",children:["Publishing SSR-ready source files (",(0,r.jsx)(s.code,{children:"*.st.css"}),")"]}),"\n",(0,r.jsxs)(s.p,{children:["The Stylable CLI offers a feature that allows you to sync your namespace across dist targets by inserting a custom header comment to the start of your ",(0,r.jsx)(s.code,{children:".st.css"})," file. This header comment is used to normalize namespacing paths across different build targets."]}),"\n",(0,r.jsxs)(s.p,{children:["When using ",(0,r.jsx)(s.code,{children:"@stylable/cli"})," to publish your source stylesheets, use the ",(0,r.jsx)(s.code,{children:"useNamespaceReference"})," flag to mark all targets as originating from the same original source."]}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-sh",children:"stc --srcDir ./src --outDir ./dist/cjs --cjs --stcss --useNamespaceReference\n"})}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-sh",children:"stc --srcDir ./src --outDir ./dist/esm --esm --stcss --useNamespaceReference\n"})}),"\n",(0,r.jsx)(s.p,{children:"For this to work properly, your source folder must be published along with your distribution build targets."})]})}function p(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,r.jsx)(s,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},8453:(e,s,n)=>{n.d(s,{R:()=>o,x:()=>a});var t=n(6540);const r={},i=t.createContext(r);function o(e){const s=t.useContext(i);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function a(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),t.createElement(i.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/4809.a6140d43.js b/assets/js/4809.a6140d43.js new file mode 100644 index 00000000..0dd8e699 --- /dev/null +++ b/assets/js/4809.a6140d43.js @@ -0,0 +1 @@ +(()=>{"use strict";var e,r,t={4809:(e,r,t)=>{t.d(r,{AT:()=>n,BH:()=>s,IH:()=>a,sx:()=>o});t(8291);const o=!1,s=["en"],a="search-index{dir}.json?_=370ab76e",n=8}},o={};function s(e){var r=o[e];if(void 0!==r)return r.exports;var a=o[e]={exports:{}};return t[e](a,a.exports,s),a.exports}s.m=t,s.x=()=>{var e=s.O(void 0,[540],(()=>s(540)));return e=s.O(e)},e=[],s.O=(r,t,o,a)=>{if(!t){var n=1/0;for(u=0;u=a)&&Object.keys(s.O).every((e=>s.O[e](t[p])))?t.splice(p--,1):(i=!1,a 0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[t,o,a]},s.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return s.d(r,{a:r}),r},s.d=(e,r)=>{for(var t in r)s.o(r,t)&&!s.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((r,t)=>(s.f[t](e,r),r)),[])),s.u=e=>"assets/js/"+e+".b78022b2.js",s.miniCssF=e=>{},s.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),s.p="/",s.gca=function(e){return e={}[e]||e,s.p+s.u(e)},(()=>{var e={4809:1};s.f.i=(r,t)=>{e[r]||importScripts(s.p+s.u(r))};var r=self.webpackChunkstylable_io=self.webpackChunkstylable_io||[],t=r.push.bind(r);r.push=r=>{var o=r[0],a=r[1],n=r[2];for(var i in a)s.o(a,i)&&(s.m[i]=a[i]);for(n&&n(s);o.length;)e[o.pop()]=1;t(r)}})(),r=s.x,s.x=()=>s.e(540).then(r);s.x()})(); \ No newline at end of file diff --git a/assets/js/5394.6807d4db.js b/assets/js/5394.6807d4db.js new file mode 100644 index 00000000..14868675 --- /dev/null +++ b/assets/js/5394.6807d4db.js @@ -0,0 +1 @@ +(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[5394],{1432:(e,t,n)=>{"use strict";n.d(t,{A:()=>V});var o=n(6540),s=n(2303),c=n(4164),r=n(5293),a=n(6342);function l(){const{prism:e}=(0,a.p)(),{colorMode:t}=(0,r.G)(),n=e.theme,o=e.darkTheme||n;return"dark"===t?o:n}var i=n(7559),u=n(8426),d=n.n(u);const m=/title=(? ["'])(?.*?)\1/,p=/\{(? [\d,-]+)\}/,b={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},f={...b,lua:{start:"--",end:""},wasm:{start:"\\;\\;",end:""},tex:{start:"%",end:""},vb:{start:"['\u2018\u2019]",end:""},vbnet:{start:"(?:_\\s*)?['\u2018\u2019]",end:""},rem:{start:"[Rr][Ee][Mm]\\b",end:""},f90:{start:"!",end:""},ml:{start:"\\(\\*",end:"\\*\\)"},cobol:{start:"\\*>",end:""}},h=Object.keys(b);function g(e,t){const n=e.map((e=>{const{start:n,end:o}=f[e];return`(?:${n}\\s*(${t.flatMap((e=>[e.line,e.block?.start,e.block?.end].filter(Boolean))).join("|")})\\s*${o})`})).join("|");return new RegExp(`^\\s*(?:${n})\\s*$`)}function k(e,t){let n=e.replace(/\n$/,"");const{language:o,magicComments:s,metastring:c}=t;if(c&&p.test(c)){const e=c.match(p).groups.range;if(0===s.length)throw new Error(`A highlight range has been given in code block's metastring (\`\`\` ${c}), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.`);const t=s[0].className,o=d()(e).filter((e=>e>0)).map((e=>[e-1,[t]]));return{lineClassNames:Object.fromEntries(o),code:n}}if(void 0===o)return{lineClassNames:{},code:n};const r=function(e,t){switch(e){case"js":case"javascript":case"ts":case"typescript":return g(["js","jsBlock"],t);case"jsx":case"tsx":return g(["js","jsBlock","jsx"],t);case"html":return g(["js","jsBlock","html"],t);case"python":case"py":case"bash":return g(["bash"],t);case"markdown":case"md":return g(["html","jsx","bash"],t);case"tex":case"latex":case"matlab":return g(["tex"],t);case"lua":case"haskell":return g(["lua"],t);case"sql":return g(["lua","jsBlock"],t);case"wasm":return g(["wasm"],t);case"vb":case"vba":case"visual-basic":return g(["vb","rem"],t);case"vbnet":return g(["vbnet","rem"],t);case"batch":return g(["rem"],t);case"basic":return g(["rem","f90"],t);case"fsharp":return g(["js","ml"],t);case"ocaml":case"sml":return g(["ml"],t);case"fortran":return g(["f90"],t);case"cobol":return g(["cobol"],t);default:return g(h,t)}}(o,s),a=n.split("\n"),l=Object.fromEntries(s.map((e=>[e.className,{start:0,range:""}]))),i=Object.fromEntries(s.filter((e=>e.line)).map((e=>{let{className:t,line:n}=e;return[n,t]}))),u=Object.fromEntries(s.filter((e=>e.block)).map((e=>{let{className:t,block:n}=e;return[n.start,t]}))),m=Object.fromEntries(s.filter((e=>e.block)).map((e=>{let{className:t,block:n}=e;return[n.end,t]})));for(let d=0;d void 0!==e));i[t]?l[i[t]].range+=`${d},`:u[t]?l[u[t]].start=d:m[t]&&(l[m[t]].range+=`${l[m[t]].start}-${d-1},`),a.splice(d,1)}n=a.join("\n");const b={};return Object.entries(l).forEach((e=>{let[t,{range:n}]=e;d()(n).forEach((e=>{b[e]??=[],b[e].push(t)}))})),{lineClassNames:b,code:n}}const B={codeBlockContainer:"codeBlockContainer_Ckt0"};var x=n(4848);function j(e){let{as:t,...n}=e;const o=function(e){const t={color:"--prism-color",backgroundColor:"--prism-background-color"},n={};return Object.entries(e.plain).forEach((e=>{let[o,s]=e;const c=t[o];c&&"string"==typeof s&&(n[c]=s)})),n}(l());return(0,x.jsx)(t,{...n,style:o,className:(0,c.A)(n.className,B.codeBlockContainer,i.G.common.codeBlock)})}const y={codeBlockContent:"codeBlockContent_biex",codeBlockTitle:"codeBlockTitle_Ktv7",codeBlock:"codeBlock_bY9V",codeBlockStandalone:"codeBlockStandalone_MEMb",codeBlockLines:"codeBlockLines_e6Vv",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_o6Pm",buttonGroup:"buttonGroup__atx"};function v(e){let{children:t,className:n}=e;return(0,x.jsx)(j,{as:"pre",tabIndex:0,className:(0,c.A)(y.codeBlockStandalone,"thin-scrollbar",n),children:(0,x.jsx)("code",{className:y.codeBlockLines,children:t})})}var C=n(9532);const N={attributes:!0,characterData:!0,childList:!0,subtree:!0};function w(e,t){const[n,s]=(0,o.useState)(),c=(0,o.useCallback)((()=>{s(e.current?.closest("[role=tabpanel][hidden]"))}),[e,s]);(0,o.useEffect)((()=>{c()}),[c]),function(e,t,n){void 0===n&&(n=N);const s=(0,C._q)(t),c=(0,C.Be)(n);(0,o.useEffect)((()=>{const t=new MutationObserver(s);return e&&t.observe(e,c),()=>t.disconnect()}),[e,s,c])}(n,(e=>{e.forEach((e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(t(),c())}))}),{attributes:!0,characterData:!1,childList:!1,subtree:!1})}var E=n(1765);const L={codeLine:"codeLine_lJS_",codeLineNumber:"codeLineNumber_Tfdd",codeLineContent:"codeLineContent_feaV"};function A(e){let{line:t,classNames:n,showLineNumbers:o,getLineProps:s,getTokenProps:r}=e;1===t.length&&"\n"===t[0].content&&(t[0].content="");const a=s({line:t,className:(0,c.A)(n,o&&L.codeLine)}),l=t.map(((e,t)=>(0,x.jsx)("span",{...r({token:e})},t)));return(0,x.jsxs)("span",{...a,children:[o?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("span",{className:L.codeLineNumber}),(0,x.jsx)("span",{className:L.codeLineContent,children:l})]}):l,(0,x.jsx)("br",{})]})}var _=n(1312);function S(e){return(0,x.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,x.jsx)("path",{fill:"currentColor",d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"})})}function T(e){return(0,x.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,x.jsx)("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})}const I={copyButtonCopied:"copyButtonCopied_obH4",copyButtonIcons:"copyButtonIcons_eSgA",copyButtonIcon:"copyButtonIcon_y97N",copyButtonSuccessIcon:"copyButtonSuccessIcon_LjdS"};function $(e){let{code:t,className:n}=e;const[s,r]=(0,o.useState)(!1),a=(0,o.useRef)(void 0),l=(0,o.useCallback)((()=>{!function(e,t){let{target:n=document.body}=void 0===t?{}:t;if("string"!=typeof e)throw new TypeError(`Expected parameter \`text\` to be a \`string\`, got \`${typeof e}\`.`);const o=document.createElement("textarea"),s=document.activeElement;o.value=e,o.setAttribute("readonly",""),o.style.contain="strict",o.style.position="absolute",o.style.left="-9999px",o.style.fontSize="12pt";const c=document.getSelection(),r=c.rangeCount>0&&c.getRangeAt(0);n.append(o),o.select(),o.selectionStart=0,o.selectionEnd=e.length;let a=!1;try{a=document.execCommand("copy")}catch{}o.remove(),r&&(c.removeAllRanges(),c.addRange(r)),s&&s.focus()}(t),r(!0),a.current=window.setTimeout((()=>{r(!1)}),1e3)}),[t]);return(0,o.useEffect)((()=>()=>window.clearTimeout(a.current)),[]),(0,x.jsx)("button",{type:"button","aria-label":s?(0,_.T)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,_.T)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,_.T)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,c.A)("clean-btn",n,I.copyButton,s&&I.copyButtonCopied),onClick:l,children:(0,x.jsxs)("span",{className:I.copyButtonIcons,"aria-hidden":"true",children:[(0,x.jsx)(S,{className:I.copyButtonIcon}),(0,x.jsx)(T,{className:I.copyButtonSuccessIcon})]})})}function W(e){return(0,x.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,x.jsx)("path",{fill:"currentColor",d:"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"})})}const M={wordWrapButtonIcon:"wordWrapButtonIcon_Bwma",wordWrapButtonEnabled:"wordWrapButtonEnabled_EoeP"};function H(e){let{className:t,onClick:n,isEnabled:o}=e;const s=(0,_.T)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return(0,x.jsx)("button",{type:"button",onClick:n,className:(0,c.A)("clean-btn",t,o&&M.wordWrapButtonEnabled),"aria-label":s,title:s,children:(0,x.jsx)(W,{className:M.wordWrapButtonIcon,"aria-hidden":"true"})})}function R(e){let{children:t,className:n="",metastring:s,title:r,showLineNumbers:i,language:u}=e;const{prism:{defaultLanguage:d,magicComments:p}}=(0,a.p)(),b=function(e){return e?.toLowerCase()}(u??function(e){const t=e.split(" ").find((e=>e.startsWith("language-")));return t?.replace(/language-/,"")}(n)??d),f=l(),h=function(){const[e,t]=(0,o.useState)(!1),[n,s]=(0,o.useState)(!1),c=(0,o.useRef)(null),r=(0,o.useCallback)((()=>{const n=c.current.querySelector("code");e?n.removeAttribute("style"):(n.style.whiteSpace="pre-wrap",n.style.overflowWrap="anywhere"),t((e=>!e))}),[c,e]),a=(0,o.useCallback)((()=>{const{scrollWidth:e,clientWidth:t}=c.current,n=e>t||c.current.querySelector("code").hasAttribute("style");s(n)}),[c]);return w(c,a),(0,o.useEffect)((()=>{a()}),[e,a]),(0,o.useEffect)((()=>(window.addEventListener("resize",a,{passive:!0}),()=>{window.removeEventListener("resize",a)})),[a]),{codeBlockRef:c,isEnabled:e,isCodeScrollable:n,toggle:r}}(),g=function(e){return e?.match(m)?.groups.title??""}(s)||r,{lineClassNames:B,code:v}=k(t,{metastring:s,language:b,magicComments:p}),C=i??function(e){return Boolean(e?.includes("showLineNumbers"))}(s);return(0,x.jsxs)(j,{as:"div",className:(0,c.A)(n,b&&!n.includes(`language-${b}`)&&`language-${b}`),children:[g&&(0,x.jsx)("div",{className:y.codeBlockTitle,children:g}),(0,x.jsxs)("div",{className:y.codeBlockContent,children:[(0,x.jsx)(E.f4,{theme:f,code:v,language:b??"text",children:e=>{let{className:t,style:n,tokens:o,getLineProps:s,getTokenProps:r}=e;return(0,x.jsx)("pre",{tabIndex:0,ref:h.codeBlockRef,className:(0,c.A)(t,y.codeBlock,"thin-scrollbar"),style:n,children:(0,x.jsx)("code",{className:(0,c.A)(y.codeBlockLines,C&&y.codeBlockLinesWithNumbering),children:o.map(((e,t)=>(0,x.jsx)(A,{line:e,getLineProps:s,getTokenProps:r,classNames:B[t],showLineNumbers:C},t)))})})}}),(0,x.jsxs)("div",{className:y.buttonGroup,children:[(h.isEnabled||h.isCodeScrollable)&&(0,x.jsx)(H,{className:y.codeButton,onClick:()=>h.toggle(),isEnabled:h.isEnabled}),(0,x.jsx)($,{className:y.codeButton,code:v})]})]})]})}function V(e){let{children:t,...n}=e;const c=(0,s.A)(),r=function(e){return o.Children.toArray(e).some((e=>(0,o.isValidElement)(e)))?e:Array.isArray(e)?e.join(""):e}(t),a="string"==typeof r?R:v;return(0,x.jsx)(a,{...n,children:r},String(c))}},8426:(e,t)=>{function n(e){let t,n=[];for(let o of e.split(",").map((e=>e.trim())))if(/^-?\d+$/.test(o))n.push(parseInt(o,10));else if(t=o.match(/^(-?\d+)(-|\.\.\.?|\u2025|\u2026|\u22EF)(-?\d+)$/)){let[e,o,s,c]=t;if(o&&c){o=parseInt(o),c=parseInt(c);const e=o {"use strict";n.d(t,{R:()=>r,x:()=>a});var o=n(6540);const s={},c=o.createContext(s);function r(e){const t=o.useContext(c);return o.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),o.createElement(c.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/540.b78022b2.js b/assets/js/540.b78022b2.js new file mode 100644 index 00000000..13a6e34b --- /dev/null +++ b/assets/js/540.b78022b2.js @@ -0,0 +1,2 @@ +/*! For license information please see 540.b78022b2.js.LICENSE.txt */ +(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[540],{540:(e,t,r)=>{"use strict";const n=Symbol("Comlink.proxy"),i=Symbol("Comlink.endpoint"),s=Symbol("Comlink.releaseProxy"),o=Symbol("Comlink.finalizer"),a=Symbol("Comlink.thrown"),u=e=>"object"==typeof e&&null!==e||"function"==typeof e,l={canHandle:e=>u(e)&&e[n],serialize(e){const{port1:t,port2:r}=new MessageChannel;return h(e,t),[r,[r]]},deserialize:e=>(e.start(),function(e,t){const r=new Map;return e.addEventListener("message",(function(e){const{data:t}=e;if(!t||!t.id)return;const n=r.get(t.id);if(n)try{n(t)}finally{r.delete(t.id)}})),g(e,r,[],t)}(e))},c=new Map([["proxy",l],["throw",{canHandle:e=>u(e)&&a in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function h(e,t=globalThis,r=["*"]){t.addEventListener("message",(function i(s){if(!s||!s.data)return;if(!function(e,t){for(const r of e){if(t===r||"*"===r)return!0;if(r instanceof RegExp&&r.test(t))return!0}return!1}(r,s.origin))return void console.warn(`Invalid origin '${s.origin}' for comlink proxy`);const{id:u,type:l,path:c}=Object.assign({path:[]},s.data),f=(s.data.argumentList||[]).map(E);let p;try{const t=c.slice(0,-1).reduce(((e,t)=>e[t]),e),r=c.reduce(((e,t)=>e[t]),e);switch(l){case"GET":p=r;break;case"SET":t[c.slice(-1)[0]]=E(s.data.value),p=!0;break;case"APPLY":p=r.apply(t,f);break;case"CONSTRUCT":p=function(e){return Object.assign(e,{[n]:!0})}(new r(...f));break;case"ENDPOINT":{const{port1:t,port2:r}=new MessageChannel;h(e,r),p=function(e,t){return v.set(e,t),e}(t,[t])}break;case"RELEASE":p=void 0;break;default:return}}catch(y){p={value:y,[a]:0}}Promise.resolve(p).catch((e=>({value:e,[a]:0}))).then((r=>{const[n,s]=w(r);t.postMessage(Object.assign(Object.assign({},n),{id:u}),s),"RELEASE"===l&&(t.removeEventListener("message",i),d(t),o in e&&"function"==typeof e[o]&&e[o]())})).catch((e=>{const[r,n]=w({value:new TypeError("Unserializable return value"),[a]:0});t.postMessage(Object.assign(Object.assign({},r),{id:u}),n)}))})),t.start&&t.start()}function d(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function f(e){if(e)throw new Error("Proxy has been released and is not useable")}function p(e){return Q(e,new Map,{type:"RELEASE"}).then((()=>{d(e)}))}const y=new WeakMap,m="FinalizationRegistry"in globalThis&&new FinalizationRegistry((e=>{const t=(y.get(e)||0)-1;y.set(e,t),0===t&&p(e)}));function g(e,t,r=[],n=function(){}){let o=!1;const a=new Proxy(n,{get(n,i){if(f(o),i===s)return()=>{!function(e){m&&m.unregister(e)}(a),p(e),t.clear(),o=!0};if("then"===i){if(0===r.length)return{then:()=>a};const n=Q(e,t,{type:"GET",path:r.map((e=>e.toString()))}).then(E);return n.then.bind(n)}return g(e,t,[...r,i])},set(n,i,s){f(o);const[a,u]=w(s);return Q(e,t,{type:"SET",path:[...r,i].map((e=>e.toString())),value:a},u).then(E)},apply(n,s,a){f(o);const u=r[r.length-1];if(u===i)return Q(e,t,{type:"ENDPOINT"}).then(E);if("bind"===u)return g(e,t,r.slice(0,-1));const[l,c]=x(a);return Q(e,t,{type:"APPLY",path:r.map((e=>e.toString())),argumentList:l},c).then(E)},construct(n,i){f(o);const[s,a]=x(i);return Q(e,t,{type:"CONSTRUCT",path:r.map((e=>e.toString())),argumentList:s},a).then(E)}});return function(e,t){const r=(y.get(t)||0)+1;y.set(t,r),m&&m.register(e,t,e)}(a,e),a}function x(e){const t=e.map(w);return[t.map((e=>e[0])),(r=t.map((e=>e[1])),Array.prototype.concat.apply([],r))];var r}const v=new WeakMap;function w(e){for(const[t,r]of c)if(r.canHandle(e)){const[n,i]=r.serialize(e);return[{type:"HANDLER",name:t,value:n},i]}return[{type:"RAW",value:e},v.get(e)||[]]}function E(e){switch(e.type){case"HANDLER":return c.get(e.name).deserialize(e.value);case"RAW":return e.value}}function Q(e,t,r,n){return new Promise((i=>{const s=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");t.set(s,i),e.start&&e.start(),e.postMessage(Object.assign({id:s},r),n)}))}var k=r(8291),b=r.n(k),S=r(4809);const L=12;function T(e,t){const r=function(e,t){const r=e.map((e=>/\p{Unified_Ideograph}/u.test(e)?function(e,t){const r=[];return function e(n,i){let s=0,o=!1;for(const a of t)if(n.substr(0,a.length)===a){const t={missed:i.missed,term:i.term.concat({value:a})};n.length>a.length?e(n.substr(a.length),t):r.push(t),o=!0}else for(let t=a.length-1;t>s;t-=1){const u=a.substr(0,t);if(n.substr(0,t)===u){s=t;const a={missed:i.missed,term:i.term.concat({value:u,trailing:!0})};n.length>t?e(n.substr(t),a):r.push(a),o=!0;break}}o||(n.length>0?e(n.substr(1),{missed:i.missed+1,term:i.term}):i.term.length>0&&r.push(i))}(e,{missed:0,term:[]}),r.sort(((e,t)=>{const r=e.missed>0?1:0,n=t.missed>0?1:0;return r!==n?r-n:e.term.length-t.term.length})).map((e=>e.term))}(e,t):[{value:e}])).slice(0,L),n=r.filter((e=>e.length>1));let i=1,s=!1;for(const a of n)if(s)a.splice(1,a.length-1);else{a.length>6&&a.splice(6,a.length-6);const e=i*a.length;if(e>=L){if(e>L){const e=Math.floor(L/i);a.splice(e,a.length-e),i*=e}else i=e;i>6&&(s=!0)}else i=e}const o=[];return function e(t,n){if(t===r.length||n.length>=L)o.push(n.slice(0,L));else for(const i of r[t])e(t+1,n.concat(i))}(0,[]),o}(e,t);if(0===r.length)return[{tokens:e,term:e.map((e=>({value:e,presence:b().Query.presence.REQUIRED,wildcard:b().Query.wildcard.LEADING|b().Query.wildcard.TRAILING})))}];for(const o of r)o[o.length-1].maybeTyping=!0;const n=[];for(const o of S.BH)if("en"===o)S.sx||n.unshift(b().stopWordFilter);else{const e=b()[o];e.stopWordFilter&&n.unshift(e.stopWordFilter)}let i;if(n.length>0){const e=e=>n.reduce(((e,t)=>e.filter((e=>t(e.value)))),e);i=[];const t=[];for(const n of r){const r=e(n);i.push(r),r.length 0&&t.push(r)}r.push(...t)}else i=r.slice();const s=[];for(const o of i)if(o.length>2)for(let e=o.length-1;e>=0;e-=1)s.push(o.slice(0,e).concat(o.slice(e+1)));return P(r).concat(P(s))}function P(e){return I(e).concat(I(e.filter((e=>{const t=e[e.length-1];return!t.trailing&&t.maybeTyping})),!0))}function I(e,t){return e.map((e=>({tokens:e.map((e=>e.value)),term:e.map((e=>({value:e.value,presence:b().Query.presence.REQUIRED,wildcard:(t?e.trailing||e.maybeTyping:e.trailing)?b().Query.wildcard.TRAILING:b().Query.wildcard.NONE})))})))}var O;!function(e){e[e.Title=0]="Title",e[e.Heading=1]="Heading",e[e.Description=2]="Description",e[e.Keywords=3]="Keywords",e[e.Content=4]="Content"}(O||(O={}));const R=new Map;h(class{async fetchIndexes(e,t){await this.lowLevelFetchIndexes(e,t)}async lowLevelFetchIndexes(e,t){const r=`${e}${t}`;let n=R.get(r);return n||(n=async function(e,t){const r=`${e}${S.IH.replace("{dir}",t?`-${t.replace(/\//g,"-")}`:"")}`;if(new URL(r,location.origin).origin!==location.origin)throw new Error("Unexpected version url");const n=await(await fetch(r)).json(),i=n.map(((e,t)=>{let{documents:r,index:n}=e;return{type:t,documents:r,index:b().Index.load(n)}})),s=n.reduce(((e,t)=>{for(const r of t.index.invertedIndex)/\p{Unified_Ideograph}/u.test(r[0][0])&&e.add(r[0]);return e}),new Set);return{wrappedIndexes:i,zhDictionary:Array.from(s)}}(e,t),R.set(r,n)),n}async search(e,t,r){const n=function(e,t){if(1===t.length&&["ja","jp","th"].includes(t[0]))return b()[t[0]].tokenizer(e).map((e=>e.toString()));let r=/[^-\s]+/g;return t.includes("zh")&&(r=/\w+|\p{Unified_Ideograph}+/gu),e.toLowerCase().match(r)||[]}(r,S.BH);if(0===n.length)return[];const{wrappedIndexes:i,zhDictionary:s}=await this.lowLevelFetchIndexes(e,t),o=T(n,s),a=[];e:for(const{term:u,tokens:l}of o)for(const{documents:e,index:t,type:r}of i)if(a.push(...t.query((e=>{for(const t of u)e.term(t.value,{wildcard:t.wildcard,presence:t.presence})})).slice(0,S.AT).filter((e=>!a.some((t=>t.document.i.toString()===e.ref)))).slice(0,S.AT-a.length).map((t=>{const n=e.find((e=>e.i.toString()===t.ref));return{document:n,type:r,page:r!==O.Title&&i[0].documents.find((e=>e.i===n.p)),metadata:t.matchData.metadata,tokens:l,score:t.score}}))),a.length>=S.AT)break e;return function(e){e.forEach(((e,t)=>{e.index=t})),e.sort(((t,r)=>{let n=t.type!==O.Heading&&t.type!==O.Content&&t.type!==O.Description||!t.page?t.index:e.findIndex((e=>e.document===t.page)),i=r.type!==O.Heading&&r.type!==O.Content&&r.type!==O.Description||!r.page?r.index:e.findIndex((e=>e.document===r.page));if(-1===n&&(n=t.index),-1===i&&(i=r.index),n===i){const e=(0===r.type?1:0)-(0===t.type?1:0);return 0===e?t.index-r.index:e}return n-i}))}(a),function(e){e.forEach(((t,r)=>{r>0&&t.page&&e.slice(0,r).some((e=>(e.type===O.Keywords?e.page:e.document)===t.page))&&(r {var n,i;!function(){var s,o,a,u,l,c,h,d,f,p,y,m,g,x,v,w,E,Q,k,b,S,L,T,P,I,O,R,C,F,N,j=function(e){var t=new j.Builder;return t.pipeline.add(j.trimmer,j.stopWordFilter,j.stemmer),t.searchPipeline.add(j.stemmer),e.call(t,t),t.build()};j.version="2.3.9",j.utils={},j.utils.warn=(s=this,function(e){s.console&&console.warn&&console.warn(e)}),j.utils.asString=function(e){return null==e?"":e.toString()},j.utils.clone=function(e){if(null==e)return e;for(var t=Object.create(null),r=Object.keys(e),n=0;n 0){var u=j.utils.clone(t)||{};u.position=[o,a],u.index=i.length,i.push(new j.Token(r.slice(o,s),u))}o=s+1}}return i},j.tokenizer.separator=/[\s\-]+/,j.Pipeline=function(){this._stack=[]},j.Pipeline.registeredFunctions=Object.create(null),j.Pipeline.registerFunction=function(e,t){t in this.registeredFunctions&&j.utils.warn("Overwriting existing registered function: "+t),e.label=t,j.Pipeline.registeredFunctions[e.label]=e},j.Pipeline.warnIfFunctionNotRegistered=function(e){e.label&&e.label in this.registeredFunctions||j.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},j.Pipeline.load=function(e){var t=new j.Pipeline;return e.forEach((function(e){var r=j.Pipeline.registeredFunctions[e];if(!r)throw new Error("Cannot load unregistered function: "+e);t.add(r)})),t},j.Pipeline.prototype.add=function(){Array.prototype.slice.call(arguments).forEach((function(e){j.Pipeline.warnIfFunctionNotRegistered(e),this._stack.push(e)}),this)},j.Pipeline.prototype.after=function(e,t){j.Pipeline.warnIfFunctionNotRegistered(t);var r=this._stack.indexOf(e);if(-1==r)throw new Error("Cannot find existingFn");r+=1,this._stack.splice(r,0,t)},j.Pipeline.prototype.before=function(e,t){j.Pipeline.warnIfFunctionNotRegistered(t);var r=this._stack.indexOf(e);if(-1==r)throw new Error("Cannot find existingFn");this._stack.splice(r,0,t)},j.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);-1!=t&&this._stack.splice(t,1)},j.Pipeline.prototype.run=function(e){for(var t=this._stack.length,r=0;r 1&&(s e&&(r=i),s!=e);)n=r-t,i=t+Math.floor(n/2),s=this.elements[2*i];return s==e||s>e?2*i:s a?l+=2:o==a&&(t+=r[u+1]*n[l+1],u+=2,l+=2);return t},j.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},j.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),t=1,r=0;t 0){var s,o=i.str.charAt(0);o in i.node.edges?s=i.node.edges[o]:(s=new j.TokenSet,i.node.edges[o]=s),1==i.str.length&&(s.final=!0),n.push({node:s,editsRemaining:i.editsRemaining,str:i.str.slice(1)})}if(0!=i.editsRemaining){if("*"in i.node.edges)var a=i.node.edges["*"];else{a=new j.TokenSet;i.node.edges["*"]=a}if(0==i.str.length&&(a.final=!0),n.push({node:a,editsRemaining:i.editsRemaining-1,str:i.str}),i.str.length>1&&n.push({node:i.node,editsRemaining:i.editsRemaining-1,str:i.str.slice(1)}),1==i.str.length&&(i.node.final=!0),i.str.length>=1){if("*"in i.node.edges)var u=i.node.edges["*"];else{u=new j.TokenSet;i.node.edges["*"]=u}1==i.str.length&&(u.final=!0),n.push({node:u,editsRemaining:i.editsRemaining-1,str:i.str.slice(1)})}if(i.str.length>1){var l,c=i.str.charAt(0),h=i.str.charAt(1);h in i.node.edges?l=i.node.edges[h]:(l=new j.TokenSet,i.node.edges[h]=l),1==i.str.length&&(l.final=!0),n.push({node:l,editsRemaining:i.editsRemaining-1,str:c+i.str.slice(2)})}}}return r},j.TokenSet.fromString=function(e){for(var t=new j.TokenSet,r=t,n=0,i=e.length;n=e;t--){var r=this.uncheckedNodes[t],n=r.child.toString();n in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[n]:(r.child._str=n,this.minimizedNodes[n]=r.child),this.uncheckedNodes.pop()}},j.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},j.Index.prototype.search=function(e){return this.query((function(t){new j.QueryParser(e,t).parse()}))},j.Index.prototype.query=function(e){for(var t=new j.Query(this.fields),r=Object.create(null),n=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=0;a 1?1:e},j.Builder.prototype.k1=function(e){this._k1=e},j.Builder.prototype.add=function(e,t){var r=e[this._ref],n=Object.keys(this._fields);this._documents[r]=t||{},this.documentCount+=1;for(var i=0;i =this.length)return j.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},j.QueryLexer.prototype.width=function(){return this.pos-this.start},j.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},j.QueryLexer.prototype.backup=function(){this.pos-=1},j.QueryLexer.prototype.acceptDigitRun=function(){var e,t;do{t=(e=this.next()).charCodeAt(0)}while(t>47&&t<58);e!=j.QueryLexer.EOS&&this.backup()},j.QueryLexer.prototype.more=function(){return this.pos 1&&(e.backup(),e.emit(j.QueryLexer.TERM)),e.ignore(),e.more())return j.QueryLexer.lexText},j.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(j.QueryLexer.EDIT_DISTANCE),j.QueryLexer.lexText},j.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(j.QueryLexer.BOOST),j.QueryLexer.lexText},j.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(j.QueryLexer.TERM)},j.QueryLexer.termSeparator=j.tokenizer.separator,j.QueryLexer.lexText=function(e){for(;;){var t=e.next();if(t==j.QueryLexer.EOS)return j.QueryLexer.lexEOS;if(92!=t.charCodeAt(0)){if(":"==t)return j.QueryLexer.lexField;if("~"==t)return e.backup(),e.width()>0&&e.emit(j.QueryLexer.TERM),j.QueryLexer.lexEditDistance;if("^"==t)return e.backup(),e.width()>0&&e.emit(j.QueryLexer.TERM),j.QueryLexer.lexBoost;if("+"==t&&1===e.width())return e.emit(j.QueryLexer.PRESENCE),j.QueryLexer.lexText;if("-"==t&&1===e.width())return e.emit(j.QueryLexer.PRESENCE),j.QueryLexer.lexText;if(t.match(j.QueryLexer.termSeparator))return j.QueryLexer.lexTerm}else e.escapeCharacter()}},j.QueryParser=function(e,t){this.lexer=new j.QueryLexer(e),this.query=t,this.currentClause={},this.lexemeIdx=0},j.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=j.QueryParser.parseClause;e;)e=e(this);return this.query},j.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},j.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},j.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},j.QueryParser.parseClause=function(e){var t=e.peekLexeme();if(null!=t)switch(t.type){case j.QueryLexer.PRESENCE:return j.QueryParser.parsePresence;case j.QueryLexer.FIELD:return j.QueryParser.parseField;case j.QueryLexer.TERM:return j.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+t.type;throw t.str.length>=1&&(r+=" with value '"+t.str+"'"),new j.QueryParseError(r,t.start,t.end)}},j.QueryParser.parsePresence=function(e){var t=e.consumeLexeme();if(null!=t){switch(t.str){case"-":e.currentClause.presence=j.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=j.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+t.str+"'";throw new j.QueryParseError(r,t.start,t.end)}var n=e.peekLexeme();if(null==n){r="expecting term or field, found nothing";throw new j.QueryParseError(r,t.start,t.end)}switch(n.type){case j.QueryLexer.FIELD:return j.QueryParser.parseField;case j.QueryLexer.TERM:return j.QueryParser.parseTerm;default:r="expecting term or field, found '"+n.type+"'";throw new j.QueryParseError(r,n.start,n.end)}}},j.QueryParser.parseField=function(e){var t=e.consumeLexeme();if(null!=t){if(-1==e.query.allFields.indexOf(t.str)){var r=e.query.allFields.map((function(e){return"'"+e+"'"})).join(", "),n="unrecognised field '"+t.str+"', possible fields: "+r;throw new j.QueryParseError(n,t.start,t.end)}e.currentClause.fields=[t.str];var i=e.peekLexeme();if(null==i){n="expecting term, found nothing";throw new j.QueryParseError(n,t.start,t.end)}if(i.type===j.QueryLexer.TERM)return j.QueryParser.parseTerm;n="expecting term, found '"+i.type+"'";throw new j.QueryParseError(n,i.start,i.end)}},j.QueryParser.parseTerm=function(e){var t=e.consumeLexeme();if(null!=t){e.currentClause.term=t.str.toLowerCase(),-1!=t.str.indexOf("*")&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(null!=r)switch(r.type){case j.QueryLexer.TERM:return e.nextClause(),j.QueryParser.parseTerm;case j.QueryLexer.FIELD:return e.nextClause(),j.QueryParser.parseField;case j.QueryLexer.EDIT_DISTANCE:return j.QueryParser.parseEditDistance;case j.QueryLexer.BOOST:return j.QueryParser.parseBoost;case j.QueryLexer.PRESENCE:return e.nextClause(),j.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+r.type+"'";throw new j.QueryParseError(n,r.start,r.end)}else e.nextClause()}},j.QueryParser.parseEditDistance=function(e){var t=e.consumeLexeme();if(null!=t){var r=parseInt(t.str,10);if(isNaN(r)){var n="edit distance must be numeric";throw new j.QueryParseError(n,t.start,t.end)}e.currentClause.editDistance=r;var i=e.peekLexeme();if(null!=i)switch(i.type){case j.QueryLexer.TERM:return e.nextClause(),j.QueryParser.parseTerm;case j.QueryLexer.FIELD:return e.nextClause(),j.QueryParser.parseField;case j.QueryLexer.EDIT_DISTANCE:return j.QueryParser.parseEditDistance;case j.QueryLexer.BOOST:return j.QueryParser.parseBoost;case j.QueryLexer.PRESENCE:return e.nextClause(),j.QueryParser.parsePresence;default:n="Unexpected lexeme type '"+i.type+"'";throw new j.QueryParseError(n,i.start,i.end)}else e.nextClause()}},j.QueryParser.parseBoost=function(e){var t=e.consumeLexeme();if(null!=t){var r=parseInt(t.str,10);if(isNaN(r)){var n="boost must be numeric";throw new j.QueryParseError(n,t.start,t.end)}e.currentClause.boost=r;var i=e.peekLexeme();if(null!=i)switch(i.type){case j.QueryLexer.TERM:return e.nextClause(),j.QueryParser.parseTerm;case j.QueryLexer.FIELD:return e.nextClause(),j.QueryParser.parseField;case j.QueryLexer.EDIT_DISTANCE:return j.QueryParser.parseEditDistance;case j.QueryLexer.BOOST:return j.QueryParser.parseBoost;case j.QueryLexer.PRESENCE:return e.nextClause(),j.QueryParser.parsePresence;default:n="Unexpected lexeme type '"+i.type+"'";throw new j.QueryParseError(n,i.start,i.end)}else e.nextClause()}},void 0===(i="function"==typeof(n=function(){return j})?n.call(t,r,t,e):n)||(e.exports=i)}()}}]); \ No newline at end of file diff --git a/assets/js/4491.82a2b9c4.js.LICENSE.txt b/assets/js/540.b78022b2.js.LICENSE.txt similarity index 100% rename from assets/js/4491.82a2b9c4.js.LICENSE.txt rename to assets/js/540.b78022b2.js.LICENSE.txt diff --git a/assets/js/5582.fb876156.js b/assets/js/5582.fb876156.js deleted file mode 100644 index 3e278077..00000000 --- a/assets/js/5582.fb876156.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[5582],{9101:(e,t,a)=>{a.d(t,{in:()=>c,OU:()=>y,Ki:()=>_,kJ:()=>p,x:()=>i,e7:()=>m,J_:()=>f,Gx:()=>k});var s=a(6540),n=a(4799),r=a(3512),l=a(4848);function i(){const e=(0,r.A)(),t=e?.data?.blogMetadata;if(!t)throw new Error("useBlogMetadata() can't be called on the current route because the blog metadata could not be found in route context");return t}const o=s.createContext(null);function c(e){let{children:t,content:a,isBlogPostPage:n=!1}=e;const r=function(e){let{content:t,isBlogPostPage:a}=e;return(0,s.useMemo)((()=>({metadata:t.metadata,frontMatter:t.frontMatter,assets:t.assets,toc:t.toc,isBlogPostPage:a})),[t,a])}({content:a,isBlogPostPage:n});return(0,l.jsx)(o.Provider,{value:r,children:t})}function m(){const e=(0,s.useContext)(o);if(null===e)throw new n.dV("BlogPostProvider");return e}var u=a(8180),d=a(7639);const h=e=>new Date(e).toISOString();function g(e){const t=e.map(j);return{author:1===t.length?t[0]:t}}function x(e,t,a){return e?{image:v({imageUrl:t(e,{absolute:!0}),caption:`title image for the blog post: ${a}`})}:{}}function p(e){const{siteConfig:t}=(0,d.A)(),{withBaseUrl:a}=(0,u.hH)(),{metadata:{blogDescription:s,blogTitle:n,permalink:r}}=e,l=`${t.url}${r}`;return{"@context":"https://schema.org","@type":"Blog","@id":l,mainEntityOfPage:l,headline:n,description:s,blogPost:e.items.map((e=>function(e,t,a){const{assets:s,frontMatter:n,metadata:r}=e,{date:l,title:i,description:o,lastUpdatedAt:c}=r,m=s.image??n.image,u=n.keywords??[],d=`${t.url}${r.permalink}`,p=c?h(c):void 0;return{"@type":"BlogPosting","@id":d,mainEntityOfPage:d,url:d,headline:i,name:i,description:o,datePublished:l,...p?{dateModified:p}:{},...g(r.authors),...x(m,a,i),...u?{keywords:u}:{}}}(e.content,t,a)))}}function f(){const e=i(),{assets:t,metadata:a}=m(),{siteConfig:s}=(0,d.A)(),{withBaseUrl:n}=(0,u.hH)(),{date:r,title:l,description:o,frontMatter:c,lastUpdatedAt:p}=a,f=t.image??c.image,j=c.keywords??[],v=p?h(p):void 0,b=`${s.url}${a.permalink}`;return{"@context":"https://schema.org","@type":"BlogPosting","@id":b,mainEntityOfPage:b,url:b,headline:l,name:l,description:o,datePublished:r,...v?{dateModified:v}:{},...g(a.authors),...x(f,n,l),...j?{keywords:j}:{},isPartOf:{"@type":"Blog","@id":`${s.url}${e.blogBasePath}`,name:e.blogTitle}}}function j(e){return{"@type":"Person",...e.name?{name:e.name}:{},...e.title?{description:e.title}:{},...e.url?{url:e.url}:{},...e.email?{email:e.email}:{},...e.imageURL?{image:e.imageURL}:{}}}function v(e){let{imageUrl:t,caption:a}=e;return{"@type":"ImageObject","@id":t,url:t,contentUrl:t,caption:a}}var b=a(6347),w=a(4783),N=a(5167),A=a(260);function k(e){const{pathname:t}=(0,b.zy)();return(0,s.useMemo)((()=>e.filter((e=>function(e,t){return!(e.unlisted&&!(0,A.ys)(e.permalink,t))}(e,t)))),[e,t])}function _(e){const t=(0,N.$z)(e,(e=>`${new Date(e.date).getFullYear()}`)),a=Object.entries(t);return a.reverse(),a}function y(e){let{items:t,ulClassName:a,liClassName:s,linkClassName:n,linkActiveClassName:r}=e;return(0,l.jsx)("ul",{className:a,children:t.map((e=>(0,l.jsx)("li",{className:s,children:(0,l.jsx)(w.A,{isNavLink:!0,to:e.permalink,className:n,activeClassName:r,children:e.title})},e.permalink)))})}},6953:(e,t,a)=>{a.d(t,{A:()=>I});var s=a(6540),n=a(4164),r=a(7635),l=a(2216),i=a(3230),o=a(9101),c=a(6957),m=a(5225),u=a(4848);function d(e){let{year:t,yearGroupHeadingClassName:a,children:s}=e;return(0,u.jsxs)("div",{role:"group",children:[(0,u.jsx)(m.A,{as:"h3",className:a,children:t}),s]})}function h(e){let{items:t,yearGroupHeadingClassName:a,ListComponent:s}=e;if((0,c.p)().blog.sidebar.groupByYear){const e=(0,o.Ki)(t);return(0,u.jsx)(u.Fragment,{children:e.map((e=>{let[t,n]=e;return(0,u.jsx)(d,{year:t,yearGroupHeadingClassName:a,children:(0,u.jsx)(s,{items:n})},t)}))})}return(0,u.jsx)(s,{items:t})}const g=(0,s.memo)(h),x="sidebar_re4s",p="sidebarItemTitle_pO2u",f="sidebarItemList_Yudw",j="sidebarItem__DBe",v="sidebarItemLink_mo7H",b="sidebarItemLinkActive_I1ZP",w="yearGroupHeading_rMGB",N=e=>{let{items:t}=e;return(0,u.jsx)(o.OU,{items:t,ulClassName:(0,n.A)(f,"clean-list"),liClassName:j,linkClassName:v,linkActiveClassName:b})};function A(e){let{sidebar:t}=e;const a=(0,o.Gx)(t.items);return(0,u.jsx)("aside",{className:"col col--3",children:(0,u.jsxs)("nav",{className:(0,n.A)(x,"thin-scrollbar"),"aria-label":(0,i.T)({id:"theme.blog.sidebar.navAriaLabel",message:"Blog recent posts navigation",description:"The ARIA label for recent posts in the blog sidebar"}),children:[(0,u.jsx)("div",{className:(0,n.A)(p,"margin-bottom--md"),children:t.title}),(0,u.jsx)(g,{items:a,ListComponent:N,yearGroupHeadingClassName:w})]})})}const k=(0,s.memo)(A);var _=a(763);const y="yearGroupHeading_QT03",M=e=>{let{items:t}=e;return(0,u.jsx)(o.OU,{items:t,ulClassName:"menu__list",liClassName:"menu__list-item",linkClassName:"menu__link",linkActiveClassName:"menu__link--active"})};function C(e){let{sidebar:t}=e;const a=(0,o.Gx)(t.items);return(0,u.jsx)(g,{items:a,ListComponent:M,yearGroupHeadingClassName:y})}function P(e){return(0,u.jsx)(_.GX,{component:C,props:e})}const B=(0,s.memo)(P);function L(e){let{sidebar:t}=e;const a=(0,l.l)();return t?.items.length?"mobile"===a?(0,u.jsx)(B,{sidebar:t}):(0,u.jsx)(k,{sidebar:t}):null}function I(e){const{sidebar:t,toc:a,children:s,...l}=e,i=t&&t.items.length>0;return(0,u.jsx)(r.A,{...l,children:(0,u.jsx)("div",{className:"container margin-vert--lg",children:(0,u.jsxs)("div",{className:"row",children:[(0,u.jsx)(L,{sidebar:t}),(0,u.jsx)("main",{className:(0,n.A)("col",{"col--7":i,"col--9 col--offset-1":!i}),children:s}),a&&(0,u.jsx)("div",{className:"col col--2",children:a})]})})})}},8406:(e,t,a)=>{a.d(t,{A:()=>z});a(6540);var s=a(4164),n=a(9101),r=a(4848);function l(e){let{children:t,className:a}=e;return(0,r.jsx)("article",{className:a,children:t})}var i=a(4783);const o={title:"title_f1Hy"};function c(e){let{className:t}=e;const{metadata:a,isBlogPostPage:l}=(0,n.e7)(),{permalink:c,title:m}=a,u=l?"h1":"h2";return(0,r.jsx)(u,{className:(0,s.A)(o.title,t),children:l?m:(0,r.jsx)(i.A,{to:c,children:m})})}var m=a(3230),u=a(7824),d=a(9191);const h={container:"container_mt6G"};function g(e){let{readingTime:t}=e;const a=function(){const{selectMessage:e}=(0,u.W)();return t=>{const a=Math.ceil(t);return e(a,(0,m.T)({id:"theme.blog.post.readingTime.plurals",description:'Pluralized label for "{readingTime} min read". Use as much plural forms (separated by "|") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)',message:"One min read|{readingTime} min read"},{readingTime:a}))}}();return(0,r.jsx)(r.Fragment,{children:a(t)})}function x(e){let{date:t,formattedDate:a}=e;return(0,r.jsx)("time",{dateTime:t,children:a})}function p(){return(0,r.jsx)(r.Fragment,{children:" \xb7 "})}function f(e){let{className:t}=e;const{metadata:a}=(0,n.e7)(),{date:l,readingTime:i}=a,o=(0,d.i)({day:"numeric",month:"long",year:"numeric",timeZone:"UTC"});return(0,r.jsxs)("div",{className:(0,s.A)(h.container,"margin-vert--md",t),children:[(0,r.jsx)(x,{date:l,formattedDate:(c=l,o.format(new Date(c)))}),void 0!==i&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p,{}),(0,r.jsx)(g,{readingTime:i})]})]});var c}const j="githubSvg_Uu4N";const v="xSvg_y3PF";const b=function(e){return(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[(0,r.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,r.jsx)("path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0"}),(0,r.jsx)("path",{d:"M3.6 9h16.8"}),(0,r.jsx)("path",{d:"M3.6 15h16.8"}),(0,r.jsx)("path",{d:"M11.5 3a17 17 0 0 0 0 18"}),(0,r.jsx)("path",{d:"M12.5 3a17 17 0 0 1 0 18"})]})},w={authorSocials:"authorSocials_rSDt",authorSocialLink:"authorSocialLink_owbf",authorSocialIcon:"authorSocialIcon_XYv3"},N={twitter:{Icon:function(e){return(0,r.jsx)("svg",{viewBox:"0 0 256 209",width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid",...e,children:(0,r.jsx)("path",{d:"M256 25.45c-9.42 4.177-19.542 7-30.166 8.27 10.845-6.5 19.172-16.793 23.093-29.057a105.183 105.183 0 0 1-33.351 12.745C205.995 7.201 192.346.822 177.239.822c-29.006 0-52.523 23.516-52.523 52.52 0 4.117.465 8.125 1.36 11.97-43.65-2.191-82.35-23.1-108.255-54.876-4.52 7.757-7.11 16.78-7.11 26.404 0 18.222 9.273 34.297 23.365 43.716a52.312 52.312 0 0 1-23.79-6.57c-.003.22-.003.44-.003.661 0 25.447 18.104 46.675 42.13 51.5a52.592 52.592 0 0 1-23.718.9c6.683 20.866 26.08 36.05 49.062 36.475-17.975 14.086-40.622 22.483-65.228 22.483-4.24 0-8.42-.249-12.529-.734 23.243 14.902 50.85 23.597 80.51 23.597 96.607 0 149.434-80.031 149.434-149.435 0-2.278-.05-4.543-.152-6.795A106.748 106.748 0 0 0 256 25.45",fill:"#55acee"})})},label:"Twitter"},github:{Icon:function(e){return(0,r.jsx)("svg",{viewBox:"0 0 256 250",width:"1em",height:"1em",...e,className:(0,s.A)(e.className,j),xmlns:"http://www.w3.org/2000/svg",style:{"--dark":"#000","--light":"#fff"},preserveAspectRatio:"xMidYMid",children:(0,r.jsx)("path",{d:"M128.001 0C57.317 0 0 57.307 0 128.001c0 56.554 36.676 104.535 87.535 121.46 6.397 1.185 8.746-2.777 8.746-6.158 0-3.052-.12-13.135-.174-23.83-35.61 7.742-43.124-15.103-43.124-15.103-5.823-14.795-14.213-18.73-14.213-18.73-11.613-7.944.876-7.78.876-7.78 12.853.902 19.621 13.19 19.621 13.19 11.417 19.568 29.945 13.911 37.249 10.64 1.149-8.272 4.466-13.92 8.127-17.116-28.431-3.236-58.318-14.212-58.318-63.258 0-13.975 5-25.394 13.188-34.358-1.329-3.224-5.71-16.242 1.24-33.874 0 0 10.749-3.44 35.21 13.121 10.21-2.836 21.16-4.258 32.038-4.307 10.878.049 21.837 1.47 32.066 4.307 24.431-16.56 35.165-13.12 35.165-13.12 6.967 17.63 2.584 30.65 1.255 33.873 8.207 8.964 13.173 20.383 13.173 34.358 0 49.163-29.944 59.988-58.447 63.157 4.591 3.972 8.682 11.762 8.682 23.704 0 17.126-.148 30.91-.148 35.126 0 3.407 2.304 7.398 8.792 6.14C219.37 232.5 256 184.537 256 128.002 256 57.307 198.691 0 128.001 0Zm-80.06 182.34c-.282.636-1.283.827-2.194.39-.929-.417-1.45-1.284-1.15-1.922.276-.655 1.279-.838 2.205-.399.93.418 1.46 1.293 1.139 1.931Zm6.296 5.618c-.61.566-1.804.303-2.614-.591-.837-.892-.994-2.086-.375-2.66.63-.566 1.787-.301 2.626.591.838.903 1 2.088.363 2.66Zm4.32 7.188c-.785.545-2.067.034-2.86-1.104-.784-1.138-.784-2.503.017-3.05.795-.547 2.058-.055 2.861 1.075.782 1.157.782 2.522-.019 3.08Zm7.304 8.325c-.701.774-2.196.566-3.29-.49-1.119-1.032-1.43-2.496-.726-3.27.71-.776 2.213-.558 3.315.49 1.11 1.03 1.45 2.505.701 3.27Zm9.442 2.81c-.31 1.003-1.75 1.459-3.199 1.033-1.448-.439-2.395-1.613-2.103-2.626.301-1.01 1.747-1.484 3.207-1.028 1.446.436 2.396 1.602 2.095 2.622Zm10.744 1.193c.036 1.055-1.193 1.93-2.715 1.95-1.53.034-2.769-.82-2.786-1.86 0-1.065 1.202-1.932 2.733-1.958 1.522-.03 2.768.818 2.768 1.868Zm10.555-.405c.182 1.03-.875 2.088-2.387 2.37-1.485.271-2.861-.365-3.05-1.386-.184-1.056.893-2.114 2.376-2.387 1.514-.263 2.868.356 3.061 1.403Z"})})},label:"GitHub"},stackoverflow:{Icon:function(e){return(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 169.61 200",width:"1em",height:"1em",...e,children:[(0,r.jsx)("path",{d:"M140.44 178.38v-48.65h21.61V200H0v-70.27h21.61v48.65z",fill:"#bcbbbb"}),(0,r.jsx)("path",{d:"M124.24 140.54l4.32-16.22-86.97-17.83-3.78 17.83zM49.7 82.16L130.72 120l7.56-16.22-81.02-37.83zm22.68-40l68.06 57.3 11.35-13.51-68.6-57.3-11.35 13.51zM116.14 0l-14.59 10.81 53.48 71.89 14.58-10.81zM37.81 162.16h86.43v-16.21H37.81z",fill:"#f48024"})]})},label:"Stack Overflow"},linkedin:{Icon:function(e){return(0,r.jsx)("svg",{width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid",viewBox:"0 0 256 256",...e,children:(0,r.jsx)("path",{d:"M218.123 218.127h-37.931v-59.403c0-14.165-.253-32.4-19.728-32.4-19.756 0-22.779 15.434-22.779 31.369v60.43h-37.93V95.967h36.413v16.694h.51a39.907 39.907 0 0 1 35.928-19.733c38.445 0 45.533 25.288 45.533 58.186l-.016 67.013ZM56.955 79.27c-12.157.002-22.014-9.852-22.016-22.009-.002-12.157 9.851-22.014 22.008-22.016 12.157-.003 22.014 9.851 22.016 22.008A22.013 22.013 0 0 1 56.955 79.27m18.966 138.858H37.95V95.967h37.97v122.16ZM237.033.018H18.89C8.58-.098.125 8.161-.001 18.471v219.053c.122 10.315 8.576 18.582 18.89 18.474h218.144c10.336.128 18.823-8.139 18.966-18.474V18.454c-.147-10.33-8.635-18.588-18.966-18.453",fill:"#0A66C2"})})},label:"LinkedIn"},x:{Icon:function(e){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 1200 1227",...e,className:(0,s.A)(e.className,v),style:{"--dark":"#000","--light":"#fff"},children:(0,r.jsx)("path",{d:"M714.163 519.284 1160.89 0h-105.86L667.137 450.887 357.328 0H0l468.492 681.821L0 1226.37h105.866l409.625-476.152 327.181 476.152H1200L714.137 519.284h.026ZM569.165 687.828l-47.468-67.894-377.686-540.24h162.604l304.797 435.991 47.468 67.894 396.2 566.721H892.476L569.165 687.854v-.026Z"})})},label:"X"}};function A(e){let{platform:t,link:a}=e;const{Icon:n,label:l}=N[o=t]??{Icon:b,label:o};var o;return(0,r.jsx)(i.A,{className:w.authorSocialLink,href:a,title:l,children:(0,r.jsx)(n,{className:(0,s.A)(w.authorSocialLink)})})}function k(e){let{author:t}=e;const a=Object.entries(t.socials??{});return(0,r.jsx)("div",{className:w.authorSocials,children:a.map((e=>{let[t,a]=e;return(0,r.jsx)(A,{platform:t,link:a},t)}))})}var _=a(5225);const y={authorImage:"authorImage_XqGP","author-as-h1":"author-as-h1_n9oJ","author-as-h2":"author-as-h2_gXvM",authorDetails:"authorDetails_lV9A",authorName:"authorName_yefp",authorTitle:"authorTitle_nd0D",authorBlogPostCount:"authorBlogPostCount_iiJ5"};function M(e){return e.href?(0,r.jsx)(i.A,{...e}):(0,r.jsx)(r.Fragment,{children:e.children})}function C(e){let{title:t}=e;return(0,r.jsx)("small",{className:y.authorTitle,title:t,children:t})}function P(e){let{name:t,as:a}=e;return a?(0,r.jsx)(_.A,{as:a,className:y.authorName,children:t}):(0,r.jsx)("span",{className:y.authorName,children:t})}function B(e){let{count:t}=e;return(0,r.jsx)("span",{className:(0,s.A)(y.authorBlogPostCount),children:t})}function L(e){let{as:t,author:a,className:n,count:l}=e;const{name:i,title:o,url:c,imageURL:m,email:u,page:d}=a,h=d?.permalink||c||u&&`mailto:${u}`||void 0;return(0,r.jsxs)("div",{className:(0,s.A)("avatar margin-bottom--sm",n,y[`author-as-${t}`]),children:[m&&(0,r.jsx)(M,{href:h,className:"avatar__photo-link",children:(0,r.jsx)("img",{className:(0,s.A)("avatar__photo",y.authorImage),src:m,alt:i})}),(i||o)&&(0,r.jsxs)("div",{className:(0,s.A)("avatar__intro",y.authorDetails),children:[(0,r.jsxs)("div",{className:"avatar__name",children:[i&&(0,r.jsx)(M,{href:h,children:(0,r.jsx)(P,{name:i,as:t})}),void 0!==l&&(0,r.jsx)(B,{count:l})]}),!!o&&(0,r.jsx)(C,{title:o}),(0,r.jsx)(k,{author:a})]})]})}const I={authorCol:"authorCol_Hf19",imageOnlyAuthorRow:"imageOnlyAuthorRow_pa_O",imageOnlyAuthorCol:"imageOnlyAuthorCol_G86a"};function T(e){let{className:t}=e;const{metadata:{authors:a},assets:l}=(0,n.e7)();if(0===a.length)return null;const i=a.every((e=>{let{name:t}=e;return!t})),o=1===a.length;return(0,r.jsx)("div",{className:(0,s.A)("margin-top--md margin-bottom--sm",i?I.imageOnlyAuthorRow:"row",t),children:a.map(((e,t)=>(0,r.jsx)("div",{className:(0,s.A)(!i&&(o?"col col--12":"col col--6"),i?I.imageOnlyAuthorCol:I.authorCol),children:(0,r.jsx)(L,{author:{...e,imageURL:l.authorsImageUrls[t]??e.imageURL}})},t)))})}function U(){return(0,r.jsxs)("header",{children:[(0,r.jsx)(c,{}),(0,r.jsx)(f,{}),(0,r.jsx)(T,{})]})}var O=a(4609),H=a(600);function $(e){let{children:t,className:a}=e;const{isBlogPostPage:l}=(0,n.e7)();return(0,r.jsx)("div",{id:l?O.LU:void 0,className:(0,s.A)("markdown",a),children:(0,r.jsx)(H.A,{children:t})})}var R=a(8630),G=a(5659),F=a(1113);function S(){return(0,r.jsx)("b",{children:(0,r.jsx)(m.A,{id:"theme.blog.post.readMore",description:"The label used in blog post item excerpts to link to full blog posts",children:"Read more"})})}function Z(e){const{blogPostTitle:t,...a}=e;return(0,r.jsx)(i.A,{"aria-label":(0,m.T)({message:"Read more about {title}",id:"theme.blog.post.readMoreLabel",description:"The ARIA label for the link to full blog posts from excerpts"},{title:t}),...a,children:(0,r.jsx)(S,{})})}function D(){const{metadata:e,isBlogPostPage:t}=(0,n.e7)(),{tags:a,title:l,editUrl:i,hasTruncateMarker:o,lastUpdatedBy:c,lastUpdatedAt:m}=e,u=!t&&o,d=a.length>0;if(!(d||u||i))return null;if(t){const e=!!(i||m||c);return(0,r.jsxs)("footer",{className:"docusaurus-mt-lg",children:[d&&(0,r.jsx)("div",{className:(0,s.A)("row","margin-top--sm",R.G.blog.blogFooterEditMetaRow),children:(0,r.jsx)("div",{className:"col",children:(0,r.jsx)(F.A,{tags:a})})}),e&&(0,r.jsx)(G.A,{className:(0,s.A)("margin-top--sm",R.G.blog.blogFooterEditMetaRow),editUrl:i,lastUpdatedAt:m,lastUpdatedBy:c})]})}return(0,r.jsxs)("footer",{className:"row docusaurus-mt-lg",children:[d&&(0,r.jsx)("div",{className:(0,s.A)("col",{"col--9":u}),children:(0,r.jsx)(F.A,{tags:a})}),u&&(0,r.jsx)("div",{className:(0,s.A)("col text--right",{"col--3":d}),children:(0,r.jsx)(Z,{blogPostTitle:l,to:e.permalink})})]})}function z(e){let{children:t,className:a}=e;const i=function(){const{isBlogPostPage:e}=(0,n.e7)();return e?void 0:"margin-bottom--xl"}();return(0,r.jsxs)(l,{className:(0,s.A)(i,a),children:[(0,r.jsx)(U,{}),(0,r.jsx)($,{children:t}),(0,r.jsx)(D,{})]})}},7824:(e,t,a)=>{a.d(t,{W:()=>c});var s=a(6540),n=a(7639);const r=["zero","one","two","few","many","other"];function l(e){return r.filter((t=>e.includes(t)))}const i={locale:"en",pluralForms:l(["one","other"]),select:e=>1===e?"one":"other"};function o(){const{i18n:{currentLocale:e}}=(0,n.A)();return(0,s.useMemo)((()=>{try{return function(e){const t=new Intl.PluralRules(e);return{locale:e,pluralForms:l(t.resolvedOptions().pluralCategories),select:e=>t.select(e)}}(e)}catch(t){return console.error(`Failed to use Intl.PluralRules for locale "${e}".\nDocusaurus will fallback to the default (English) implementation.\nError: ${t.message}\n`),i}}),[e])}function c(){const e=o();return{selectMessage:(t,a)=>function(e,t,a){const s=e.split("|");if(1===s.length)return s[0];s.length>a.pluralForms.length&&console.error(`For locale=${a.locale}, a maximum of ${a.pluralForms.length} plural forms are expected (${a.pluralForms.join(",")}), but the message contains ${s.length}: ${e}`);const n=a.select(t),r=a.pluralForms.indexOf(n);return s[Math.min(r,s.length-1)]}(a,t,e)}}}}]); \ No newline at end of file diff --git a/assets/js/57b59cd4.0d1d3a6c.js b/assets/js/57b59cd4.b2b4e011.js similarity index 93% rename from assets/js/57b59cd4.0d1d3a6c.js rename to assets/js/57b59cd4.b2b4e011.js index c44e57f6..3a51a18e 100644 --- a/assets/js/57b59cd4.0d1d3a6c.js +++ b/assets/js/57b59cd4.b2b4e011.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[8880],{6114:(e,t,i)=>{},4183:(e,t,i)=>{i(6114)},5797:(e,t,i)=>{i.d(t,{X:()=>d});var s=i(6540),r=i(8180),a=i(4783),n=i(3013);const l="feature",o=(...e)=>(0,n.rx)(l,...e),c=o,m={root:"feature__root",title:"feature__title",image:"feature__image",imageWrapper:"feature__imageWrapper"};var h=i(4848);function d(e){let{className:t,image:i,title:n,children:l,link:o}=e;const d="string"==typeof i?(0,r.Ay)(i):"",u=s.useMemo((()=>i?"string"==typeof i?(0,h.jsx)("div",{className:m.imageWrapper,children:(0,h.jsx)("img",{className:m.image,src:d,alt:n})}):(0,h.jsx)("div",{className:m.imageWrapper,children:i(m.image)}):null),[i,d]);return(0,h.jsxs)("div",{className:c(m.root,"col col--4",t),children:[o?(0,h.jsxs)(a.A,{href:o,children:[u,(0,h.jsx)("h3",{className:m.title,children:n})]}):(0,h.jsxs)(h.Fragment,{children:[u,(0,h.jsx)("h3",{className:m.title,children:n})]}),(0,h.jsx)("p",{children:l})]})}},3134:(e,t,i)=>{i.r(t),i.d(t,{default:()=>p});i(6540);var s=i(7635),r=i(7639),a=i(5797),n=i(3013);i(4183);const l="community",o=(...e)=>(0,n.rx)(l,...e),c=o,m="community__root",h="community__pageTitle",d="community__card",u="community__cards";var g=i(4848);const p=function(){const e=(0,r.A)(),{siteConfig:t}=e;return(0,g.jsx)(s.A,{wrapperClassName:m,title:t.title,description:"A modern CSS pre-processor built for components",children:(0,g.jsxs)("main",{children:[(0,g.jsx)("div",{className:c("container",h),children:(0,g.jsx)("h2",{children:"Join the Community"})}),(0,g.jsx)("section",{className:u,children:(0,g.jsx)("div",{className:"container",children:(0,g.jsxs)("div",{className:"row",children:[(0,g.jsx)(a.X,{className:d,link:"https://github.com/wix/stylable",title:"GitHub",image:e=>(0,g.jsx)("svg",{className:e,width:"100%",height:"100%",viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,g.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 0C3.58 0 0 3.58 0 8C0 11.54 2.29 14.53 5.47 15.59C5.87 15.66 6.02 15.42 6.02 15.21C6.02 15.02 6.01 14.39 6.01 13.72C4 14.09 3.48 13.23 3.32 12.78C3.23 12.55 2.84 11.84 2.5 11.65C2.22 11.5 1.82 11.13 2.49 11.12C3.12 11.11 3.57 11.7 3.72 11.94C4.44 13.15 5.59 12.81 6.05 12.6C6.12 12.08 6.33 11.73 6.56 11.53C4.78 11.33 2.92 10.64 2.92 7.58C2.92 6.71 3.23 5.99 3.74 5.43C3.66 5.23 3.38 4.41 3.82 3.31C3.82 3.31 4.49 3.1 6.02 4.13C6.66 3.95 7.34 3.86 8.02 3.86C8.7 3.86 9.38 3.95 10.02 4.13C11.55 3.09 12.22 3.31 12.22 3.31C12.66 4.41 12.38 5.23 12.3 5.43C12.81 5.99 13.12 6.7 13.12 7.58C13.12 10.65 11.25 11.33 9.47 11.53C9.76 11.78 10.01 12.26 10.01 13.01C10.01 14.08 10 14.94 10 15.21C10 15.42 10.15 15.67 10.55 15.59C13.71 14.53 16 11.53 16 8C16 3.58 12.42 0 8 0Z",transform:"scale(64)"})}),children:"Track our development, search open issues, report new ones, and contribute back to the project"}),(0,g.jsx)(a.X,{className:d,link:"https://twitter.com/stylableio",title:"Twitter",image:"img/twitter-logo.svg",children:"Follow our Twitter to stay up to date with the latest happenings in Stylable"}),(0,g.jsx)(a.X,{className:d,link:"https://discord.gg/C5ZhENSbV7",title:"Discord",image:"img/discord-Logo-color.svg",children:"Join our Discord community, where you can chat with us, ask questions, and showcase your work"})]})})})]})})}},3013:(e,t,i)=>{function s(e,t,i){if(!1===i||null==i||i!=i)return"";if(!0===i)return e+"--"+t;var s=i.toString();return e+"---"+t+"-"+s.length+"-"+s.replace(/\s/gm,"_")}function r(e){for(var t=[],i=1;i r})}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[8880],{6114:(e,t,i)=>{},4183:(e,t,i)=>{i(6114)},5453:(e,t,i)=>{i.d(t,{X:()=>d});var s=i(6540),r=i(6025),a=i(8774),n=i(3013);const l="feature",o=(...e)=>(0,n.rx)(l,...e),c=o,m={root:"feature__root",title:"feature__title",image:"feature__image",imageWrapper:"feature__imageWrapper"};var h=i(4848);function d(e){let{className:t,image:i,title:n,children:l,link:o}=e;const d="string"==typeof i?(0,r.Ay)(i):"",u=s.useMemo((()=>i?"string"==typeof i?(0,h.jsx)("div",{className:m.imageWrapper,children:(0,h.jsx)("img",{className:m.image,src:d,alt:n})}):(0,h.jsx)("div",{className:m.imageWrapper,children:i(m.image)}):null),[i,d]);return(0,h.jsxs)("div",{className:c(m.root,"col col--4",t),children:[o?(0,h.jsxs)(a.A,{href:o,children:[u,(0,h.jsx)("h3",{className:m.title,children:n})]}):(0,h.jsxs)(h.Fragment,{children:[u,(0,h.jsx)("h3",{className:m.title,children:n})]}),(0,h.jsx)("p",{children:l})]})}},2403:(e,t,i)=>{i.r(t),i.d(t,{default:()=>p});i(6540);var s=i(7823),r=i(4586),a=i(5453),n=i(3013);i(4183);const l="community",o=(...e)=>(0,n.rx)(l,...e),c=o,m="community__root",h="community__pageTitle",d="community__card",u="community__cards";var g=i(4848);const p=function(){const e=(0,r.A)(),{siteConfig:t}=e;return(0,g.jsx)(s.A,{wrapperClassName:m,title:t.title,description:"A modern CSS pre-processor built for components",children:(0,g.jsxs)("main",{children:[(0,g.jsx)("div",{className:c("container",h),children:(0,g.jsx)("h2",{children:"Join the Community"})}),(0,g.jsx)("section",{className:u,children:(0,g.jsx)("div",{className:"container",children:(0,g.jsxs)("div",{className:"row",children:[(0,g.jsx)(a.X,{className:d,link:"https://github.com/wix/stylable",title:"GitHub",image:e=>(0,g.jsx)("svg",{className:e,width:"100%",height:"100%",viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,g.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 0C3.58 0 0 3.58 0 8C0 11.54 2.29 14.53 5.47 15.59C5.87 15.66 6.02 15.42 6.02 15.21C6.02 15.02 6.01 14.39 6.01 13.72C4 14.09 3.48 13.23 3.32 12.78C3.23 12.55 2.84 11.84 2.5 11.65C2.22 11.5 1.82 11.13 2.49 11.12C3.12 11.11 3.57 11.7 3.72 11.94C4.44 13.15 5.59 12.81 6.05 12.6C6.12 12.08 6.33 11.73 6.56 11.53C4.78 11.33 2.92 10.64 2.92 7.58C2.92 6.71 3.23 5.99 3.74 5.43C3.66 5.23 3.38 4.41 3.82 3.31C3.82 3.31 4.49 3.1 6.02 4.13C6.66 3.95 7.34 3.86 8.02 3.86C8.7 3.86 9.38 3.95 10.02 4.13C11.55 3.09 12.22 3.31 12.22 3.31C12.66 4.41 12.38 5.23 12.3 5.43C12.81 5.99 13.12 6.7 13.12 7.58C13.12 10.65 11.25 11.33 9.47 11.53C9.76 11.78 10.01 12.26 10.01 13.01C10.01 14.08 10 14.94 10 15.21C10 15.42 10.15 15.67 10.55 15.59C13.71 14.53 16 11.53 16 8C16 3.58 12.42 0 8 0Z",transform:"scale(64)"})}),children:"Track our development, search open issues, report new ones, and contribute back to the project"}),(0,g.jsx)(a.X,{className:d,link:"https://twitter.com/stylableio",title:"Twitter",image:"img/twitter-logo.svg",children:"Follow our Twitter to stay up to date with the latest happenings in Stylable"}),(0,g.jsx)(a.X,{className:d,link:"https://discord.gg/C5ZhENSbV7",title:"Discord",image:"img/discord-Logo-color.svg",children:"Join our Discord community, where you can chat with us, ask questions, and showcase your work"})]})})})]})})}},3013:(e,t,i)=>{function s(e,t,i){if(!1===i||null==i||i!=i)return"";if(!0===i)return e+"--"+t;var s=i.toString();return e+"---"+t+"-"+s.length+"-"+s.replace(/\s/gm,"_")}function r(e){for(var t=[],i=1;i r})}}]); \ No newline at end of file diff --git a/assets/js/587a03c1.4ced226b.js b/assets/js/587a03c1.ef46d825.js similarity index 99% rename from assets/js/587a03c1.4ced226b.js rename to assets/js/587a03c1.ef46d825.js index b40143d3..a1304074 100644 --- a/assets/js/587a03c1.4ced226b.js +++ b/assets/js/587a03c1.ef46d825.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[7395],{2176:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>d,contentTitle:()=>l,default:()=>h,frontMatter:()=>i,metadata:()=>t,toc:()=>c});const t=JSON.parse('{"id":"guides/handbook/runtime","title":"Runtime","description":"In the previous chapter, we saw brief examples of mapping our classes local names to their global namespaced names at runtime, as well as the cssStates utility function to activate their states.","source":"@site/docs/guides/handbook/runtime.md","sourceDirName":"guides/handbook","slug":"/guides/handbook/runtime","permalink":"/docs/guides/handbook/runtime","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/guides/handbook/runtime.md","tags":[],"version":"current","frontMatter":{"id":"runtime","title":"Runtime"},"sidebar":"Guides","previous":{"title":"Custom State","permalink":"/docs/guides/handbook/custom-state"},"next":{"title":"Import Class","permalink":"/docs/guides/handbook/import-class"}}');var a=n(4848),r=n(8453);const i={id:"runtime",title:"Runtime"},l=void 0,d={},c=[{value:"Mapped symbols",id:"mapped-symbols",level:2},{value:"Import example",id:"import-example",level:3},{value:"Runtime namespaced names",id:"runtime-namespaced-names",level:3},{value:"Apply class and state",id:"apply-class-and-state",level:2},{value:" st()
function",id:"st-function",level:3},{value:"Stylable build variables",id:"stylable-build-variables",level:2}];function o(e){const s={a:"a",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(s.p,{children:["In the ",(0,a.jsx)(s.a,{href:"/docs/guides/handbook/custom-state",children:"previous chapter"}),", we saw brief examples of mapping our ",(0,a.jsx)(s.code,{children:"classes"})," local names to their global namespaced names at runtime, as well as the ",(0,a.jsx)(s.code,{children:"cssStates"})," utility function to activate their states."]}),"\n",(0,a.jsx)(s.p,{children:"In this chapter, we'll explore the runtime features of Stylable and their usage."}),"\n",(0,a.jsx)(s.p,{children:"One of the core ideas behind Stylable is to try and shift as much of the work as possible from runtime to build time to increase performance and end-user experience. However, in some instances, we need to do additional work in JavaScript."}),"\n",(0,a.jsx)(s.p,{children:"For example, we need to:"}),"\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsx)(s.li,{children:"Bind classes to views"}),"\n",(0,a.jsx)(s.li,{children:"Activate states"}),"\n",(0,a.jsx)(s.li,{children:"Set custom property values"}),"\n",(0,a.jsx)(s.li,{children:"Dynamically generate CSS"}),"\n"]}),"\n",(0,a.jsx)(s.h2,{id:"mapped-symbols",children:"Mapped symbols"}),"\n",(0,a.jsxs)(s.p,{children:["The namespacing chapter covered the basics of namespacing in Stylable, and in it, we saw that in Stylable, ",(0,a.jsx)(s.strong,{children:"classes, custom-properties, keyframes, layers, and containers"})," all receive namespacing to avoid conflicts."]}),"\n",(0,a.jsx)(s.h3,{id:"import-example",children:"Import example"}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-js",children:'import {\n classes, // class mapping\n vars, // custom properties mapping\n keyframes, // keyframes mapping\n layers, // layer mapping\n containers, // container mapping\n} from "./game.st.css";\n\n'})}),"\n",(0,a.jsx)(s.h3,{id:"runtime-namespaced-names",children:"Runtime namespaced names"}),"\n",(0,a.jsxs)(s.table,{children:[(0,a.jsx)(s.thead,{children:(0,a.jsxs)(s.tr,{children:[(0,a.jsx)(s.th,{children:"Import"}),(0,a.jsx)(s.th,{children:"Type"}),(0,a.jsx)(s.th,{children:"Source"}),(0,a.jsx)(s.th,{children:"Target"})]})}),(0,a.jsxs)(s.tbody,{children:[(0,a.jsxs)(s.tr,{children:[(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"classes"})}),(0,a.jsx)(s.td,{children:"Class"}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:".player"})}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:".NS__player"})})]}),(0,a.jsxs)(s.tr,{children:[(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"vars"})}),(0,a.jsx)(s.td,{children:"Custom property"}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"--player1Color"})}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"--NS-player1Color"})})]}),(0,a.jsxs)(s.tr,{children:[(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"keyframes"})}),(0,a.jsx)(s.td,{children:"Keyframes"}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"@keyframes slide"})}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"@keyframes NS__slide"})})]}),(0,a.jsxs)(s.tr,{children:[(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"layers"})}),(0,a.jsx)(s.td,{children:"Layer"}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"@layer theme"})}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"@layer NS__theme"})})]}),(0,a.jsxs)(s.tr,{children:[(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"containers"})}),(0,a.jsx)(s.td,{children:"Container"}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"container: panel"})}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"container: NS__panel"})})]})]})]}),"\n",(0,a.jsx)(s.h2,{id:"apply-class-and-state",children:"Apply class and state"}),"\n",(0,a.jsx)(s.p,{children:"Up to this point, all use cases we saw for wiring elements were simplified or overly verbose."}),"\n",(0,a.jsxs)(s.p,{children:["In the following example we can see that we are binding the ",(0,a.jsx)(s.code,{children:"player"})," class to the ",(0,a.jsx)(s.code,{children:"player"})," view, as well as activating the ",(0,a.jsx)(s.code,{children:"registered"})," state."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-jsx",children:"import { classes, stStates } from \"./game.st.css\";\n\n\n className={classes.player + ' ' + stStates({registered: true})}\n\n"})}),"\n",(0,a.jsxs)(s.h3,{id:"st-function",children:[(0,a.jsx)(s.code,{children:"st()"})," function"]}),"\n",(0,a.jsxs)(s.p,{children:["We can use the ",(0,a.jsx)(s.code,{children:"st()"})," function to simplify this process, by passing it the class name as its ",(0,a.jsx)(s.strong,{children:"first argument"}),", and the activated states as its ",(0,a.jsx)(s.strong,{children:"second argument"}),"."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-jsx",children:"import { st, classes } from './game.st.css';\n\n;\n"})}),"\n",(0,a.jsx)(s.p,{children:"There are cases in which we would like to add additional classes to an element. For example, a component might want to accept an external class name to allow for custom styling."}),"\n",(0,a.jsxs)(s.p,{children:["Below, we can see such a case, where we bind a class (",(0,a.jsx)(s.code,{children:"player"}),"), activate a state (",(0,a.jsx)(s.code,{children:"registered"}),"), and add an external class from props for customization purposes."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-jsx",metastring:'title="game.jsx"',children:"import { st, classes } from './game.st.css';\nconst Game = ({ className }) => {\n return (\n\n\n );\n}\n"})}),"\n",(0,a.jsxs)(s.p,{children:["For further details on the runtime API, ",(0,a.jsx)(s.a,{href:"/docs/references/runtime",children:"see the runtime reference"}),"."]}),"\n",(0,a.jsx)(s.h2,{id:"stylable-build-variables",children:"Stylable build variables"}),"\n",(0,a.jsx)(s.p,{children:"We have yet to cover Stylable build variables, but seeing as they expose their value in runtime, we'll cover them here briefly."}),"\n",(0,a.jsx)(s.p,{children:"As opposed to the native runtime symbols we saw namespaced above, Stylable build variables do not require namespacing, as they are transpiled away at build time. In this case, the runtime export maps variables to their defined values."}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-js",children:'import {\n stVars // Stylable build variables\n} from "./game.st.css";\n\n// runtime namespaced names\nstVars.boardBackgroundColor; // "green"\n'})})]})}function h(e={}){const{wrapper:s}={...(0,r.R)(),...e.components};return s?(0,a.jsx)(s,{...e,children:(0,a.jsx)(o,{...e})}):o(e)}},8453:(e,s,n)=>{n.d(s,{R:()=>i,x:()=>l});var t=n(6540);const a={},r=t.createContext(a);function i(e){const s=t.useContext(r);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function l(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:i(e.components),t.createElement(r.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[7395],{7813:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>d,contentTitle:()=>l,default:()=>h,frontMatter:()=>i,metadata:()=>t,toc:()=>c});const t=JSON.parse('{"id":"guides/handbook/runtime","title":"Runtime","description":"In the previous chapter, we saw brief examples of mapping our classes local names to their global namespaced names at runtime, as well as the cssStates utility function to activate their states.","source":"@site/docs/guides/handbook/runtime.md","sourceDirName":"guides/handbook","slug":"/guides/handbook/runtime","permalink":"/docs/guides/handbook/runtime","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/guides/handbook/runtime.md","tags":[],"version":"current","frontMatter":{"id":"runtime","title":"Runtime"},"sidebar":"Guides","previous":{"title":"Custom State","permalink":"/docs/guides/handbook/custom-state"},"next":{"title":"Import Class","permalink":"/docs/guides/handbook/import-class"}}');var a=n(4848),r=n(8453);const i={id:"runtime",title:"Runtime"},l=void 0,d={},c=[{value:"Mapped symbols",id:"mapped-symbols",level:2},{value:"Import example",id:"import-example",level:3},{value:"Runtime namespaced names",id:"runtime-namespaced-names",level:3},{value:"Apply class and state",id:"apply-class-and-state",level:2},{value:"st()
function",id:"st-function",level:3},{value:"Stylable build variables",id:"stylable-build-variables",level:2}];function o(e){const s={a:"a",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(s.p,{children:["In the ",(0,a.jsx)(s.a,{href:"/docs/guides/handbook/custom-state",children:"previous chapter"}),", we saw brief examples of mapping our ",(0,a.jsx)(s.code,{children:"classes"})," local names to their global namespaced names at runtime, as well as the ",(0,a.jsx)(s.code,{children:"cssStates"})," utility function to activate their states."]}),"\n",(0,a.jsx)(s.p,{children:"In this chapter, we'll explore the runtime features of Stylable and their usage."}),"\n",(0,a.jsx)(s.p,{children:"One of the core ideas behind Stylable is to try and shift as much of the work as possible from runtime to build time to increase performance and end-user experience. However, in some instances, we need to do additional work in JavaScript."}),"\n",(0,a.jsx)(s.p,{children:"For example, we need to:"}),"\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsx)(s.li,{children:"Bind classes to views"}),"\n",(0,a.jsx)(s.li,{children:"Activate states"}),"\n",(0,a.jsx)(s.li,{children:"Set custom property values"}),"\n",(0,a.jsx)(s.li,{children:"Dynamically generate CSS"}),"\n"]}),"\n",(0,a.jsx)(s.h2,{id:"mapped-symbols",children:"Mapped symbols"}),"\n",(0,a.jsxs)(s.p,{children:["The namespacing chapter covered the basics of namespacing in Stylable, and in it, we saw that in Stylable, ",(0,a.jsx)(s.strong,{children:"classes, custom-properties, keyframes, layers, and containers"})," all receive namespacing to avoid conflicts."]}),"\n",(0,a.jsx)(s.h3,{id:"import-example",children:"Import example"}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-js",children:'import {\n classes, // class mapping\n vars, // custom properties mapping\n keyframes, // keyframes mapping\n layers, // layer mapping\n containers, // container mapping\n} from "./game.st.css";\n\n'})}),"\n",(0,a.jsx)(s.h3,{id:"runtime-namespaced-names",children:"Runtime namespaced names"}),"\n",(0,a.jsxs)(s.table,{children:[(0,a.jsx)(s.thead,{children:(0,a.jsxs)(s.tr,{children:[(0,a.jsx)(s.th,{children:"Import"}),(0,a.jsx)(s.th,{children:"Type"}),(0,a.jsx)(s.th,{children:"Source"}),(0,a.jsx)(s.th,{children:"Target"})]})}),(0,a.jsxs)(s.tbody,{children:[(0,a.jsxs)(s.tr,{children:[(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"classes"})}),(0,a.jsx)(s.td,{children:"Class"}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:".player"})}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:".NS__player"})})]}),(0,a.jsxs)(s.tr,{children:[(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"vars"})}),(0,a.jsx)(s.td,{children:"Custom property"}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"--player1Color"})}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"--NS-player1Color"})})]}),(0,a.jsxs)(s.tr,{children:[(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"keyframes"})}),(0,a.jsx)(s.td,{children:"Keyframes"}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"@keyframes slide"})}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"@keyframes NS__slide"})})]}),(0,a.jsxs)(s.tr,{children:[(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"layers"})}),(0,a.jsx)(s.td,{children:"Layer"}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"@layer theme"})}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"@layer NS__theme"})})]}),(0,a.jsxs)(s.tr,{children:[(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"containers"})}),(0,a.jsx)(s.td,{children:"Container"}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"container: panel"})}),(0,a.jsx)(s.td,{children:(0,a.jsx)(s.code,{children:"container: NS__panel"})})]})]})]}),"\n",(0,a.jsx)(s.h2,{id:"apply-class-and-state",children:"Apply class and state"}),"\n",(0,a.jsx)(s.p,{children:"Up to this point, all use cases we saw for wiring elements were simplified or overly verbose."}),"\n",(0,a.jsxs)(s.p,{children:["In the following example we can see that we are binding the ",(0,a.jsx)(s.code,{children:"player"})," class to the ",(0,a.jsx)(s.code,{children:"player"})," view, as well as activating the ",(0,a.jsx)(s.code,{children:"registered"})," state."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-jsx",children:"import { classes, stStates } from \"./game.st.css\";\n\n\n className={classes.player + ' ' + stStates({registered: true})}\n\n"})}),"\n",(0,a.jsxs)(s.h3,{id:"st-function",children:[(0,a.jsx)(s.code,{children:"st()"})," function"]}),"\n",(0,a.jsxs)(s.p,{children:["We can use the ",(0,a.jsx)(s.code,{children:"st()"})," function to simplify this process, by passing it the class name as its ",(0,a.jsx)(s.strong,{children:"first argument"}),", and the activated states as its ",(0,a.jsx)(s.strong,{children:"second argument"}),"."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-jsx",children:"import { st, classes } from './game.st.css';\n\n;\n"})}),"\n",(0,a.jsx)(s.p,{children:"There are cases in which we would like to add additional classes to an element. For example, a component might want to accept an external class name to allow for custom styling."}),"\n",(0,a.jsxs)(s.p,{children:["Below, we can see such a case, where we bind a class (",(0,a.jsx)(s.code,{children:"player"}),"), activate a state (",(0,a.jsx)(s.code,{children:"registered"}),"), and add an external class from props for customization purposes."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-jsx",metastring:'title="game.jsx"',children:"import { st, classes } from './game.st.css';\nconst Game = ({ className }) => {\n return (\n\n\n );\n}\n"})}),"\n",(0,a.jsxs)(s.p,{children:["For further details on the runtime API, ",(0,a.jsx)(s.a,{href:"/docs/references/runtime",children:"see the runtime reference"}),"."]}),"\n",(0,a.jsx)(s.h2,{id:"stylable-build-variables",children:"Stylable build variables"}),"\n",(0,a.jsx)(s.p,{children:"We have yet to cover Stylable build variables, but seeing as they expose their value in runtime, we'll cover them here briefly."}),"\n",(0,a.jsx)(s.p,{children:"As opposed to the native runtime symbols we saw namespaced above, Stylable build variables do not require namespacing, as they are transpiled away at build time. In this case, the runtime export maps variables to their defined values."}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-js",children:'import {\n stVars // Stylable build variables\n} from "./game.st.css";\n\n// runtime namespaced names\nstVars.boardBackgroundColor; // "green"\n'})})]})}function h(e={}){const{wrapper:s}={...(0,r.R)(),...e.components};return s?(0,a.jsx)(s,{...e,children:(0,a.jsx)(o,{...e})}):o(e)}},8453:(e,s,n)=>{n.d(s,{R:()=>i,x:()=>l});var t=n(6540);const a={},r=t.createContext(a);function i(e){const s=t.useContext(r);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function l(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:i(e.components),t.createElement(r.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/5e66eab8.938138e1.js b/assets/js/5e66eab8.1b5146ce.js similarity index 99% rename from assets/js/5e66eab8.938138e1.js rename to assets/js/5e66eab8.1b5146ce.js index ba77ddcc..b3e01122 100644 --- a/assets/js/5e66eab8.938138e1.js +++ b/assets/js/5e66eab8.1b5146ce.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[4293],{3587:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>c,contentTitle:()=>i,default:()=>h,frontMatter:()=>r,metadata:()=>n,toc:()=>o});const n=JSON.parse('{"id":"references/extend-stylesheet","title":"Extend","description":"The Stylable -st-extends declaration is used to indicate that a CSS class inherits from a stylesheet or another class.","source":"@site/docs/references/extend-stylesheet.md","sourceDirName":"references","slug":"/references/extend-stylesheet","permalink":"/docs/references/extend-stylesheet","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/extend-stylesheet.md","tags":[],"version":"current","frontMatter":{"id":"extend-stylesheet","title":"Extend"},"sidebar":"Specification Reference","previous":{"title":"Custom Selector","permalink":"/docs/references/custom-selectors"},"next":{"title":"Global Selector","permalink":"/docs/references/global-selectors"}}');var a=t(4848),l=t(8453);const r={id:"extend-stylesheet",title:"Extend"},i=void 0,c={},o=[{value:"Syntax",id:"syntax",level:2},{value:"Example",id:"example",level:2},{value:"Runtime - root vs class",id:"runtime---root-vs-class",level:2},{value:"Namespace",id:"namespace",level:2}];function d(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",strong:"strong",...(0,l.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(s.p,{children:["The Stylable ",(0,a.jsx)(s.code,{children:"-st-extends"})," declaration is used to indicate that a ",(0,a.jsx)(s.a,{href:"/docs/references/class-selectors",children:"CSS class"})," inherits from a stylesheet or another class."]}),"\n",(0,a.jsx)(s.p,{children:"It assumes both the class and the extended reference will share the same element in the DOM, and enables the targeting of inner parts and states as an API with validations and completions."}),"\n",(0,a.jsx)(s.h2,{id:"syntax",children:"Syntax"}),"\n",(0,a.jsxs)(s.p,{children:["Use ",(0,a.jsx)(s.code,{children:"-st-extends"})," with the value of a component ",(0,a.jsx)(s.a,{href:"/docs/references/root",children:"stylesheet root"})," to indicate that a class is used to customize the component, or with a value of another class to compose them (usually a utility class)."]}),"\n",(0,a.jsx)(s.p,{children:(0,a.jsx)(s.strong,{children:"Extend a stylesheet root"})}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",children:"@st-import Comp from './comp.st.css';\n\n.x {\n -st-extends: Comp;\n}\n"})}),"\n",(0,a.jsx)(s.p,{children:(0,a.jsx)(s.strong,{children:"Extend a class"})}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",children:"@st-import [class] from './comp.st.css';\n\n.x {\n -st-extends: class;\n}\n"})}),"\n",(0,a.jsx)(s.admonition,{title:"Local extends",type:"tip",children:(0,a.jsx)(s.p,{children:"Extend is not limited to imported definitions, a class can extend other local classes, as well as the local stylesheet root."})}),"\n",(0,a.jsx)(s.h2,{id:"example",children:"Example"}),"\n",(0,a.jsx)(s.p,{children:"The following example illustrates a page with a customized main gallery instance."}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="slider-gallery.st.css"',children:"/* gallery style API */\n.root {\n -st-states: pos(enum(start, middle, end));\n}\n.prevBtn {}\n.nextBtn {}\n"})}),"\n",(0,a.jsxs)(s.p,{children:["Customizes the main gallery by importing the gallery component stylesheet into the page stylesheet, create a ",(0,a.jsx)(s.code,{children:"mainGallery"})," class, extend it with the value of the gallery stylesheet, and then target it's inner ",(0,a.jsx)(s.a,{href:"/docs/references/pseudo-elements",children:"custom pseudo-elements"})," and ",(0,a.jsx)(s.a,{href:"/docs/references/pseudo-classes",children:"custom pseudo-states"}),"."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="page.st.css"',children:"@st-import SliderGallery from './slider-gallery.st.css';\n\n.mainGallery {\n -st-extends: mainGallery; /* mainGallery is a SliderGallery */\n}\n.mainGallery::nextbtn {\n /* customize mainGallery inner nextBtn part */\n}\n.mainGallery:pos(end)::nextbtn {\n /* customize mainGallery in end position inner nextBtn part */\n}\n"})}),"\n",(0,a.jsxs)(s.p,{children:["In the view, set the ",(0,a.jsx)(s.code,{children:"mainGallery"})," class on the gallery instance."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-jsx",metastring:'title="page.jsx"',children:"import SliderGallery from './slider-gallery';\nimport { classes } from './page.st.css';\n\nconst Page = () => {\n\n /* customize SliderGallery as mainGallery */\n;\n};\n"})}),"\n",(0,a.jsx)(s.h2,{id:"runtime---root-vs-class",children:"Runtime - root vs class"}),"\n",(0,a.jsx)(s.p,{children:"There is a slight difference between the runtime output when extending a stylesheet root and extending a normal CSS class."}),"\n",(0,a.jsx)(s.p,{children:(0,a.jsx)(s.strong,{children:"A CSS class is composed to the runtime class name while a stylesheet root is not."})}),"\n",(0,a.jsx)(s.p,{children:"This is because Stylable assumes that a stylesheet root will be set within the component that is being extended and composing it from the outside is redundant."}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="page.st.css"',children:"@st-import Gallery from './gallery.st.css';\n@st-import [center] from './utils.st.css';\n\n.variant {\n -st-extends: Gallery;\n}\n.title {\n -st-extends: center;\n}\n"})}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-js",metastring:'title="page.jsx"',children:'import { classes } from \'./page.st.css\';\n\nclasses.variant // "page__variant"\nclasses.title // "page__title utils__center"\n'})}),"\n",(0,a.jsx)(s.admonition,{title:"unsupported multiple extends",type:"info",children:(0,a.jsx)(s.p,{children:"Stylable currently does not support extending multiple classes. We hope to introduce this capability in the future."})}),"\n",(0,a.jsx)(s.h2,{id:"namespace",children:"Namespace"}),"\n",(0,a.jsxs)(s.p,{children:[(0,a.jsx)(s.code,{children:"-st-extends"})," provides access to inner parts and states, but does not modify the namespace of the extending class."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="page.st.css"',children:"@st-import Gallery from './gallery.st.css';\n.variant {\n -st-extends: Gallery;\n}\n.variant {}\n.variant::navBtn {}\n.variant:loading {}\n\n/* OUTPUT */\n.page__variant {}\n.page__variant .gallery__navBtn {}\n.page__variant.gallery--loading {}\n"})})]})}function h(e={}){const{wrapper:s}={...(0,l.R)(),...e.components};return s?(0,a.jsx)(s,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},8453:(e,s,t)=>{t.d(s,{R:()=>r,x:()=>i});var n=t(6540);const a={},l=n.createContext(a);function r(e){const s=n.useContext(l);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function i(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:r(e.components),n.createElement(l.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[4293],{8343:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>c,contentTitle:()=>i,default:()=>h,frontMatter:()=>r,metadata:()=>n,toc:()=>o});const n=JSON.parse('{"id":"references/extend-stylesheet","title":"Extend","description":"The Stylable -st-extends declaration is used to indicate that a CSS class inherits from a stylesheet or another class.","source":"@site/docs/references/extend-stylesheet.md","sourceDirName":"references","slug":"/references/extend-stylesheet","permalink":"/docs/references/extend-stylesheet","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/extend-stylesheet.md","tags":[],"version":"current","frontMatter":{"id":"extend-stylesheet","title":"Extend"},"sidebar":"Specification Reference","previous":{"title":"Custom Selector","permalink":"/docs/references/custom-selectors"},"next":{"title":"Global Selector","permalink":"/docs/references/global-selectors"}}');var a=t(4848),l=t(8453);const r={id:"extend-stylesheet",title:"Extend"},i=void 0,c={},o=[{value:"Syntax",id:"syntax",level:2},{value:"Example",id:"example",level:2},{value:"Runtime - root vs class",id:"runtime---root-vs-class",level:2},{value:"Namespace",id:"namespace",level:2}];function d(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",strong:"strong",...(0,l.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(s.p,{children:["The Stylable ",(0,a.jsx)(s.code,{children:"-st-extends"})," declaration is used to indicate that a ",(0,a.jsx)(s.a,{href:"/docs/references/class-selectors",children:"CSS class"})," inherits from a stylesheet or another class."]}),"\n",(0,a.jsx)(s.p,{children:"It assumes both the class and the extended reference will share the same element in the DOM, and enables the targeting of inner parts and states as an API with validations and completions."}),"\n",(0,a.jsx)(s.h2,{id:"syntax",children:"Syntax"}),"\n",(0,a.jsxs)(s.p,{children:["Use ",(0,a.jsx)(s.code,{children:"-st-extends"})," with the value of a component ",(0,a.jsx)(s.a,{href:"/docs/references/root",children:"stylesheet root"})," to indicate that a class is used to customize the component, or with a value of another class to compose them (usually a utility class)."]}),"\n",(0,a.jsx)(s.p,{children:(0,a.jsx)(s.strong,{children:"Extend a stylesheet root"})}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",children:"@st-import Comp from './comp.st.css';\n\n.x {\n -st-extends: Comp;\n}\n"})}),"\n",(0,a.jsx)(s.p,{children:(0,a.jsx)(s.strong,{children:"Extend a class"})}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",children:"@st-import [class] from './comp.st.css';\n\n.x {\n -st-extends: class;\n}\n"})}),"\n",(0,a.jsx)(s.admonition,{title:"Local extends",type:"tip",children:(0,a.jsx)(s.p,{children:"Extend is not limited to imported definitions, a class can extend other local classes, as well as the local stylesheet root."})}),"\n",(0,a.jsx)(s.h2,{id:"example",children:"Example"}),"\n",(0,a.jsx)(s.p,{children:"The following example illustrates a page with a customized main gallery instance."}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="slider-gallery.st.css"',children:"/* gallery style API */\n.root {\n -st-states: pos(enum(start, middle, end));\n}\n.prevBtn {}\n.nextBtn {}\n"})}),"\n",(0,a.jsxs)(s.p,{children:["Customizes the main gallery by importing the gallery component stylesheet into the page stylesheet, create a ",(0,a.jsx)(s.code,{children:"mainGallery"})," class, extend it with the value of the gallery stylesheet, and then target it's inner ",(0,a.jsx)(s.a,{href:"/docs/references/pseudo-elements",children:"custom pseudo-elements"})," and ",(0,a.jsx)(s.a,{href:"/docs/references/pseudo-classes",children:"custom pseudo-states"}),"."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="page.st.css"',children:"@st-import SliderGallery from './slider-gallery.st.css';\n\n.mainGallery {\n -st-extends: mainGallery; /* mainGallery is a SliderGallery */\n}\n.mainGallery::nextbtn {\n /* customize mainGallery inner nextBtn part */\n}\n.mainGallery:pos(end)::nextbtn {\n /* customize mainGallery in end position inner nextBtn part */\n}\n"})}),"\n",(0,a.jsxs)(s.p,{children:["In the view, set the ",(0,a.jsx)(s.code,{children:"mainGallery"})," class on the gallery instance."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-jsx",metastring:'title="page.jsx"',children:"import SliderGallery from './slider-gallery';\nimport { classes } from './page.st.css';\n\nconst Page = () => {\n\n \n /* customize SliderGallery as mainGallery */\n;\n};\n"})}),"\n",(0,a.jsx)(s.h2,{id:"runtime---root-vs-class",children:"Runtime - root vs class"}),"\n",(0,a.jsx)(s.p,{children:"There is a slight difference between the runtime output when extending a stylesheet root and extending a normal CSS class."}),"\n",(0,a.jsx)(s.p,{children:(0,a.jsx)(s.strong,{children:"A CSS class is composed to the runtime class name while a stylesheet root is not."})}),"\n",(0,a.jsx)(s.p,{children:"This is because Stylable assumes that a stylesheet root will be set within the component that is being extended and composing it from the outside is redundant."}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="page.st.css"',children:"@st-import Gallery from './gallery.st.css';\n@st-import [center] from './utils.st.css';\n\n.variant {\n -st-extends: Gallery;\n}\n.title {\n -st-extends: center;\n}\n"})}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-js",metastring:'title="page.jsx"',children:'import { classes } from \'./page.st.css\';\n\nclasses.variant // "page__variant"\nclasses.title // "page__title utils__center"\n'})}),"\n",(0,a.jsx)(s.admonition,{title:"unsupported multiple extends",type:"info",children:(0,a.jsx)(s.p,{children:"Stylable currently does not support extending multiple classes. We hope to introduce this capability in the future."})}),"\n",(0,a.jsx)(s.h2,{id:"namespace",children:"Namespace"}),"\n",(0,a.jsxs)(s.p,{children:[(0,a.jsx)(s.code,{children:"-st-extends"})," provides access to inner parts and states, but does not modify the namespace of the extending class."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="page.st.css"',children:"@st-import Gallery from './gallery.st.css';\n.variant {\n -st-extends: Gallery;\n}\n.variant {}\n.variant::navBtn {}\n.variant:loading {}\n\n/* OUTPUT */\n.page__variant {}\n.page__variant .gallery__navBtn {}\n.page__variant.gallery--loading {}\n"})})]})}function h(e={}){const{wrapper:s}={...(0,l.R)(),...e.components};return s?(0,a.jsx)(s,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},8453:(e,s,t)=>{t.d(s,{R:()=>r,x:()=>i});var n=t(6540);const a={},l=n.createContext(a);function r(e){const s=n.useContext(l);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function i(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:r(e.components),n.createElement(l.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/5e95c892.2cc33f12.js b/assets/js/5e95c892.2cc33f12.js new file mode 100644 index 00000000..03cbd1f3 --- /dev/null +++ b/assets/js/5e95c892.2cc33f12.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[9647],{7121:(e,s,r)=>{r.r(s),r.d(s,{default:()=>i});r(6540);var a=r(4164),l=r(1213),t=r(7559),u=r(2831),c=r(7823),n=r(4848);function i(e){return(0,n.jsx)(l.e3,{className:(0,a.A)(t.G.wrapper.docsPages),children:(0,n.jsx)(c.A,{children:(0,u.v)(e.route.routes)})})}}}]); \ No newline at end of file diff --git a/assets/js/5e95c892.4964a51d.js b/assets/js/5e95c892.4964a51d.js deleted file mode 100644 index 3eead17e..00000000 --- a/assets/js/5e95c892.4964a51d.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[9647],{3124:(e,s,r)=>{r.r(s),r.d(s,{default:()=>i});r(6540);var a=r(4164),l=r(6644),t=r(8630),u=r(2831),c=r(7635),n=r(4848);function i(e){return(0,n.jsx)(l.e3,{className:(0,a.A)(t.G.wrapper.docsPages),children:(0,n.jsx)(c.A,{children:(0,u.v)(e.route.routes)})})}}}]); \ No newline at end of file diff --git a/assets/js/5ec46957.9bace835.js b/assets/js/5ec46957.54ab8441.js similarity index 99% rename from assets/js/5ec46957.9bace835.js rename to assets/js/5ec46957.54ab8441.js index 44cccf78..67f92283 100644 --- a/assets/js/5ec46957.9bace835.js +++ b/assets/js/5ec46957.54ab8441.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[4947],{7577:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>l,contentTitle:()=>o,default:()=>m,frontMatter:()=>i,metadata:()=>r,toc:()=>c});const r=JSON.parse('{"id":"references/imports","title":"Import","description":"The Stylable @st-import at-rule is used to reference definitions from other .st.css or .js modules in a similar way to JavaScript Imports.","source":"@site/docs/references/imports.md","sourceDirName":"references","slug":"/references/imports","permalink":"/docs/references/imports","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/imports.md","tags":[],"version":"current","frontMatter":{"id":"imports","title":"Import"},"sidebar":"Specification Reference","previous":{"title":"Global Selector","permalink":"/docs/references/global-selectors"},"next":{"title":"Namespace","permalink":"/docs/references/namespace"}}');var n=t(4848),a=t(8453);const i={id:"imports",title:"Import"},o=void 0,l={},c=[{value:"Syntax",id:"syntax",level:2},{value:"Default import",id:"default-import",level:3},{value:"Named import",id:"named-import",level:3},{value:"Local alias",id:"local-alias",level:4},{value:"Stylable stylesheet",id:"stylable-stylesheet",level:2},{value:"Named type assertion",id:"named-type-assertion",level:3},{value:"Javascript",id:"javascript",level:2},{value:"Legacy syntax",id:"legacy-syntax",level:2}];function d(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,a.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(s.p,{children:["The Stylable ",(0,n.jsx)(s.code,{children:"@st-import"})," at-rule is used to reference definitions from other ",(0,n.jsx)(s.code,{children:".st.css"})," or ",(0,n.jsx)(s.code,{children:".js"})," modules in a similar way to ",(0,n.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import",children:"JavaScript Imports"}),"."]}),"\n",(0,n.jsx)(s.h2,{id:"syntax",children:"Syntax"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-css",children:"@st-import Default, [namedA, namedB as localB] from 'request';\n"})}),"\n",(0,n.jsx)(s.admonition,{title:"re-declare symbol",type:"info",children:(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"import local names must be unique."}),"\n",(0,n.jsx)(s.li,{children:"Imports are hoisted above local definitions."}),"\n"]})}),"\n",(0,n.jsx)(s.h3,{id:"default-import",children:"Default import"}),"\n",(0,n.jsxs)(s.p,{children:["In order to reference the the default export of a module, provide a local name after the ",(0,n.jsx)(s.code,{children:"@st-import"}),"."]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-css",children:"@st-import DefaultLocalName from 'request';\n"})}),"\n",(0,n.jsx)(s.h3,{id:"named-import",children:"Named import"}),"\n",(0,n.jsx)(s.p,{children:"To reference named exports of a module, in square brackets (after the optional default import), provide a comma separated list of requested names."}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-css",children:"/* named imports */\n@st-import [partA, partB] from 'request';\n\n/* default + named imports */\n@st-import Default, [partA, partB] from 'request';\n"})}),"\n",(0,n.jsx)(s.h4,{id:"local-alias",children:"Local alias"}),"\n",(0,n.jsxs)(s.p,{children:["Use the ",(0,n.jsx)(s.code,{children:"as"})," keyword to map an export name to a local name."]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-css",children:"@st-import [part as localPartName] from 'request';\n"})}),"\n",(0,n.jsx)(s.h2,{id:"stylable-stylesheet",children:"Stylable stylesheet"}),"\n",(0,n.jsxs)(s.p,{children:["When importing from a stylesheet, the ",(0,n.jsx)(s.a,{href:"/docs/references/root#default-export",children:"root"})," class is mapped to the default export, and several named symbols can be referenced by name:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-css",metastring:'title="origin.st.css"',children:"/* define symbols */\n.part {\n --customProp: yellow;\n container-name: part;\n}\n@keyframes anim {}\n@layer comps, theme;\n:vars {\n stVar: green;\n}\n"})}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-css",metastring:'title="entry.st.css"',children:"@st-import OriginRoot, [\n part, /* part class name */\n --customProp, /* custom property */\n stVar /* build var */\n] from './origin.st.css';\n"})}),"\n",(0,n.jsx)(s.admonition,{title:"Stylesheet default capitalization",type:"caution",children:(0,n.jsxs)(s.p,{children:["When importing a ",(0,n.jsx)(s.strong,{children:"default"})," value from a stylable stylesheet, you should use a capital letter to signify that the value represents a component root."]})}),"\n",(0,n.jsx)(s.h3,{id:"named-type-assertion",children:"Named type assertion"}),"\n",(0,n.jsxs)(s.p,{children:["To import keyframes, layers or containers from another stylesheet, a special ",(0,n.jsx)(s.a,{href:"/docs/references/keyframes#import-and-export",children:"keyframes()"}),", ",(0,n.jsx)(s.a,{href:"./layer#import-and-export",children:"layer()"}),", or ",(0,n.jsx)(s.a,{href:"./contains#import-and-export",children:"container()"})," assertion is required."]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-css",metastring:'title="entry.st.css"',children:"/* import keyframe and layer */\n@st-import [\n keyframes(anim),\n layer(theme),\n container(panel)\n] from './origin.st.css';\n\n/* multiple */\n@st-import [\n keyframes(anim1, anim2), \n layer(comps, theme),\n container(panel, header)\n] from './origin.st.css';\n"})}),"\n",(0,n.jsx)(s.h2,{id:"javascript",children:"Javascript"}),"\n",(0,n.jsxs)(s.p,{children:["To import Javascript definitions for ",(0,n.jsx)(s.a,{href:"/docs/references/st-variables",children:"values"}),", ",(0,n.jsx)(s.a,{href:"/docs/references/mixins",children:"mixins"}),", and ",(0,n.jsx)(s.a,{href:"/docs/references/formatters",children:"formatters"}),", use the ",(0,n.jsx)(s.code,{children:"@st-import"})," statement in the same way as you would for a stylesheet."]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-css",children:"@st-import DefaultExport, [namedA, namedB as localB] from './code.js';\n"})}),"\n",(0,n.jsx)(s.h2,{id:"legacy-syntax",children:"Legacy syntax"}),"\n",(0,n.jsxs)(s.p,{children:["An older variation for ",(0,n.jsx)(s.code,{children:"@st-import"})," is the ",(0,n.jsx)(s.code,{children:":import"})," (pseudo-import). While it still works, it is ",(0,n.jsx)(s.strong,{children:"highly discouraged"})," for usage, verbose and will be deprecated in the future."]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-css",children:":import {\n -st-from: 'request';\n -st-default: DefaultLocalName;\n -st-named: namedA, namedB as localB;\n}\n"})}),"\n",(0,n.jsxs)(s.p,{children:["A code-mod to migrate to the new syntax is available (",(0,n.jsx)(s.a,{href:"https://github.com/wix/stylable/tree/master/packages/cli#builtin-codemods",children:"see doc"}),")"]})]})}function m(e={}){const{wrapper:s}={...(0,a.R)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(d,{...e})}):d(e)}},8453:(e,s,t)=>{t.d(s,{R:()=>i,x:()=>o});var r=t(6540);const n={},a=r.createContext(n);function i(e){const s=r.useContext(a);return r.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function o(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:i(e.components),r.createElement(a.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[4947],{6051:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>l,contentTitle:()=>o,default:()=>m,frontMatter:()=>i,metadata:()=>r,toc:()=>c});const r=JSON.parse('{"id":"references/imports","title":"Import","description":"The Stylable @st-import at-rule is used to reference definitions from other .st.css or .js modules in a similar way to JavaScript Imports.","source":"@site/docs/references/imports.md","sourceDirName":"references","slug":"/references/imports","permalink":"/docs/references/imports","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/imports.md","tags":[],"version":"current","frontMatter":{"id":"imports","title":"Import"},"sidebar":"Specification Reference","previous":{"title":"Global Selector","permalink":"/docs/references/global-selectors"},"next":{"title":"Namespace","permalink":"/docs/references/namespace"}}');var n=t(4848),a=t(8453);const i={id:"imports",title:"Import"},o=void 0,l={},c=[{value:"Syntax",id:"syntax",level:2},{value:"Default import",id:"default-import",level:3},{value:"Named import",id:"named-import",level:3},{value:"Local alias",id:"local-alias",level:4},{value:"Stylable stylesheet",id:"stylable-stylesheet",level:2},{value:"Named type assertion",id:"named-type-assertion",level:3},{value:"Javascript",id:"javascript",level:2},{value:"Legacy syntax",id:"legacy-syntax",level:2}];function d(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,a.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(s.p,{children:["The Stylable ",(0,n.jsx)(s.code,{children:"@st-import"})," at-rule is used to reference definitions from other ",(0,n.jsx)(s.code,{children:".st.css"})," or ",(0,n.jsx)(s.code,{children:".js"})," modules in a similar way to ",(0,n.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import",children:"JavaScript Imports"}),"."]}),"\n",(0,n.jsx)(s.h2,{id:"syntax",children:"Syntax"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-css",children:"@st-import Default, [namedA, namedB as localB] from 'request';\n"})}),"\n",(0,n.jsx)(s.admonition,{title:"re-declare symbol",type:"info",children:(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"import local names must be unique."}),"\n",(0,n.jsx)(s.li,{children:"Imports are hoisted above local definitions."}),"\n"]})}),"\n",(0,n.jsx)(s.h3,{id:"default-import",children:"Default import"}),"\n",(0,n.jsxs)(s.p,{children:["In order to reference the the default export of a module, provide a local name after the ",(0,n.jsx)(s.code,{children:"@st-import"}),"."]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-css",children:"@st-import DefaultLocalName from 'request';\n"})}),"\n",(0,n.jsx)(s.h3,{id:"named-import",children:"Named import"}),"\n",(0,n.jsx)(s.p,{children:"To reference named exports of a module, in square brackets (after the optional default import), provide a comma separated list of requested names."}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-css",children:"/* named imports */\n@st-import [partA, partB] from 'request';\n\n/* default + named imports */\n@st-import Default, [partA, partB] from 'request';\n"})}),"\n",(0,n.jsx)(s.h4,{id:"local-alias",children:"Local alias"}),"\n",(0,n.jsxs)(s.p,{children:["Use the ",(0,n.jsx)(s.code,{children:"as"})," keyword to map an export name to a local name."]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-css",children:"@st-import [part as localPartName] from 'request';\n"})}),"\n",(0,n.jsx)(s.h2,{id:"stylable-stylesheet",children:"Stylable stylesheet"}),"\n",(0,n.jsxs)(s.p,{children:["When importing from a stylesheet, the ",(0,n.jsx)(s.a,{href:"/docs/references/root#default-export",children:"root"})," class is mapped to the default export, and several named symbols can be referenced by name:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-css",metastring:'title="origin.st.css"',children:"/* define symbols */\n.part {\n --customProp: yellow;\n container-name: part;\n}\n@keyframes anim {}\n@layer comps, theme;\n:vars {\n stVar: green;\n}\n"})}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-css",metastring:'title="entry.st.css"',children:"@st-import OriginRoot, [\n part, /* part class name */\n --customProp, /* custom property */\n stVar /* build var */\n] from './origin.st.css';\n"})}),"\n",(0,n.jsx)(s.admonition,{title:"Stylesheet default capitalization",type:"caution",children:(0,n.jsxs)(s.p,{children:["When importing a ",(0,n.jsx)(s.strong,{children:"default"})," value from a stylable stylesheet, you should use a capital letter to signify that the value represents a component root."]})}),"\n",(0,n.jsx)(s.h3,{id:"named-type-assertion",children:"Named type assertion"}),"\n",(0,n.jsxs)(s.p,{children:["To import keyframes, layers or containers from another stylesheet, a special ",(0,n.jsx)(s.a,{href:"/docs/references/keyframes#import-and-export",children:"keyframes()"}),", ",(0,n.jsx)(s.a,{href:"./layer#import-and-export",children:"layer()"}),", or ",(0,n.jsx)(s.a,{href:"./contains#import-and-export",children:"container()"})," assertion is required."]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-css",metastring:'title="entry.st.css"',children:"/* import keyframe and layer */\n@st-import [\n keyframes(anim),\n layer(theme),\n container(panel)\n] from './origin.st.css';\n\n/* multiple */\n@st-import [\n keyframes(anim1, anim2), \n layer(comps, theme),\n container(panel, header)\n] from './origin.st.css';\n"})}),"\n",(0,n.jsx)(s.h2,{id:"javascript",children:"Javascript"}),"\n",(0,n.jsxs)(s.p,{children:["To import Javascript definitions for ",(0,n.jsx)(s.a,{href:"/docs/references/st-variables",children:"values"}),", ",(0,n.jsx)(s.a,{href:"/docs/references/mixins",children:"mixins"}),", and ",(0,n.jsx)(s.a,{href:"/docs/references/formatters",children:"formatters"}),", use the ",(0,n.jsx)(s.code,{children:"@st-import"})," statement in the same way as you would for a stylesheet."]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-css",children:"@st-import DefaultExport, [namedA, namedB as localB] from './code.js';\n"})}),"\n",(0,n.jsx)(s.h2,{id:"legacy-syntax",children:"Legacy syntax"}),"\n",(0,n.jsxs)(s.p,{children:["An older variation for ",(0,n.jsx)(s.code,{children:"@st-import"})," is the ",(0,n.jsx)(s.code,{children:":import"})," (pseudo-import). While it still works, it is ",(0,n.jsx)(s.strong,{children:"highly discouraged"})," for usage, verbose and will be deprecated in the future."]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-css",children:":import {\n -st-from: 'request';\n -st-default: DefaultLocalName;\n -st-named: namedA, namedB as localB;\n}\n"})}),"\n",(0,n.jsxs)(s.p,{children:["A code-mod to migrate to the new syntax is available (",(0,n.jsx)(s.a,{href:"https://github.com/wix/stylable/tree/master/packages/cli#builtin-codemods",children:"see doc"}),")"]})]})}function m(e={}){const{wrapper:s}={...(0,a.R)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(d,{...e})}):d(e)}},8453:(e,s,t)=>{t.d(s,{R:()=>i,x:()=>o});var r=t(6540);const n={},a=r.createContext(n);function i(e){const s=r.useContext(a);return r.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function o(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:i(e.components),r.createElement(a.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/6321.989cbb43.js b/assets/js/6321.989cbb43.js new file mode 100644 index 00000000..f261b4ac --- /dev/null +++ b/assets/js/6321.989cbb43.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[6321],{4096:(e,t,s)=>{s.d(t,{in:()=>c,OU:()=>k,Ki:()=>M,kJ:()=>f,x:()=>i,e7:()=>m,J_:()=>p,Gx:()=>C});var a=s(6540),n=s(9532),l=s(6803),r=s(4848);function i(){const e=(0,l.A)(),t=e?.data?.blogMetadata;if(!t)throw new Error("useBlogMetadata() can't be called on the current route because the blog metadata could not be found in route context");return t}const o=a.createContext(null);function c(e){let{children:t,content:s,isBlogPostPage:n=!1}=e;const l=function(e){let{content:t,isBlogPostPage:s}=e;return(0,a.useMemo)((()=>({metadata:t.metadata,frontMatter:t.frontMatter,assets:t.assets,toc:t.toc,isBlogPostPage:s})),[t,s])}({content:s,isBlogPostPage:n});return(0,r.jsx)(o.Provider,{value:l,children:t})}function m(){const e=(0,a.useContext)(o);if(null===e)throw new n.dV("BlogPostProvider");return e}var h=s(6025),d=s(4586);const u=e=>new Date(e).toISOString();function g(e){const t=e.map(v);return{author:1===t.length?t[0]:t}}function x(e,t,s){return e?{image:j({imageUrl:t(e,{absolute:!0}),caption:`title image for the blog post: ${s}`})}:{}}function f(e){const{siteConfig:t}=(0,d.A)(),{withBaseUrl:s}=(0,h.hH)(),{metadata:{blogDescription:a,blogTitle:n,permalink:l}}=e,r=`${t.url}${l}`;return{"@context":"https://schema.org","@type":"Blog","@id":r,mainEntityOfPage:r,headline:n,description:a,blogPost:e.items.map((e=>function(e,t,s){const{assets:a,frontMatter:n,metadata:l}=e,{date:r,title:i,description:o,lastUpdatedAt:c}=l,m=a.image??n.image,h=n.keywords??[],d=`${t.url}${l.permalink}`,f=c?u(c):void 0;return{"@type":"BlogPosting","@id":d,mainEntityOfPage:d,url:d,headline:i,name:i,description:o,datePublished:r,...f?{dateModified:f}:{},...g(l.authors),...x(m,s,i),...h?{keywords:h}:{}}}(e.content,t,s)))}}function p(){const e=i(),{assets:t,metadata:s}=m(),{siteConfig:a}=(0,d.A)(),{withBaseUrl:n}=(0,h.hH)(),{date:l,title:r,description:o,frontMatter:c,lastUpdatedAt:f}=s,p=t.image??c.image,v=c.keywords??[],j=f?u(f):void 0,w=`${a.url}${s.permalink}`;return{"@context":"https://schema.org","@type":"BlogPosting","@id":w,mainEntityOfPage:w,url:w,headline:r,name:r,description:o,datePublished:l,...j?{dateModified:j}:{},...g(s.authors),...x(p,n,r),...v?{keywords:v}:{},isPartOf:{"@type":"Blog","@id":`${a.url}${e.blogBasePath}`,name:e.blogTitle}}}function v(e){return{"@type":"Person",...e.name?{name:e.name}:{},...e.title?{description:e.title}:{},...e.url?{url:e.url}:{},...e.email?{email:e.email}:{},...e.imageURL?{image:e.imageURL}:{}}}function j(e){let{imageUrl:t,caption:s}=e;return{"@type":"ImageObject","@id":t,url:t,contentUrl:t,caption:s}}var w=s(6347),b=s(8774),N=s(1682),A=s(9169);function C(e){const{pathname:t}=(0,w.zy)();return(0,a.useMemo)((()=>e.filter((e=>function(e,t){return!(e.unlisted&&!(0,A.ys)(e.permalink,t))}(e,t)))),[e,t])}function M(e){const t=(0,N.$z)(e,(e=>`${new Date(e.date).getFullYear()}`)),s=Object.entries(t);return s.reverse(),s}function k(e){let{items:t,ulClassName:s,liClassName:a,linkClassName:n,linkActiveClassName:l}=e;return(0,r.jsx)("ul",{className:s,children:t.map((e=>(0,r.jsx)("li",{className:a,children:(0,r.jsx)(b.A,{isNavLink:!0,to:e.permalink,className:n,activeClassName:l,children:e.title})},e.permalink)))})}},8027:(e,t,s)=>{s.d(t,{A:()=>T});var a=s(6540),n=s(4164),l=s(7823),r=s(4581),i=s(1312),o=s(4096),c=s(6342),m=s(1107),h=s(4848);function d(e){let{year:t,yearGroupHeadingClassName:s,children:a}=e;return(0,h.jsxs)("div",{role:"group",children:[(0,h.jsx)(m.A,{as:"h3",className:s,children:t}),a]})}function u(e){let{items:t,yearGroupHeadingClassName:s,ListComponent:a}=e;if((0,c.p)().blog.sidebar.groupByYear){const e=(0,o.Ki)(t);return(0,h.jsx)(h.Fragment,{children:e.map((e=>{let[t,n]=e;return(0,h.jsx)(d,{year:t,yearGroupHeadingClassName:s,children:(0,h.jsx)(a,{items:n})},t)}))})}return(0,h.jsx)(a,{items:t})}const g=(0,a.memo)(u),x="sidebar_re4s",f="sidebarItemTitle_pO2u",p="sidebarItemList_Yudw",v="sidebarItem__DBe",j="sidebarItemLink_mo7H",w="sidebarItemLinkActive_I1ZP",b="yearGroupHeading_rMGB",N=e=>{let{items:t}=e;return(0,h.jsx)(o.OU,{items:t,ulClassName:(0,n.A)(p,"clean-list"),liClassName:v,linkClassName:j,linkActiveClassName:w})};function A(e){let{sidebar:t}=e;const s=(0,o.Gx)(t.items);return(0,h.jsx)("aside",{className:"col col--3",children:(0,h.jsxs)("nav",{className:(0,n.A)(x,"thin-scrollbar"),"aria-label":(0,i.T)({id:"theme.blog.sidebar.navAriaLabel",message:"Blog recent posts navigation",description:"The ARIA label for recent posts in the blog sidebar"}),children:[(0,h.jsx)("div",{className:(0,n.A)(f,"margin-bottom--md"),children:t.title}),(0,h.jsx)(g,{items:s,ListComponent:N,yearGroupHeadingClassName:b})]})})}const C=(0,a.memo)(A);var M=s(5600);const k="yearGroupHeading_QT03",y=e=>{let{items:t}=e;return(0,h.jsx)(o.OU,{items:t,ulClassName:"menu__list",liClassName:"menu__list-item",linkClassName:"menu__link",linkActiveClassName:"menu__link--active"})};function _(e){let{sidebar:t}=e;const s=(0,o.Gx)(t.items);return(0,h.jsx)(g,{items:s,ListComponent:y,yearGroupHeadingClassName:k})}function P(e){return(0,h.jsx)(M.GX,{component:_,props:e})}const B=(0,a.memo)(P);function I(e){let{sidebar:t}=e;const s=(0,r.l)();return t?.items.length?"mobile"===s?(0,h.jsx)(B,{sidebar:t}):(0,h.jsx)(C,{sidebar:t}):null}function T(e){const{sidebar:t,toc:s,children:a,...r}=e,i=t&&t.items.length>0;return(0,h.jsx)(l.A,{...r,children:(0,h.jsx)("div",{className:"container margin-vert--lg",children:(0,h.jsxs)("div",{className:"row",children:[(0,h.jsx)(I,{sidebar:t}),(0,h.jsx)("main",{className:(0,n.A)("col",{"col--7":i,"col--9 col--offset-1":!i}),children:a}),s&&(0,h.jsx)("div",{className:"col col--2",children:s})]})})})}},4387:(e,t,s)=>{s.d(t,{A:()=>E});var a=s(6540),n=s(4164),l=s(4096),r=s(4848);function i(e){let{children:t,className:s}=e;return(0,r.jsx)("article",{className:s,children:t})}var o=s(8774);const c={title:"title_f1Hy"};function m(e){let{className:t}=e;const{metadata:s,isBlogPostPage:a}=(0,l.e7)(),{permalink:i,title:m}=s,h=a?"h1":"h2";return(0,r.jsx)(h,{className:(0,n.A)(c.title,t),children:a?m:(0,r.jsx)(o.A,{to:i,children:m})})}var h=s(1312),d=s(5846),u=s(6266);const g={container:"container_mt6G"};function x(e){let{readingTime:t}=e;const s=function(){const{selectMessage:e}=(0,d.W)();return t=>{const s=Math.ceil(t);return e(s,(0,h.T)({id:"theme.blog.post.readingTime.plurals",description:'Pluralized label for "{readingTime} min read". Use as much plural forms (separated by "|") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)',message:"One min read|{readingTime} min read"},{readingTime:s}))}}();return(0,r.jsx)(r.Fragment,{children:s(t)})}function f(e){let{date:t,formattedDate:s}=e;return(0,r.jsx)("time",{dateTime:t,children:s})}function p(){return(0,r.jsx)(r.Fragment,{children:" \xb7 "})}function v(e){let{className:t}=e;const{metadata:s}=(0,l.e7)(),{date:a,readingTime:i}=s,o=(0,u.i)({day:"numeric",month:"long",year:"numeric",timeZone:"UTC"});return(0,r.jsxs)("div",{className:(0,n.A)(g.container,"margin-vert--md",t),children:[(0,r.jsx)(f,{date:a,formattedDate:(c=a,o.format(new Date(c)))}),void 0!==i&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p,{}),(0,r.jsx)(x,{readingTime:i})]})]});var c}const j="githubSvg_Uu4N";const w="xSvg_y3PF";const b=function(e){return(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[(0,r.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),(0,r.jsx)("path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0"}),(0,r.jsx)("path",{d:"M3.6 9h16.8"}),(0,r.jsx)("path",{d:"M3.6 15h16.8"}),(0,r.jsx)("path",{d:"M11.5 3a17 17 0 0 0 0 18"}),(0,r.jsx)("path",{d:"M12.5 3a17 17 0 0 1 0 18"})]})};const N="instagramSvg_YC40";const A="threadsSvg_PTXY";const C={authorSocials:"authorSocials_rSDt",authorSocialLink:"authorSocialLink_owbf",authorSocialIcon:"authorSocialIcon_XYv3"},M={twitter:{Icon:function(e){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 209",width:"1em",height:"1em",preserveAspectRatio:"xMidYMid",...e,children:(0,r.jsx)("path",{d:"M256 25.45c-9.42 4.177-19.542 7-30.166 8.27 10.845-6.5 19.172-16.793 23.093-29.057a105.183 105.183 0 0 1-33.351 12.745C205.995 7.201 192.346.822 177.239.822c-29.006 0-52.523 23.516-52.523 52.52 0 4.117.465 8.125 1.36 11.97-43.65-2.191-82.35-23.1-108.255-54.876-4.52 7.757-7.11 16.78-7.11 26.404 0 18.222 9.273 34.297 23.365 43.716a52.312 52.312 0 0 1-23.79-6.57c-.003.22-.003.44-.003.661 0 25.447 18.104 46.675 42.13 51.5a52.592 52.592 0 0 1-23.718.9c6.683 20.866 26.08 36.05 49.062 36.475-17.975 14.086-40.622 22.483-65.228 22.483-4.24 0-8.42-.249-12.529-.734 23.243 14.902 50.85 23.597 80.51 23.597 96.607 0 149.434-80.031 149.434-149.435 0-2.278-.05-4.543-.152-6.795A106.748 106.748 0 0 0 256 25.45",fill:"#55acee"})})},label:"Twitter"},github:{Icon:function(e){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 250",preserveAspectRatio:"xMidYMid",style:{"--dark":"#000","--light":"#fff"},...e,className:(0,n.A)(e.className,j),children:(0,r.jsx)("path",{d:"M128.001 0C57.317 0 0 57.307 0 128.001c0 56.554 36.676 104.535 87.535 121.46 6.397 1.185 8.746-2.777 8.746-6.158 0-3.052-.12-13.135-.174-23.83-35.61 7.742-43.124-15.103-43.124-15.103-5.823-14.795-14.213-18.73-14.213-18.73-11.613-7.944.876-7.78.876-7.78 12.853.902 19.621 13.19 19.621 13.19 11.417 19.568 29.945 13.911 37.249 10.64 1.149-8.272 4.466-13.92 8.127-17.116-28.431-3.236-58.318-14.212-58.318-63.258 0-13.975 5-25.394 13.188-34.358-1.329-3.224-5.71-16.242 1.24-33.874 0 0 10.749-3.44 35.21 13.121 10.21-2.836 21.16-4.258 32.038-4.307 10.878.049 21.837 1.47 32.066 4.307 24.431-16.56 35.165-13.12 35.165-13.12 6.967 17.63 2.584 30.65 1.255 33.873 8.207 8.964 13.173 20.383 13.173 34.358 0 49.163-29.944 59.988-58.447 63.157 4.591 3.972 8.682 11.762 8.682 23.704 0 17.126-.148 30.91-.148 35.126 0 3.407 2.304 7.398 8.792 6.14C219.37 232.5 256 184.537 256 128.002 256 57.307 198.691 0 128.001 0Zm-80.06 182.34c-.282.636-1.283.827-2.194.39-.929-.417-1.45-1.284-1.15-1.922.276-.655 1.279-.838 2.205-.399.93.418 1.46 1.293 1.139 1.931Zm6.296 5.618c-.61.566-1.804.303-2.614-.591-.837-.892-.994-2.086-.375-2.66.63-.566 1.787-.301 2.626.591.838.903 1 2.088.363 2.66Zm4.32 7.188c-.785.545-2.067.034-2.86-1.104-.784-1.138-.784-2.503.017-3.05.795-.547 2.058-.055 2.861 1.075.782 1.157.782 2.522-.019 3.08Zm7.304 8.325c-.701.774-2.196.566-3.29-.49-1.119-1.032-1.43-2.496-.726-3.27.71-.776 2.213-.558 3.315.49 1.11 1.03 1.45 2.505.701 3.27Zm9.442 2.81c-.31 1.003-1.75 1.459-3.199 1.033-1.448-.439-2.395-1.613-2.103-2.626.301-1.01 1.747-1.484 3.207-1.028 1.446.436 2.396 1.602 2.095 2.622Zm10.744 1.193c.036 1.055-1.193 1.93-2.715 1.95-1.53.034-2.769-.82-2.786-1.86 0-1.065 1.202-1.932 2.733-1.958 1.522-.03 2.768.818 2.768 1.868Zm10.555-.405c.182 1.03-.875 2.088-2.387 2.37-1.485.271-2.861-.365-3.05-1.386-.184-1.056.893-2.114 2.376-2.387 1.514-.263 2.868.356 3.061 1.403Z"})})},label:"GitHub"},stackoverflow:{Icon:function(e){return(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 169.61 200",width:"1em",height:"1em",...e,children:[(0,r.jsx)("path",{d:"M140.44 178.38v-48.65h21.61V200H0v-70.27h21.61v48.65z",fill:"#bcbbbb"}),(0,r.jsx)("path",{d:"M124.24 140.54l4.32-16.22-86.97-17.83-3.78 17.83zM49.7 82.16L130.72 120l7.56-16.22-81.02-37.83zm22.68-40l68.06 57.3 11.35-13.51-68.6-57.3-11.35 13.51zM116.14 0l-14.59 10.81 53.48 71.89 14.58-10.81zM37.81 162.16h86.43v-16.21H37.81z",fill:"#f48024"})]})},label:"Stack Overflow"},linkedin:{Icon:function(e){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",preserveAspectRatio:"xMidYMid",viewBox:"0 0 256 256",...e,children:(0,r.jsx)("path",{d:"M218.123 218.127h-37.931v-59.403c0-14.165-.253-32.4-19.728-32.4-19.756 0-22.779 15.434-22.779 31.369v60.43h-37.93V95.967h36.413v16.694h.51a39.907 39.907 0 0 1 35.928-19.733c38.445 0 45.533 25.288 45.533 58.186l-.016 67.013ZM56.955 79.27c-12.157.002-22.014-9.852-22.016-22.009-.002-12.157 9.851-22.014 22.008-22.016 12.157-.003 22.014 9.851 22.016 22.008A22.013 22.013 0 0 1 56.955 79.27m18.966 138.858H37.95V95.967h37.97v122.16ZM237.033.018H18.89C8.58-.098.125 8.161-.001 18.471v219.053c.122 10.315 8.576 18.582 18.89 18.474h218.144c10.336.128 18.823-8.139 18.966-18.474V18.454c-.147-10.33-8.635-18.588-18.966-18.453",fill:"#0A66C2"})})},label:"LinkedIn"},x:{Icon:function(e){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 1200 1227",style:{"--dark":"#000","--light":"#fff"},...e,className:(0,n.A)(e.className,w),children:(0,r.jsx)("path",{d:"M714.163 519.284 1160.89 0h-105.86L667.137 450.887 357.328 0H0l468.492 681.821L0 1226.37h105.866l409.625-476.152 327.181 476.152H1200L714.137 519.284h.026ZM569.165 687.828l-47.468-67.894-377.686-540.24h162.604l304.797 435.991 47.468 67.894 396.2 566.721H892.476L569.165 687.854v-.026Z"})})},label:"X"},bluesky:{Icon:function(e){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",preserveAspectRatio:"xMidYMid",viewBox:"0 0 256 226",...e,children:(0,r.jsx)("path",{fill:"#1185FE",d:"M55.491 15.172c29.35 22.035 60.917 66.712 72.509 90.686 11.592-23.974 43.159-68.651 72.509-90.686C221.686-.727 256-13.028 256 26.116c0 7.818-4.482 65.674-7.111 75.068-9.138 32.654-42.436 40.983-72.057 35.942 51.775 8.812 64.946 38 36.501 67.187-54.021 55.433-77.644-13.908-83.696-31.676-1.11-3.257-1.63-4.78-1.637-3.485-.008-1.296-.527.228-1.637 3.485-6.052 17.768-29.675 87.11-83.696 31.676-28.445-29.187-15.274-58.375 36.5-67.187-29.62 5.041-62.918-3.288-72.056-35.942C4.482 91.79 0 33.934 0 26.116 0-13.028 34.314-.727 55.491 15.172Z"})})},label:"Bluesky"},instagram:{Icon:function(e){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",preserveAspectRatio:"xMidYMid",viewBox:"0 0 256 256",style:{"--dark":"#000","--light":"#fff"},...e,className:(0,n.A)(e.className,N),children:(0,r.jsx)("path",{d:"M128 23.064c34.177 0 38.225.13 51.722.745 12.48.57 19.258 2.655 23.769 4.408 5.974 2.322 10.238 5.096 14.717 9.575 4.48 4.479 7.253 8.743 9.575 14.717 1.753 4.511 3.838 11.289 4.408 23.768.615 13.498.745 17.546.745 51.723 0 34.178-.13 38.226-.745 51.723-.57 12.48-2.655 19.257-4.408 23.768-2.322 5.974-5.096 10.239-9.575 14.718-4.479 4.479-8.743 7.253-14.717 9.574-4.511 1.753-11.289 3.839-23.769 4.408-13.495.616-17.543.746-51.722.746-34.18 0-38.228-.13-51.723-.746-12.48-.57-19.257-2.655-23.768-4.408-5.974-2.321-10.239-5.095-14.718-9.574-4.479-4.48-7.253-8.744-9.574-14.718-1.753-4.51-3.839-11.288-4.408-23.768-.616-13.497-.746-17.545-.746-51.723 0-34.177.13-38.225.746-51.722.57-12.48 2.655-19.258 4.408-23.769 2.321-5.974 5.095-10.238 9.574-14.717 4.48-4.48 8.744-7.253 14.718-9.575 4.51-1.753 11.288-3.838 23.768-4.408 13.497-.615 17.545-.745 51.723-.745M128 0C93.237 0 88.878.147 75.226.77c-13.625.622-22.93 2.786-31.071 5.95-8.418 3.271-15.556 7.648-22.672 14.764C14.367 28.6 9.991 35.738 6.72 44.155 3.555 52.297 1.392 61.602.77 75.226.147 88.878 0 93.237 0 128c0 34.763.147 39.122.77 52.774.622 13.625 2.785 22.93 5.95 31.071 3.27 8.417 7.647 15.556 14.763 22.672 7.116 7.116 14.254 11.492 22.672 14.763 8.142 3.165 17.446 5.328 31.07 5.95 13.653.623 18.012.77 52.775.77s39.122-.147 52.774-.77c13.624-.622 22.929-2.785 31.07-5.95 8.418-3.27 15.556-7.647 22.672-14.763 7.116-7.116 11.493-14.254 14.764-22.672 3.164-8.142 5.328-17.446 5.95-31.07.623-13.653.77-18.012.77-52.775s-.147-39.122-.77-52.774c-.622-13.624-2.786-22.929-5.95-31.07-3.271-8.418-7.648-15.556-14.764-22.672C227.4 14.368 220.262 9.99 211.845 6.72c-8.142-3.164-17.447-5.328-31.071-5.95C167.122.147 162.763 0 128 0Zm0 62.27C91.698 62.27 62.27 91.7 62.27 128c0 36.302 29.428 65.73 65.73 65.73 36.301 0 65.73-29.428 65.73-65.73 0-36.301-29.429-65.73-65.73-65.73Zm0 108.397c-23.564 0-42.667-19.103-42.667-42.667S104.436 85.333 128 85.333s42.667 19.103 42.667 42.667-19.103 42.667-42.667 42.667Zm83.686-110.994c0 8.484-6.876 15.36-15.36 15.36-8.483 0-15.36-6.876-15.36-15.36 0-8.483 6.877-15.36 15.36-15.36 8.484 0 15.36 6.877 15.36 15.36Z"})})},label:"Instagram"},threads:{Icon:function(e){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg","aria-label":"Threads",viewBox:"0 0 192 192",width:"1em",fill:"none",height:"1em",style:{"--dark":"#000","--light":"#fff"},...e,className:(0,n.A)(e.className,A),children:(0,r.jsx)("path",{d:"M141.537 88.988a66.667 66.667 0 0 0-2.518-1.143c-1.482-27.307-16.403-42.94-41.457-43.1h-.34c-14.986 0-27.449 6.396-35.12 18.036l13.779 9.452c5.73-8.695 14.724-10.548 21.348-10.548h.229c8.249.053 14.474 2.452 18.503 7.129 2.932 3.405 4.893 8.111 5.864 14.05-7.314-1.243-15.224-1.626-23.68-1.14-23.82 1.371-39.134 15.264-38.105 34.568.522 9.792 5.4 18.216 13.735 23.719 7.047 4.652 16.124 6.927 25.557 6.412 12.458-.683 22.231-5.436 29.049-14.127 5.178-6.6 8.453-15.153 9.899-25.93 5.937 3.583 10.337 8.298 12.767 13.966 4.132 9.635 4.373 25.468-8.546 38.376-11.319 11.308-24.925 16.2-45.488 16.351-22.809-.169-40.06-7.484-51.275-21.742C35.236 139.966 29.808 120.682 29.605 96c.203-24.682 5.63-43.966 16.133-57.317C56.954 24.425 74.204 17.11 97.013 16.94c22.975.17 40.526 7.52 52.171 21.847 5.71 7.026 10.015 15.86 12.853 26.162l16.147-4.308c-3.44-12.68-8.853-23.606-16.219-32.668C147.036 9.607 125.202.195 97.07 0h-.113C68.882.194 47.292 9.642 32.788 28.08 19.882 44.485 13.224 67.315 13.001 95.932L13 96v.067c.224 28.617 6.882 51.447 19.788 67.854C47.292 182.358 68.882 191.806 96.957 192h.113c24.96-.173 42.554-6.708 57.048-21.189 18.963-18.945 18.392-42.692 12.142-57.27-4.484-10.454-13.033-18.945-24.723-24.553ZM98.44 129.507c-10.44.588-21.286-4.098-21.82-14.135-.397-7.442 5.296-15.746 22.461-16.735 1.966-.114 3.895-.169 5.79-.169 6.235 0 12.068.606 17.371 1.765-1.978 24.702-13.58 28.713-23.802 29.274Z"})})},label:"Threads"},mastodon:{Icon:function(e){const t=(0,a.useId)();return(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 61 65",width:"1em",height:"1em",...e,children:[(0,r.jsx)("path",{fill:`url(#${t})`,d:"M60.754 14.39C59.814 7.406 53.727 1.903 46.512.836 45.294.656 40.682 0 29.997 0h-.08C19.23 0 16.938.656 15.72.836 8.705 1.873 2.299 6.82.745 13.886c-.748 3.48-.828 7.338-.689 10.877.198 5.075.237 10.142.697 15.197a71.482 71.482 0 0 0 1.664 9.968c1.477 6.056 7.458 11.096 13.317 13.152a35.718 35.718 0 0 0 19.484 1.028 28.365 28.365 0 0 0 2.107-.576c1.572-.5 3.413-1.057 4.766-2.038a.154.154 0 0 0 .062-.118v-4.899a.146.146 0 0 0-.055-.111.145.145 0 0 0-.122-.028 54 54 0 0 1-12.644 1.478c-7.328 0-9.298-3.478-9.863-4.925a15.258 15.258 0 0 1-.857-3.882.142.142 0 0 1 .178-.145 52.976 52.976 0 0 0 12.437 1.477c1.007 0 2.012 0 3.02-.026 4.213-.119 8.654-.334 12.8-1.144.103-.02.206-.038.295-.065 6.539-1.255 12.762-5.196 13.394-15.176.024-.393.083-4.115.083-4.523.003-1.386.446-9.829-.065-15.017Z"}),(0,r.jsx)("path",{fill:"#fff",d:"M50.394 22.237v17.35H43.52V22.749c0-3.545-1.478-5.353-4.483-5.353-3.303 0-4.958 2.139-4.958 6.364v9.217h-6.835V23.76c0-4.225-1.657-6.364-4.96-6.364-2.988 0-4.48 1.808-4.48 5.353v16.84H10.93V22.237c0-3.545.905-6.362 2.715-8.45 1.868-2.082 4.317-3.152 7.358-3.152 3.519 0 6.178 1.354 7.951 4.057l1.711 2.871 1.714-2.871c1.773-2.704 4.432-4.056 7.945-4.056 3.038 0 5.487 1.069 7.36 3.152 1.81 2.085 2.712 4.902 2.71 8.449Z"}),(0,r.jsx)("defs",{children:(0,r.jsxs)("linearGradient",{id:t,x1:30.5,x2:30.5,y1:0,y2:65,gradientUnits:"userSpaceOnUse",children:[(0,r.jsx)("stop",{stopColor:"#6364FF"}),(0,r.jsx)("stop",{offset:1,stopColor:"#563ACC"})]})})]})},label:"Mastodon"},youtube:{Icon:function(e){return(0,r.jsxs)("svg",{viewBox:"0 0 256 180",width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid",...e,children:[(0,r.jsx)("path",{d:"M250.346 28.075A32.18 32.18 0 0 0 227.69 5.418C207.824 0 127.87 0 127.87 0S47.912.164 28.046 5.582A32.18 32.18 0 0 0 5.39 28.24c-6.009 35.298-8.34 89.084.165 122.97a32.18 32.18 0 0 0 22.656 22.657c19.866 5.418 99.822 5.418 99.822 5.418s79.955 0 99.82-5.418a32.18 32.18 0 0 0 22.657-22.657c6.338-35.348 8.291-89.1-.164-123.134Z",fill:"red"}),(0,r.jsx)("path",{fill:"#FFF",d:"m102.421 128.06 66.328-38.418-66.328-38.418z"})]})},label:"YouTube"},twitch:{Icon:function(e){return(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",x:0,y:0,viewBox:"0 0 2400 2800",width:"1em",height:"1em",...e,children:[(0,r.jsx)("path",{d:"m2200 1300-400 400h-400l-350 350v-350H600V200h1600z",fill:"#fff"}),(0,r.jsxs)("g",{children:[(0,r.jsx)("path",{d:"M500 0 0 500v1800h600v500l500-500h400l900-900V0H500zm1700 1300-400 400h-400l-350 350v-350H600V200h1600v1100z",fill:"#9146ff"}),(0,r.jsx)("path",{d:"M1700 550h200v600h-200zM1150 550h200v600h-200z",fill:"#9146ff"})]})]})},label:"Twitch"}};function k(e){let{platform:t,link:s}=e;const{Icon:a,label:l}=M[i=t]??{Icon:b,label:i};var i;return(0,r.jsx)(o.A,{className:C.authorSocialLink,href:s,title:l,children:(0,r.jsx)(a,{className:(0,n.A)(C.authorSocialLink)})})}function y(e){let{author:t}=e;const s=Object.entries(t.socials??{});return(0,r.jsx)("div",{className:C.authorSocials,children:s.map((e=>{let[t,s]=e;return(0,r.jsx)(k,{platform:t,link:s},t)}))})}var _=s(1107);const P={authorImage:"authorImage_XqGP","author-as-h1":"author-as-h1_n9oJ","author-as-h2":"author-as-h2_gXvM",authorDetails:"authorDetails_lV9A",authorName:"authorName_yefp",authorTitle:"authorTitle_nd0D",authorBlogPostCount:"authorBlogPostCount_iiJ5"};function B(e){return e.href?(0,r.jsx)(o.A,{...e}):(0,r.jsx)(r.Fragment,{children:e.children})}function I(e){let{title:t}=e;return(0,r.jsx)("small",{className:P.authorTitle,title:t,children:t})}function T(e){let{name:t,as:s}=e;return s?(0,r.jsx)(_.A,{as:s,className:P.authorName,children:t}):(0,r.jsx)("span",{className:P.authorName,children:t})}function L(e){let{count:t}=e;return(0,r.jsx)("span",{className:(0,n.A)(P.authorBlogPostCount),children:t})}function U(e){let{as:t,author:s,className:a,count:l}=e;const{name:i,title:o,url:c,imageURL:m,email:h,page:d}=s,u=d?.permalink||c||h&&`mailto:${h}`||void 0;return(0,r.jsxs)("div",{className:(0,n.A)("avatar margin-bottom--sm",a,P[`author-as-${t}`]),children:[m&&(0,r.jsx)(B,{href:u,className:"avatar__photo-link",children:(0,r.jsx)("img",{className:(0,n.A)("avatar__photo",P.authorImage),src:m,alt:i})}),(i||o)&&(0,r.jsxs)("div",{className:(0,n.A)("avatar__intro",P.authorDetails),children:[(0,r.jsxs)("div",{className:"avatar__name",children:[i&&(0,r.jsx)(B,{href:u,children:(0,r.jsx)(T,{name:i,as:t})}),void 0!==l&&(0,r.jsx)(L,{count:l})]}),!!o&&(0,r.jsx)(I,{title:o}),(0,r.jsx)(y,{author:s})]})]})}const H={authorCol:"authorCol_Hf19",imageOnlyAuthorRow:"imageOnlyAuthorRow_pa_O",imageOnlyAuthorCol:"imageOnlyAuthorCol_G86a"};function O(e){let{className:t}=e;const{metadata:{authors:s},assets:a}=(0,l.e7)();if(0===s.length)return null;const i=s.every((e=>{let{name:t}=e;return!t})),o=1===s.length;return(0,r.jsx)("div",{className:(0,n.A)("margin-top--md margin-bottom--sm",i?H.imageOnlyAuthorRow:"row",t),children:s.map(((e,t)=>(0,r.jsx)("div",{className:(0,n.A)(!i&&(o?"col col--12":"col col--6"),i?H.imageOnlyAuthorCol:H.authorCol),children:(0,r.jsx)(U,{author:{...e,imageURL:a.authorsImageUrls[t]??e.imageURL}})},t)))})}function Z(){return(0,r.jsxs)("header",{children:[(0,r.jsx)(m,{}),(0,r.jsx)(v,{}),(0,r.jsx)(O,{})]})}var F=s(440),R=s(5425);function $(e){let{children:t,className:s}=e;const{isBlogPostPage:a}=(0,l.e7)();return(0,r.jsx)("div",{id:a?F.LU:void 0,className:(0,n.A)("markdown",s),children:(0,r.jsx)(R.A,{children:t})})}var S=s(7559),G=s(4336),z=s(2053);function D(){return(0,r.jsx)("b",{children:(0,r.jsx)(h.A,{id:"theme.blog.post.readMore",description:"The label used in blog post item excerpts to link to full blog posts",children:"Read more"})})}function Y(e){const{blogPostTitle:t,...s}=e;return(0,r.jsx)(o.A,{"aria-label":(0,h.T)({message:"Read more about {title}",id:"theme.blog.post.readMoreLabel",description:"The ARIA label for the link to full blog posts from excerpts"},{title:t}),...s,children:(0,r.jsx)(D,{})})}function V(){const{metadata:e,isBlogPostPage:t}=(0,l.e7)(),{tags:s,title:a,editUrl:i,hasTruncateMarker:o,lastUpdatedBy:c,lastUpdatedAt:m}=e,h=!t&&o,d=s.length>0;if(!(d||h||i))return null;if(t){const e=!!(i||m||c);return(0,r.jsxs)("footer",{className:"docusaurus-mt-lg",children:[d&&(0,r.jsx)("div",{className:(0,n.A)("row","margin-top--sm",S.G.blog.blogFooterEditMetaRow),children:(0,r.jsx)("div",{className:"col",children:(0,r.jsx)(z.A,{tags:s})})}),e&&(0,r.jsx)(G.A,{className:(0,n.A)("margin-top--sm",S.G.blog.blogFooterEditMetaRow),editUrl:i,lastUpdatedAt:m,lastUpdatedBy:c})]})}return(0,r.jsxs)("footer",{className:"row docusaurus-mt-lg",children:[d&&(0,r.jsx)("div",{className:(0,n.A)("col",{"col--9":h}),children:(0,r.jsx)(z.A,{tags:s})}),h&&(0,r.jsx)("div",{className:(0,n.A)("col text--right",{"col--3":d}),children:(0,r.jsx)(Y,{blogPostTitle:a,to:e.permalink})})]})}function E(e){let{children:t,className:s}=e;const a=function(){const{isBlogPostPage:e}=(0,l.e7)();return e?void 0:"margin-bottom--xl"}();return(0,r.jsxs)(i,{className:(0,n.A)(a,s),children:[(0,r.jsx)(Z,{}),(0,r.jsx)($,{children:t}),(0,r.jsx)(V,{})]})}},5846:(e,t,s)=>{s.d(t,{W:()=>c});var a=s(6540),n=s(4586);const l=["zero","one","two","few","many","other"];function r(e){return l.filter((t=>e.includes(t)))}const i={locale:"en",pluralForms:r(["one","other"]),select:e=>1===e?"one":"other"};function o(){const{i18n:{currentLocale:e}}=(0,n.A)();return(0,a.useMemo)((()=>{try{return function(e){const t=new Intl.PluralRules(e);return{locale:e,pluralForms:r(t.resolvedOptions().pluralCategories),select:e=>t.select(e)}}(e)}catch(t){return console.error(`Failed to use Intl.PluralRules for locale "${e}".\nDocusaurus will fallback to the default (English) implementation.\nError: ${t.message}\n`),i}}),[e])}function c(){const e=o();return{selectMessage:(t,s)=>function(e,t,s){const a=e.split("|");if(1===a.length)return a[0];a.length>s.pluralForms.length&&console.error(`For locale=${s.locale}, a maximum of ${s.pluralForms.length} plural forms are expected (${s.pluralForms.join(",")}), but the message contains ${a.length}: ${e}`);const n=s.select(t),l=s.pluralForms.indexOf(n);return a[Math.min(l,a.length-1)]}(s,t,e)}}}}]); \ No newline at end of file diff --git a/assets/js/4562.a79c15e0.js b/assets/js/6369.e7b75b19.js similarity index 62% rename from assets/js/4562.a79c15e0.js rename to assets/js/6369.e7b75b19.js index 7eb165d4..233661f0 100644 --- a/assets/js/4562.a79c15e0.js +++ b/assets/js/6369.e7b75b19.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[4562],{4182:(e,n,t)=>{t.d(n,{A:()=>M});var i=t(6540),a=t(4848);function s(e){const{mdxAdmonitionTitle:n,rest:t}=function(e){const n=i.Children.toArray(e),t=n.find((e=>i.isValidElement(e)&&"mdxAdmonitionTitle"===e.type)),s=n.filter((e=>e!==t)),l=t?.props.children;return{mdxAdmonitionTitle:l,rest:s.length>0?(0,a.jsx)(a.Fragment,{children:s}):null}}(e.children),s=e.title??n;return{...e,...s&&{title:s},children:t}}var l=t(4164),r=t(3230),c=t(8630);const d="admonition_xJq3",o="admonitionHeading_Gvgb",u="admonitionIcon_Rf37",h="admonitionContent_BuS1";function m(e){let{type:n,className:t,children:i}=e;return(0,a.jsx)("div",{className:(0,l.A)(c.G.common.admonition,c.G.common.admonitionType(n),d,t),children:i})}function x(e){let{icon:n,title:t}=e;return(0,a.jsxs)("div",{className:o,children:[(0,a.jsx)("span",{className:u,children:n}),t]})}function p(e){let{children:n}=e;return n?(0,a.jsx)("div",{className:h,children:n}):null}function j(e){const{type:n,icon:t,title:i,children:s,className:l}=e;return(0,a.jsxs)(m,{type:n,className:l,children:[i||t?(0,a.jsx)(x,{title:i,icon:t}):null,(0,a.jsx)(p,{children:s})]})}function f(e){return(0,a.jsx)("svg",{viewBox:"0 0 14 16",...e,children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})})}const g={icon:(0,a.jsx)(f,{}),title:(0,a.jsx)(r.A,{id:"theme.admonition.note",description:"The default label used for the Note admonition (:::note)",children:"note"})};function v(e){return(0,a.jsx)(j,{...g,...e,className:(0,l.A)("alert alert--secondary",e.className),children:e.children})}function A(e){return(0,a.jsx)("svg",{viewBox:"0 0 12 16",...e,children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})})}const N={icon:(0,a.jsx)(A,{}),title:(0,a.jsx)(r.A,{id:"theme.admonition.tip",description:"The default label used for the Tip admonition (:::tip)",children:"tip"})};function y(e){return(0,a.jsx)(j,{...N,...e,className:(0,l.A)("alert alert--success",e.className),children:e.children})}function b(e){return(0,a.jsx)("svg",{viewBox:"0 0 14 16",...e,children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})})}const _={icon:(0,a.jsx)(b,{}),title:(0,a.jsx)(r.A,{id:"theme.admonition.info",description:"The default label used for the Info admonition (:::info)",children:"info"})};function w(e){return(0,a.jsx)(j,{..._,...e,className:(0,l.A)("alert alert--info",e.className),children:e.children})}function U(e){return(0,a.jsx)("svg",{viewBox:"0 0 16 16",...e,children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})})}const C={icon:(0,a.jsx)(U,{}),title:(0,a.jsx)(r.A,{id:"theme.admonition.warning",description:"The default label used for the Warning admonition (:::warning)",children:"warning"})};function T(e){return(0,a.jsx)("svg",{viewBox:"0 0 12 16",...e,children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})})}const z={icon:(0,a.jsx)(T,{}),title:(0,a.jsx)(r.A,{id:"theme.admonition.danger",description:"The default label used for the Danger admonition (:::danger)",children:"danger"})};const k={icon:(0,a.jsx)(U,{}),title:(0,a.jsx)(r.A,{id:"theme.admonition.caution",description:"The default label used for the Caution admonition (:::caution)",children:"caution"})};const B={...{note:v,tip:y,info:w,warning:function(e){return(0,a.jsx)(j,{...C,...e,className:(0,l.A)("alert alert--warning",e.className),children:e.children})},danger:function(e){return(0,a.jsx)(j,{...z,...e,className:(0,l.A)("alert alert--danger",e.className),children:e.children})}},...{secondary:e=>(0,a.jsx)(v,{title:"secondary",...e}),important:e=>(0,a.jsx)(w,{title:"important",...e}),success:e=>(0,a.jsx)(y,{title:"success",...e}),caution:function(e){return(0,a.jsx)(j,{...k,...e,className:(0,l.A)("alert alert--warning",e.className),children:e.children})}}};function M(e){const n=s(e),t=(i=n.type,B[i]||(console.warn(`No admonition component found for admonition type "${i}". Using Info as fallback.`),B.info));var i;return(0,a.jsx)(t,{...n})}},5659:(e,n,t)=>{t.d(n,{A:()=>j});t(6540);var i=t(4164),a=t(3230),s=t(8630),l=t(4783);const r={iconEdit:"iconEdit_Z9Sw"};var c=t(4848);function d(e){let{className:n,...t}=e;return(0,c.jsx)("svg",{fill:"currentColor",height:"20",width:"20",viewBox:"0 0 40 40",className:(0,i.A)(r.iconEdit,n),"aria-hidden":"true",...t,children:(0,c.jsx)("g",{children:(0,c.jsx)("path",{d:"m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"})})})}function o(e){let{editUrl:n}=e;return(0,c.jsxs)(l.A,{to:n,className:s.G.common.editThisPage,children:[(0,c.jsx)(d,{}),(0,c.jsx)(a.A,{id:"theme.common.editThisPage",description:"The link label to edit the current page",children:"Edit this page"})]})}var u=t(9191);function h(e){let{lastUpdatedAt:n}=e;const t=new Date(n),i=(0,u.i)({day:"numeric",month:"short",year:"numeric",timeZone:"UTC"}).format(t);return(0,c.jsx)(a.A,{id:"theme.lastUpdated.atDate",description:"The words used to describe on which date a page has been last updated",values:{date:(0,c.jsx)("b",{children:(0,c.jsx)("time",{dateTime:t.toISOString(),itemProp:"dateModified",children:i})})},children:" on {date}"})}function m(e){let{lastUpdatedBy:n}=e;return(0,c.jsx)(a.A,{id:"theme.lastUpdated.byUser",description:"The words used to describe by who the page has been last updated",values:{user:(0,c.jsx)("b",{children:n})},children:" by {user}"})}function x(e){let{lastUpdatedAt:n,lastUpdatedBy:t}=e;return(0,c.jsxs)("span",{className:s.G.common.lastUpdated,children:[(0,c.jsx)(a.A,{id:"theme.lastUpdated.lastUpdatedAtBy",description:"The sentence used to display when a page has been last updated, and by who",values:{atDate:n?(0,c.jsx)(h,{lastUpdatedAt:n}):"",byUser:t?(0,c.jsx)(m,{lastUpdatedBy:t}):""},children:"Last updated{atDate}{byUser}"}),!1]})}const p={lastUpdated:"lastUpdated_JAkA"};function j(e){let{className:n,editUrl:t,lastUpdatedAt:a,lastUpdatedBy:s}=e;return(0,c.jsxs)("div",{className:(0,i.A)("row",n),children:[(0,c.jsx)("div",{className:"col",children:t&&(0,c.jsx)(o,{editUrl:t})}),(0,c.jsx)("div",{className:(0,i.A)("col",p.lastUpdated),children:(a||s)&&(0,c.jsx)(x,{lastUpdatedAt:a,lastUpdatedBy:s})})]})}},600:(e,n,t)=>{t.d(n,{A:()=>k});var i=t(6540),a=t(8453),s=t(1141),l=t(2250),r=t(4848);function c(e){return(0,r.jsx)("code",{...e})}var d=t(4783);var o=t(4164),u=t(7344),h=t(1062),m=t(4549);const x="details_lb9f",p="isBrowser_bmU9",j="collapsibleContent_i85q";function f(e){return!!e&&("SUMMARY"===e.tagName||f(e.parentElement))}function g(e,n){return!!e&&(e===n||g(e.parentElement,n))}function v(e){let{summary:n,children:t,...a}=e;(0,u.A)().collectAnchor(a.id);const s=(0,h.A)(),l=(0,i.useRef)(null),{collapsed:c,setCollapsed:d}=(0,m.u)({initialState:!a.open}),[v,A]=(0,i.useState)(a.open),N=i.isValidElement(n)?n:(0,r.jsx)("summary",{children:n??"Details"});return(0,r.jsxs)("details",{...a,ref:l,open:v,"data-collapsed":c,className:(0,o.A)(x,s&&p,a.className),onMouseDown:e=>{f(e.target)&&e.detail>1&&e.preventDefault()},onClick:e=>{e.stopPropagation();const n=e.target;f(n)&&g(n,l.current)&&(e.preventDefault(),c?(d(!1),A(!0)):d(!0))},children:[N,(0,r.jsx)(m.N,{lazy:!1,collapsed:c,disableSSRStyle:!0,onCollapseTransitionEnd:e=>{d(e),A(!e)},children:(0,r.jsx)("div",{className:j,children:t})})]})}const A="details_b_Ee";function N(e){let{...n}=e;return(0,r.jsx)(v,{...n,className:(0,o.A)("alert alert--info",A,n.className)})}function y(e){const n=i.Children.toArray(e.children),t=n.find((e=>i.isValidElement(e)&&"summary"===e.type)),a=(0,r.jsx)(r.Fragment,{children:n.filter((e=>e!==t))});return(0,r.jsx)(N,{...e,summary:t,children:a})}var b=t(5225);function _(e){return(0,r.jsx)(b.A,{...e})}const w="containsTaskList_mC6p";function U(e){if(void 0!==e)return(0,o.A)(e,e?.includes("contains-task-list")&&w)}const C="img_ev3q";var T=t(4182);const z={Head:s.A,details:y,Details:y,code:function(e){return function(e){return void 0!==e.children&&i.Children.toArray(e.children).every((e=>"string"==typeof e&&!e.includes("\n")))}(e)?(0,r.jsx)(c,{...e}):(0,r.jsx)(l.A,{...e})},a:function(e){return(0,r.jsx)(d.A,{...e})},pre:function(e){return(0,r.jsx)(r.Fragment,{children:e.children})},ul:function(e){return(0,r.jsx)("ul",{...e,className:U(e.className)})},li:function(e){return(0,u.A)().collectAnchor(e.id),(0,r.jsx)("li",{...e})},img:function(e){return(0,r.jsx)("img",{decoding:"async",loading:"lazy",...e,className:(n=e.className,(0,o.A)(n,C))});var n},h1:e=>(0,r.jsx)(_,{as:"h1",...e}),h2:e=>(0,r.jsx)(_,{as:"h2",...e}),h3:e=>(0,r.jsx)(_,{as:"h3",...e}),h4:e=>(0,r.jsx)(_,{as:"h4",...e}),h5:e=>(0,r.jsx)(_,{as:"h5",...e}),h6:e=>(0,r.jsx)(_,{as:"h6",...e}),admonition:T.A,mermaid:()=>null};function k(e){let{children:n}=e;return(0,r.jsx)(a.x,{components:z,children:n})}},3555:(e,n,t)=>{t.d(n,{A:()=>l});t(6540);var i=t(4164),a=t(4783),s=t(4848);function l(e){const{permalink:n,title:t,subLabel:l,isNext:r}=e;return(0,s.jsxs)(a.A,{className:(0,i.A)("pagination-nav__link",r?"pagination-nav__link--next":"pagination-nav__link--prev"),to:n,children:[l&&(0,s.jsx)("div",{className:"pagination-nav__sublabel",children:l}),(0,s.jsx)("div",{className:"pagination-nav__label",children:t})]})}},1883:(e,n,t)=>{t.d(n,{A:()=>r});t(6540);var i=t(4164),a=t(4783);const s={tag:"tag_zVej",tagRegular:"tagRegular_sFm0",tagWithCount:"tagWithCount_h2kH"};var l=t(4848);function r(e){let{permalink:n,label:t,count:r,description:c}=e;return(0,l.jsxs)(a.A,{href:n,title:c,className:(0,i.A)(s.tag,r?s.tagWithCount:s.tagRegular),children:[t,r&&(0,l.jsx)("span",{children:r})]})}},1113:(e,n,t)=>{t.d(n,{A:()=>c});t(6540);var i=t(4164),a=t(3230),s=t(1883);const l={tags:"tags_jXut",tag:"tag_QGVx"};var r=t(4848);function c(e){let{tags:n}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(a.A,{id:"theme.tags.tagsListLabel",description:"The label alongside a tag list",children:"Tags:"})}),(0,r.jsx)("ul",{className:(0,i.A)(l.tags,"padding--none","margin-left--sm"),children:n.map((e=>(0,r.jsx)("li",{className:l.tag,children:(0,r.jsx)(s.A,{...e})},e.permalink)))})]})}},9191:(e,n,t)=>{t.d(n,{i:()=>a});var i=t(7639);function a(e){void 0===e&&(e={});const{i18n:{currentLocale:n}}=(0,i.A)(),t=function(){const{i18n:{currentLocale:e,localeConfigs:n}}=(0,i.A)();return n[e].calendar}();return new Intl.DateTimeFormat(n,{calendar:t,...e})}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[6369],{7293:(e,n,t)=>{t.d(n,{A:()=>M});var i=t(6540),a=t(4848);function s(e){const{mdxAdmonitionTitle:n,rest:t}=function(e){const n=i.Children.toArray(e),t=n.find((e=>i.isValidElement(e)&&"mdxAdmonitionTitle"===e.type)),s=n.filter((e=>e!==t)),l=t?.props.children;return{mdxAdmonitionTitle:l,rest:s.length>0?(0,a.jsx)(a.Fragment,{children:s}):null}}(e.children),s=e.title??n;return{...e,...s&&{title:s},children:t}}var l=t(4164),r=t(1312),c=t(7559);const d="admonition_xJq3",o="admonitionHeading_Gvgb",u="admonitionIcon_Rf37",h="admonitionContent_BuS1";function m(e){let{type:n,className:t,children:i}=e;return(0,a.jsx)("div",{className:(0,l.A)(c.G.common.admonition,c.G.common.admonitionType(n),d,t),children:i})}function x(e){let{icon:n,title:t}=e;return(0,a.jsxs)("div",{className:o,children:[(0,a.jsx)("span",{className:u,children:n}),t]})}function p(e){let{children:n}=e;return n?(0,a.jsx)("div",{className:h,children:n}):null}function j(e){const{type:n,icon:t,title:i,children:s,className:l}=e;return(0,a.jsxs)(m,{type:n,className:l,children:[i||t?(0,a.jsx)(x,{title:i,icon:t}):null,(0,a.jsx)(p,{children:s})]})}function f(e){return(0,a.jsx)("svg",{viewBox:"0 0 14 16",...e,children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})})}const g={icon:(0,a.jsx)(f,{}),title:(0,a.jsx)(r.A,{id:"theme.admonition.note",description:"The default label used for the Note admonition (:::note)",children:"note"})};function v(e){return(0,a.jsx)(j,{...g,...e,className:(0,l.A)("alert alert--secondary",e.className),children:e.children})}function A(e){return(0,a.jsx)("svg",{viewBox:"0 0 12 16",...e,children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})})}const N={icon:(0,a.jsx)(A,{}),title:(0,a.jsx)(r.A,{id:"theme.admonition.tip",description:"The default label used for the Tip admonition (:::tip)",children:"tip"})};function y(e){return(0,a.jsx)(j,{...N,...e,className:(0,l.A)("alert alert--success",e.className),children:e.children})}function b(e){return(0,a.jsx)("svg",{viewBox:"0 0 14 16",...e,children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})})}const _={icon:(0,a.jsx)(b,{}),title:(0,a.jsx)(r.A,{id:"theme.admonition.info",description:"The default label used for the Info admonition (:::info)",children:"info"})};function w(e){return(0,a.jsx)(j,{..._,...e,className:(0,l.A)("alert alert--info",e.className),children:e.children})}function U(e){return(0,a.jsx)("svg",{viewBox:"0 0 16 16",...e,children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})})}const C={icon:(0,a.jsx)(U,{}),title:(0,a.jsx)(r.A,{id:"theme.admonition.warning",description:"The default label used for the Warning admonition (:::warning)",children:"warning"})};function T(e){return(0,a.jsx)("svg",{viewBox:"0 0 12 16",...e,children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})})}const z={icon:(0,a.jsx)(T,{}),title:(0,a.jsx)(r.A,{id:"theme.admonition.danger",description:"The default label used for the Danger admonition (:::danger)",children:"danger"})};const k={icon:(0,a.jsx)(U,{}),title:(0,a.jsx)(r.A,{id:"theme.admonition.caution",description:"The default label used for the Caution admonition (:::caution)",children:"caution"})};const B={...{note:v,tip:y,info:w,warning:function(e){return(0,a.jsx)(j,{...C,...e,className:(0,l.A)("alert alert--warning",e.className),children:e.children})},danger:function(e){return(0,a.jsx)(j,{...z,...e,className:(0,l.A)("alert alert--danger",e.className),children:e.children})}},...{secondary:e=>(0,a.jsx)(v,{title:"secondary",...e}),important:e=>(0,a.jsx)(w,{title:"important",...e}),success:e=>(0,a.jsx)(y,{title:"success",...e}),caution:function(e){return(0,a.jsx)(j,{...k,...e,className:(0,l.A)("alert alert--warning",e.className),children:e.children})}}};function M(e){const n=s(e),t=(i=n.type,B[i]||(console.warn(`No admonition component found for admonition type "${i}". Using Info as fallback.`),B.info));var i;return(0,a.jsx)(t,{...n})}},4336:(e,n,t)=>{t.d(n,{A:()=>j});t(6540);var i=t(4164),a=t(1312),s=t(7559),l=t(8774);const r={iconEdit:"iconEdit_Z9Sw"};var c=t(4848);function d(e){let{className:n,...t}=e;return(0,c.jsx)("svg",{fill:"currentColor",height:"20",width:"20",viewBox:"0 0 40 40",className:(0,i.A)(r.iconEdit,n),"aria-hidden":"true",...t,children:(0,c.jsx)("g",{children:(0,c.jsx)("path",{d:"m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"})})})}function o(e){let{editUrl:n}=e;return(0,c.jsxs)(l.A,{to:n,className:s.G.common.editThisPage,children:[(0,c.jsx)(d,{}),(0,c.jsx)(a.A,{id:"theme.common.editThisPage",description:"The link label to edit the current page",children:"Edit this page"})]})}var u=t(6266);function h(e){let{lastUpdatedAt:n}=e;const t=new Date(n),i=(0,u.i)({day:"numeric",month:"short",year:"numeric",timeZone:"UTC"}).format(t);return(0,c.jsx)(a.A,{id:"theme.lastUpdated.atDate",description:"The words used to describe on which date a page has been last updated",values:{date:(0,c.jsx)("b",{children:(0,c.jsx)("time",{dateTime:t.toISOString(),itemProp:"dateModified",children:i})})},children:" on {date}"})}function m(e){let{lastUpdatedBy:n}=e;return(0,c.jsx)(a.A,{id:"theme.lastUpdated.byUser",description:"The words used to describe by who the page has been last updated",values:{user:(0,c.jsx)("b",{children:n})},children:" by {user}"})}function x(e){let{lastUpdatedAt:n,lastUpdatedBy:t}=e;return(0,c.jsxs)("span",{className:s.G.common.lastUpdated,children:[(0,c.jsx)(a.A,{id:"theme.lastUpdated.lastUpdatedAtBy",description:"The sentence used to display when a page has been last updated, and by who",values:{atDate:n?(0,c.jsx)(h,{lastUpdatedAt:n}):"",byUser:t?(0,c.jsx)(m,{lastUpdatedBy:t}):""},children:"Last updated{atDate}{byUser}"}),!1]})}const p={lastUpdated:"lastUpdated_JAkA"};function j(e){let{className:n,editUrl:t,lastUpdatedAt:a,lastUpdatedBy:s}=e;return(0,c.jsxs)("div",{className:(0,i.A)("row",n),children:[(0,c.jsx)("div",{className:"col",children:t&&(0,c.jsx)(o,{editUrl:t})}),(0,c.jsx)("div",{className:(0,i.A)("col",p.lastUpdated),children:(a||s)&&(0,c.jsx)(x,{lastUpdatedAt:a,lastUpdatedBy:s})})]})}},5425:(e,n,t)=>{t.d(n,{A:()=>k});var i=t(6540),a=t(8453),s=t(5260),l=t(1432),r=t(4848);function c(e){return(0,r.jsx)("code",{...e})}var d=t(8774);var o=t(4164),u=t(3427),h=t(2303),m=t(1422);const x="details_lb9f",p="isBrowser_bmU9",j="collapsibleContent_i85q";function f(e){return!!e&&("SUMMARY"===e.tagName||f(e.parentElement))}function g(e,n){return!!e&&(e===n||g(e.parentElement,n))}function v(e){let{summary:n,children:t,...a}=e;(0,u.A)().collectAnchor(a.id);const s=(0,h.A)(),l=(0,i.useRef)(null),{collapsed:c,setCollapsed:d}=(0,m.u)({initialState:!a.open}),[v,A]=(0,i.useState)(a.open),N=i.isValidElement(n)?n:(0,r.jsx)("summary",{children:n??"Details"});return(0,r.jsxs)("details",{...a,ref:l,open:v,"data-collapsed":c,className:(0,o.A)(x,s&&p,a.className),onMouseDown:e=>{f(e.target)&&e.detail>1&&e.preventDefault()},onClick:e=>{e.stopPropagation();const n=e.target;f(n)&&g(n,l.current)&&(e.preventDefault(),c?(d(!1),A(!0)):d(!0))},children:[N,(0,r.jsx)(m.N,{lazy:!1,collapsed:c,disableSSRStyle:!0,onCollapseTransitionEnd:e=>{d(e),A(!e)},children:(0,r.jsx)("div",{className:j,children:t})})]})}const A="details_b_Ee";function N(e){let{...n}=e;return(0,r.jsx)(v,{...n,className:(0,o.A)("alert alert--info",A,n.className)})}function y(e){const n=i.Children.toArray(e.children),t=n.find((e=>i.isValidElement(e)&&"summary"===e.type)),a=(0,r.jsx)(r.Fragment,{children:n.filter((e=>e!==t))});return(0,r.jsx)(N,{...e,summary:t,children:a})}var b=t(1107);function _(e){return(0,r.jsx)(b.A,{...e})}const w="containsTaskList_mC6p";function U(e){if(void 0!==e)return(0,o.A)(e,e?.includes("contains-task-list")&&w)}const C="img_ev3q";var T=t(7293);const z={Head:s.A,details:y,Details:y,code:function(e){return function(e){return void 0!==e.children&&i.Children.toArray(e.children).every((e=>"string"==typeof e&&!e.includes("\n")))}(e)?(0,r.jsx)(c,{...e}):(0,r.jsx)(l.A,{...e})},a:function(e){return(0,r.jsx)(d.A,{...e})},pre:function(e){return(0,r.jsx)(r.Fragment,{children:e.children})},ul:function(e){return(0,r.jsx)("ul",{...e,className:U(e.className)})},li:function(e){return(0,u.A)().collectAnchor(e.id),(0,r.jsx)("li",{...e})},img:function(e){return(0,r.jsx)("img",{decoding:"async",loading:"lazy",...e,className:(n=e.className,(0,o.A)(n,C))});var n},h1:e=>(0,r.jsx)(_,{as:"h1",...e}),h2:e=>(0,r.jsx)(_,{as:"h2",...e}),h3:e=>(0,r.jsx)(_,{as:"h3",...e}),h4:e=>(0,r.jsx)(_,{as:"h4",...e}),h5:e=>(0,r.jsx)(_,{as:"h5",...e}),h6:e=>(0,r.jsx)(_,{as:"h6",...e}),admonition:T.A,mermaid:()=>null};function k(e){let{children:n}=e;return(0,r.jsx)(a.x,{components:z,children:n})}},9022:(e,n,t)=>{t.d(n,{A:()=>l});t(6540);var i=t(4164),a=t(8774),s=t(4848);function l(e){const{permalink:n,title:t,subLabel:l,isNext:r}=e;return(0,s.jsxs)(a.A,{className:(0,i.A)("pagination-nav__link",r?"pagination-nav__link--next":"pagination-nav__link--prev"),to:n,children:[l&&(0,s.jsx)("div",{className:"pagination-nav__sublabel",children:l}),(0,s.jsx)("div",{className:"pagination-nav__label",children:t})]})}},6133:(e,n,t)=>{t.d(n,{A:()=>r});t(6540);var i=t(4164),a=t(8774);const s={tag:"tag_zVej",tagRegular:"tagRegular_sFm0",tagWithCount:"tagWithCount_h2kH"};var l=t(4848);function r(e){let{permalink:n,label:t,count:r,description:c}=e;return(0,l.jsxs)(a.A,{href:n,title:c,className:(0,i.A)(s.tag,r?s.tagWithCount:s.tagRegular),children:[t,r&&(0,l.jsx)("span",{children:r})]})}},2053:(e,n,t)=>{t.d(n,{A:()=>c});t(6540);var i=t(4164),a=t(1312),s=t(6133);const l={tags:"tags_jXut",tag:"tag_QGVx"};var r=t(4848);function c(e){let{tags:n}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("b",{children:(0,r.jsx)(a.A,{id:"theme.tags.tagsListLabel",description:"The label alongside a tag list",children:"Tags:"})}),(0,r.jsx)("ul",{className:(0,i.A)(l.tags,"padding--none","margin-left--sm"),children:n.map((e=>(0,r.jsx)("li",{className:l.tag,children:(0,r.jsx)(s.A,{...e})},e.permalink)))})]})}},6266:(e,n,t)=>{t.d(n,{i:()=>a});var i=t(4586);function a(e){void 0===e&&(e={});const{i18n:{currentLocale:n}}=(0,i.A)(),t=function(){const{i18n:{currentLocale:e,localeConfigs:n}}=(0,i.A)();return n[e].calendar}();return new Intl.DateTimeFormat(n,{calendar:t,...e})}}}]); \ No newline at end of file diff --git a/assets/js/6875c492.60a17926.js b/assets/js/6875c492.1a2369d8.js similarity index 81% rename from assets/js/6875c492.60a17926.js rename to assets/js/6875c492.1a2369d8.js index c245ca5b..d158b6a3 100644 --- a/assets/js/6875c492.60a17926.js +++ b/assets/js/6875c492.1a2369d8.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[4813],{4934:(e,t,n)=>{n.d(t,{A:()=>r});n(6540);var s=n(3230),i=n(3555),a=n(4848);function r(e){const{metadata:t}=e,{previousPage:n,nextPage:r}=t;return(0,a.jsxs)("nav",{className:"pagination-nav","aria-label":(0,s.T)({id:"theme.blog.paginator.navAriaLabel",message:"Blog list page navigation",description:"The ARIA label for the blog pagination"}),children:[n&&(0,a.jsx)(i.A,{permalink:n,title:(0,a.jsx)(s.A,{id:"theme.blog.paginator.newerEntries",description:"The label used to navigate to the newer blog posts page (previous page)",children:"Newer entries"})}),r&&(0,a.jsx)(i.A,{permalink:r,title:(0,a.jsx)(s.A,{id:"theme.blog.paginator.olderEntries",description:"The label used to navigate to the older blog posts page (next page)",children:"Older entries"}),isNext:!0})]})}},4331:(e,t,n)=>{n.d(t,{A:()=>r});n(6540);var s=n(9101),i=n(8406),a=n(4848);function r(e){let{items:t,component:n=i.A}=e;return(0,a.jsx)(a.Fragment,{children:t.map((e=>{let{content:t}=e;return(0,a.jsx)(s.in,{content:t,children:(0,a.jsx)(n,{children:(0,a.jsx)(t,{})})},t.metadata.permalink)}))})}},6942:(e,t,n)=>{n.r(t),n.d(t,{default:()=>A});n(6540);var s=n(4164),i=n(3230),a=n(6644),r=n(8630),l=n(7824),o=n(4848);function c(){const{selectMessage:e}=(0,l.W)();return t=>e(t,(0,i.T)({id:"theme.blog.post.plurals",description:'Pluralized label for "{count} posts". Use as much plural forms (separated by "|") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)',message:"One post|{count} posts"},{count:t}))}function d(e){const t=c();return(0,i.T)({id:"theme.blog.tagTitle",description:"The title of the page for a blog tag",message:'{nPosts} tagged with "{tagName}"'},{nPosts:t(e.count),tagName:e.label})}var g=n(4783),u=n(6953),h=n(4934),p=n(1210),m=n(4331),x=n(8811),b=n(5225);function j(e){let{tag:t}=e;const n=d(t);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(a.be,{title:n,description:t.description}),(0,o.jsx)(p.A,{tag:"blog_tags_posts"})]})}function f(e){let{tag:t,items:n,sidebar:s,listMetadata:a}=e;const r=d(t);return(0,o.jsxs)(u.A,{sidebar:s,children:[t.unlisted&&(0,o.jsx)(x.A,{}),(0,o.jsxs)("header",{className:"margin-bottom--xl",children:[(0,o.jsx)(b.A,{as:"h1",children:r}),t.description&&(0,o.jsx)("p",{children:t.description}),(0,o.jsx)(g.A,{href:t.allTagsPath,children:(0,o.jsx)(i.A,{id:"theme.tags.tagsPageLink",description:"The label of the link targeting the tag list page",children:"View All Tags"})})]}),(0,o.jsx)(m.A,{items:n}),(0,o.jsx)(h.A,{metadata:a})]})}function A(e){return(0,o.jsxs)(a.e3,{className:(0,s.A)(r.G.wrapper.blogPages,r.G.page.blogTagPostListPage),children:[(0,o.jsx)(j,{...e}),(0,o.jsx)(f,{...e})]})}},8811:(e,t,n)=>{n.d(t,{A:()=>c});n(6540);var s=n(4164),i=n(6907),a=n(8630),r=n(4182),l=n(4848);function o(e){let{className:t}=e;return(0,l.jsx)(r.A,{type:"caution",title:(0,l.jsx)(i.Rc,{}),className:(0,s.A)(t,a.G.common.unlistedBanner),children:(0,l.jsx)(i.Uh,{})})}function c(e){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(i.AE,{}),(0,l.jsx)(o,{...e})]})}},6907:(e,t,n)=>{n.d(t,{AE:()=>o,Rc:()=>r,TT:()=>d,Uh:()=>l,Yh:()=>c});n(6540);var s=n(3230),i=n(1141),a=n(4848);function r(){return(0,a.jsx)(s.A,{id:"theme.contentVisibility.unlistedBanner.title",description:"The unlisted content banner title",children:"Unlisted page"})}function l(){return(0,a.jsx)(s.A,{id:"theme.contentVisibility.unlistedBanner.message",description:"The unlisted content banner message",children:"This page is unlisted. Search engines will not index it, and only users having a direct link can access it."})}function o(){return(0,a.jsx)(i.A,{children:(0,a.jsx)("meta",{name:"robots",content:"noindex, nofollow"})})}function c(){return(0,a.jsx)(s.A,{id:"theme.contentVisibility.draftBanner.title",description:"The draft content banner title",children:"Draft page"})}function d(){return(0,a.jsx)(s.A,{id:"theme.contentVisibility.draftBanner.message",description:"The draft content banner message",children:"This page is a draft. It will only be visible in dev and be excluded from the production build."})}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[4813],{7713:(e,t,n)=>{n.d(t,{A:()=>r});n(6540);var s=n(1312),i=n(9022),a=n(4848);function r(e){const{metadata:t}=e,{previousPage:n,nextPage:r}=t;return(0,a.jsxs)("nav",{className:"pagination-nav","aria-label":(0,s.T)({id:"theme.blog.paginator.navAriaLabel",message:"Blog list page navigation",description:"The ARIA label for the blog pagination"}),children:[n&&(0,a.jsx)(i.A,{permalink:n,title:(0,a.jsx)(s.A,{id:"theme.blog.paginator.newerEntries",description:"The label used to navigate to the newer blog posts page (previous page)",children:"Newer entries"})}),r&&(0,a.jsx)(i.A,{permalink:r,title:(0,a.jsx)(s.A,{id:"theme.blog.paginator.olderEntries",description:"The label used to navigate to the older blog posts page (next page)",children:"Older entries"}),isNext:!0})]})}},3892:(e,t,n)=>{n.d(t,{A:()=>r});n(6540);var s=n(4096),i=n(4387),a=n(4848);function r(e){let{items:t,component:n=i.A}=e;return(0,a.jsx)(a.Fragment,{children:t.map((e=>{let{content:t}=e;return(0,a.jsx)(s.in,{content:t,children:(0,a.jsx)(n,{children:(0,a.jsx)(t,{})})},t.metadata.permalink)}))})}},1086:(e,t,n)=>{n.r(t),n.d(t,{default:()=>A});n(6540);var s=n(4164),i=n(1312),a=n(1213),r=n(7559),l=n(5846),o=n(4848);function c(){const{selectMessage:e}=(0,l.W)();return t=>e(t,(0,i.T)({id:"theme.blog.post.plurals",description:'Pluralized label for "{count} posts". Use as much plural forms (separated by "|") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)',message:"One post|{count} posts"},{count:t}))}function d(e){const t=c();return(0,i.T)({id:"theme.blog.tagTitle",description:"The title of the page for a blog tag",message:'{nPosts} tagged with "{tagName}"'},{nPosts:t(e.count),tagName:e.label})}var g=n(8774),u=n(8027),h=n(7713),p=n(1463),m=n(3892),x=n(2234),b=n(1107);function j(e){let{tag:t}=e;const n=d(t);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(a.be,{title:n,description:t.description}),(0,o.jsx)(p.A,{tag:"blog_tags_posts"})]})}function f(e){let{tag:t,items:n,sidebar:s,listMetadata:a}=e;const r=d(t);return(0,o.jsxs)(u.A,{sidebar:s,children:[t.unlisted&&(0,o.jsx)(x.A,{}),(0,o.jsxs)("header",{className:"margin-bottom--xl",children:[(0,o.jsx)(b.A,{as:"h1",children:r}),t.description&&(0,o.jsx)("p",{children:t.description}),(0,o.jsx)(g.A,{href:t.allTagsPath,children:(0,o.jsx)(i.A,{id:"theme.tags.tagsPageLink",description:"The label of the link targeting the tag list page",children:"View All Tags"})})]}),(0,o.jsx)(m.A,{items:n}),(0,o.jsx)(h.A,{metadata:a})]})}function A(e){return(0,o.jsxs)(a.e3,{className:(0,s.A)(r.G.wrapper.blogPages,r.G.page.blogTagPostListPage),children:[(0,o.jsx)(j,{...e}),(0,o.jsx)(f,{...e})]})}},2234:(e,t,n)=>{n.d(t,{A:()=>c});n(6540);var s=n(4164),i=n(4084),a=n(7559),r=n(7293),l=n(4848);function o(e){let{className:t}=e;return(0,l.jsx)(r.A,{type:"caution",title:(0,l.jsx)(i.Rc,{}),className:(0,s.A)(t,a.G.common.unlistedBanner),children:(0,l.jsx)(i.Uh,{})})}function c(e){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(i.AE,{}),(0,l.jsx)(o,{...e})]})}},4084:(e,t,n)=>{n.d(t,{AE:()=>o,Rc:()=>r,TT:()=>d,Uh:()=>l,Yh:()=>c});n(6540);var s=n(1312),i=n(5260),a=n(4848);function r(){return(0,a.jsx)(s.A,{id:"theme.contentVisibility.unlistedBanner.title",description:"The unlisted content banner title",children:"Unlisted page"})}function l(){return(0,a.jsx)(s.A,{id:"theme.contentVisibility.unlistedBanner.message",description:"The unlisted content banner message",children:"This page is unlisted. Search engines will not index it, and only users having a direct link can access it."})}function o(){return(0,a.jsx)(i.A,{children:(0,a.jsx)("meta",{name:"robots",content:"noindex, nofollow"})})}function c(){return(0,a.jsx)(s.A,{id:"theme.contentVisibility.draftBanner.title",description:"The draft content banner title",children:"Draft page"})}function d(){return(0,a.jsx)(s.A,{id:"theme.contentVisibility.draftBanner.message",description:"The draft content banner message",children:"This page is a draft. It will only be visible in dev and be excluded from the production build."})}}}]); \ No newline at end of file diff --git a/assets/js/6e96288b.48e5e2fb.js b/assets/js/6e96288b.f3c8303e.js similarity index 98% rename from assets/js/6e96288b.48e5e2fb.js rename to assets/js/6e96288b.f3c8303e.js index a00c7b17..221fbca4 100644 --- a/assets/js/6e96288b.48e5e2fb.js +++ b/assets/js/6e96288b.f3c8303e.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[5457],{2738:(n,e,t)=>{t.r(e),t.d(e,{assets:()=>a,contentTitle:()=>r,default:()=>p,frontMatter:()=>i,metadata:()=>o,toc:()=>l});const o=JSON.parse('{"id":"guides/component-variants","title":"Component Variants","description":"When building a component library or an application, it is useful to define several semantic \\"flavors\\" of some components, for example a Button component that represents cancel.","source":"@site/docs/guides/component-variants.md","sourceDirName":"guides","slug":"/guides/component-variants","permalink":"/docs/guides/component-variants","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/guides/component-variants.md","tags":[],"version":"current","frontMatter":{"id":"component-variants","title":"Component Variants"},"sidebar":"Guides","previous":{"title":"Shared Classes","permalink":"/docs/guides/shared-classes"},"next":{"title":"Server Side Rendering","permalink":"/docs/guides/ssr"}}');var s=t(4848),c=t(8453);const i={id:"component-variants",title:"Component Variants"},r=void 0,a={},l=[{value:"Defining a component variant",id:"defining-a-component-variant",level:2},{value:"Use component variants in components",id:"use-component-variants-in-components",level:2}];function d(n){const e={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",...(0,c.R)(),...n.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(e.p,{children:['When building a component library or an application, it is useful to define several semantic "flavors" of some components, for example a ',(0,s.jsx)(e.code,{children:"Button"})," component that represents ",(0,s.jsx)(e.code,{children:"cancel"}),"."]}),"\n",(0,s.jsx)(e.h2,{id:"defining-a-component-variant",children:"Defining a component variant"}),"\n",(0,s.jsxs)(e.p,{children:["In your project's ",(0,s.jsx)(e.a,{href:"/docs/guides/project-commons",children:"Stylable stylesheet"})," used for the commonly used components in your project (usually named ",(0,s.jsx)(e.code,{children:"project.st.css"}),") you:"]}),"\n",(0,s.jsxs)(e.ol,{children:["\n",(0,s.jsx)(e.li,{children:"Import a component stylesheet."}),"\n",(0,s.jsxs)(e.li,{children:["Define a CSS class with a descriptive name like ",(0,s.jsx)(e.code,{children:"cancelButton"}),"."]}),"\n",(0,s.jsx)(e.li,{children:"Extend the component on the class you just defined."}),"\n"]}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-css",metastring:'title="project.st.css"',children:'@st-import Button from "./button.st.css";\n\n.cancelButton {\n -st-extend: Button;\n color: red;\n border: 1px solid red;\n}\n'})}),"\n",(0,s.jsx)(e.h2,{id:"use-component-variants-in-components",children:"Use component variants in components"}),"\n",(0,s.jsxs)(e.p,{children:["A component ",(0,s.jsx)(e.strong,{children:"Stylable"})," stylesheet can use and extend component variants:"]}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-css",metastring:'title="comp.st.css"',children:'@st-import [cancelButton] from "./project.st.css";\n\n/*\nselector: .comp__root .project__cancelButton.button__root\njs value: "project__cancelButton"\n*/\n.root .cancelButton {\n}\n/*\nselector: .comp__cancel.project__cancelButton.button__root\njs value: "comp__cancel project__cancelButton"\n*/\n.cancel {\n -st-extends: cancelButton;\n}\n'})}),"\n",(0,s.jsx)(e.admonition,{type:"note",children:(0,s.jsxs)(e.p,{children:["For the ",(0,s.jsx)(e.code,{children:".cancelButton"})," selector, we manually added the ",(0,s.jsx)(e.code,{children:".root"})," class to avoid overriding ",(0,s.jsx)(e.code,{children:"cancelButton"})," outside this scope."]})})]})}function p(n={}){const{wrapper:e}={...(0,c.R)(),...n.components};return e?(0,s.jsx)(e,{...n,children:(0,s.jsx)(d,{...n})}):d(n)}},8453:(n,e,t)=>{t.d(e,{R:()=>i,x:()=>r});var o=t(6540);const s={},c=o.createContext(s);function i(n){const e=o.useContext(c);return o.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function r(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(s):n.components||s:i(n.components),o.createElement(c.Provider,{value:e},n.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[5457],{9866:(n,e,t)=>{t.r(e),t.d(e,{assets:()=>a,contentTitle:()=>r,default:()=>p,frontMatter:()=>i,metadata:()=>o,toc:()=>l});const o=JSON.parse('{"id":"guides/component-variants","title":"Component Variants","description":"When building a component library or an application, it is useful to define several semantic \\"flavors\\" of some components, for example a Button component that represents cancel.","source":"@site/docs/guides/component-variants.md","sourceDirName":"guides","slug":"/guides/component-variants","permalink":"/docs/guides/component-variants","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/guides/component-variants.md","tags":[],"version":"current","frontMatter":{"id":"component-variants","title":"Component Variants"},"sidebar":"Guides","previous":{"title":"Shared Classes","permalink":"/docs/guides/shared-classes"},"next":{"title":"Server Side Rendering","permalink":"/docs/guides/ssr"}}');var s=t(4848),c=t(8453);const i={id:"component-variants",title:"Component Variants"},r=void 0,a={},l=[{value:"Defining a component variant",id:"defining-a-component-variant",level:2},{value:"Use component variants in components",id:"use-component-variants-in-components",level:2}];function d(n){const e={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",...(0,c.R)(),...n.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(e.p,{children:['When building a component library or an application, it is useful to define several semantic "flavors" of some components, for example a ',(0,s.jsx)(e.code,{children:"Button"})," component that represents ",(0,s.jsx)(e.code,{children:"cancel"}),"."]}),"\n",(0,s.jsx)(e.h2,{id:"defining-a-component-variant",children:"Defining a component variant"}),"\n",(0,s.jsxs)(e.p,{children:["In your project's ",(0,s.jsx)(e.a,{href:"/docs/guides/project-commons",children:"Stylable stylesheet"})," used for the commonly used components in your project (usually named ",(0,s.jsx)(e.code,{children:"project.st.css"}),") you:"]}),"\n",(0,s.jsxs)(e.ol,{children:["\n",(0,s.jsx)(e.li,{children:"Import a component stylesheet."}),"\n",(0,s.jsxs)(e.li,{children:["Define a CSS class with a descriptive name like ",(0,s.jsx)(e.code,{children:"cancelButton"}),"."]}),"\n",(0,s.jsx)(e.li,{children:"Extend the component on the class you just defined."}),"\n"]}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-css",metastring:'title="project.st.css"',children:'@st-import Button from "./button.st.css";\n\n.cancelButton {\n -st-extend: Button;\n color: red;\n border: 1px solid red;\n}\n'})}),"\n",(0,s.jsx)(e.h2,{id:"use-component-variants-in-components",children:"Use component variants in components"}),"\n",(0,s.jsxs)(e.p,{children:["A component ",(0,s.jsx)(e.strong,{children:"Stylable"})," stylesheet can use and extend component variants:"]}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-css",metastring:'title="comp.st.css"',children:'@st-import [cancelButton] from "./project.st.css";\n\n/*\nselector: .comp__root .project__cancelButton.button__root\njs value: "project__cancelButton"\n*/\n.root .cancelButton {\n}\n/*\nselector: .comp__cancel.project__cancelButton.button__root\njs value: "comp__cancel project__cancelButton"\n*/\n.cancel {\n -st-extends: cancelButton;\n}\n'})}),"\n",(0,s.jsx)(e.admonition,{type:"note",children:(0,s.jsxs)(e.p,{children:["For the ",(0,s.jsx)(e.code,{children:".cancelButton"})," selector, we manually added the ",(0,s.jsx)(e.code,{children:".root"})," class to avoid overriding ",(0,s.jsx)(e.code,{children:"cancelButton"})," outside this scope."]})})]})}function p(n={}){const{wrapper:e}={...(0,c.R)(),...n.components};return e?(0,s.jsx)(e,{...n,children:(0,s.jsx)(d,{...n})}):d(n)}},8453:(n,e,t)=>{t.d(e,{R:()=>i,x:()=>r});var o=t(6540);const s={},c=o.createContext(s);function i(n){const e=o.useContext(c);return o.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function r(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(s):n.components||s:i(n.components),o.createElement(c.Provider,{value:e},n.children)}}}]); \ No newline at end of file diff --git a/assets/js/705f3d56.5ca66cf3.js b/assets/js/705f3d56.d3a20e59.js similarity index 97% rename from assets/js/705f3d56.5ca66cf3.js rename to assets/js/705f3d56.d3a20e59.js index 377df283..56b4a717 100644 --- a/assets/js/705f3d56.5ca66cf3.js +++ b/assets/js/705f3d56.d3a20e59.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[9183],{3953:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>c,contentTitle:()=>a,default:()=>u,frontMatter:()=>l,metadata:()=>n,toc:()=>i});const n=JSON.parse('{"id":"references/using-external-assets","title":"url()","description":"Stylable supports usage of url functions to use assets as you normally would in CSS.","source":"@site/docs/references/using-external-assets.md","sourceDirName":"references","slug":"/references/using-external-assets","permalink":"/docs/references/using-external-assets","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/using-external-assets.md","tags":[],"version":"current","frontMatter":{"id":"using-external-assets","title":"url()"},"sidebar":"Specification Reference","previous":{"title":"Type Selector","permalink":"/docs/references/type-selectors"},"next":{"title":"Custom Selector","permalink":"/docs/references/custom-selectors"}}');var r=t(4848),o=t(8453);const l={id:"using-external-assets",title:"url()"},a=void 0,c={},i=[{value:"Resolving 3rd-party assets",id:"resolving-3rd-party-assets",level:3}];function d(e){const s={a:"a",code:"code",h3:"h3",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(s.p,{children:["Stylable supports usage of ",(0,r.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/url()",children:"url functions"})," to use assets as you normally would in CSS."]}),"\n",(0,r.jsxs)(s.p,{children:["The value passed to the ",(0,r.jsx)(s.code,{children:"url()"})," function is resolved differently in CSS as comapred to the Node request resolution algorithm, used for Stylable stylesheet and symbol resolutions."]}),"\n",(0,r.jsxs)(s.p,{children:["The ",(0,r.jsx)(s.code,{children:"url()"})," function has no notion of external packages or dependencies."]}),"\n",(0,r.jsx)(s.h3,{id:"resolving-3rd-party-assets",children:"Resolving 3rd-party assets"}),"\n",(0,r.jsxs)(s.p,{children:["In order to import ",(0,r.jsx)(s.code,{children:"url()"})," assets from dependencies inside your ",(0,r.jsx)(s.code,{children:"node_modules"})," directory, Stylable supports the ",(0,r.jsx)(s.code,{children:"~"})," URL prefix."]}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-css",children:'.root {\n /* resolves as the node request: "my-package/asset.png" */\n background: url(~my-package/asset.png);\n}\n\n.root {\n /* resolves as the node request: "./my-package/asset.png" */\n background: url(my-package/asset.png);\n}\n'})})]})}function u(e={}){const{wrapper:s}={...(0,o.R)(),...e.components};return s?(0,r.jsx)(s,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},8453:(e,s,t)=>{t.d(s,{R:()=>l,x:()=>a});var n=t(6540);const r={},o=n.createContext(r);function l(e){const s=n.useContext(o);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function a(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:l(e.components),n.createElement(o.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[9183],{3239:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>c,contentTitle:()=>a,default:()=>u,frontMatter:()=>l,metadata:()=>n,toc:()=>i});const n=JSON.parse('{"id":"references/using-external-assets","title":"url()","description":"Stylable supports usage of url functions to use assets as you normally would in CSS.","source":"@site/docs/references/using-external-assets.md","sourceDirName":"references","slug":"/references/using-external-assets","permalink":"/docs/references/using-external-assets","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/using-external-assets.md","tags":[],"version":"current","frontMatter":{"id":"using-external-assets","title":"url()"},"sidebar":"Specification Reference","previous":{"title":"Type Selector","permalink":"/docs/references/type-selectors"},"next":{"title":"Custom Selector","permalink":"/docs/references/custom-selectors"}}');var r=t(4848),o=t(8453);const l={id:"using-external-assets",title:"url()"},a=void 0,c={},i=[{value:"Resolving 3rd-party assets",id:"resolving-3rd-party-assets",level:3}];function d(e){const s={a:"a",code:"code",h3:"h3",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(s.p,{children:["Stylable supports usage of ",(0,r.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/url()",children:"url functions"})," to use assets as you normally would in CSS."]}),"\n",(0,r.jsxs)(s.p,{children:["The value passed to the ",(0,r.jsx)(s.code,{children:"url()"})," function is resolved differently in CSS as comapred to the Node request resolution algorithm, used for Stylable stylesheet and symbol resolutions."]}),"\n",(0,r.jsxs)(s.p,{children:["The ",(0,r.jsx)(s.code,{children:"url()"})," function has no notion of external packages or dependencies."]}),"\n",(0,r.jsx)(s.h3,{id:"resolving-3rd-party-assets",children:"Resolving 3rd-party assets"}),"\n",(0,r.jsxs)(s.p,{children:["In order to import ",(0,r.jsx)(s.code,{children:"url()"})," assets from dependencies inside your ",(0,r.jsx)(s.code,{children:"node_modules"})," directory, Stylable supports the ",(0,r.jsx)(s.code,{children:"~"})," URL prefix."]}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-css",children:'.root {\n /* resolves as the node request: "my-package/asset.png" */\n background: url(~my-package/asset.png);\n}\n\n.root {\n /* resolves as the node request: "./my-package/asset.png" */\n background: url(my-package/asset.png);\n}\n'})})]})}function u(e={}){const{wrapper:s}={...(0,o.R)(),...e.components};return s?(0,r.jsx)(s,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},8453:(e,s,t)=>{t.d(s,{R:()=>l,x:()=>a});var n=t(6540);const r={},o=n.createContext(r);function l(e){const s=n.useContext(o);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function a(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:l(e.components),n.createElement(o.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/7812.365924a4.js b/assets/js/7812.365924a4.js deleted file mode 100644 index 3139024b..00000000 --- a/assets/js/7812.365924a4.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,r,t={7812:(e,r,t)=>{t.d(r,{AT:()=>a,BH:()=>s,IH:()=>n,sx:()=>o});t(8291);const o=!1,s=["en"],n="search-index{dir}.json?_=7622e871",a=8}},o={};function s(e){var r=o[e];if(void 0!==r)return r.exports;var n=o[e]={exports:{}};return t[e](n,n.exports,s),n.exports}s.m=t,s.x=()=>{var e=s.O(void 0,[4491],(()=>s(4491)));return e=s.O(e)},e=[],s.O=(r,t,o,n)=>{if(!t){var a=1/0;for(f=0;f\n =n)&&Object.keys(s.O).every((e=>s.O[e](t[p])))?t.splice(p--,1):(i=!1,n0&&e[f-1][2]>n;f--)e[f]=e[f-1];e[f]=[t,o,n]},s.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return s.d(r,{a:r}),r},s.d=(e,r)=>{for(var t in r)s.o(r,t)&&!s.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((r,t)=>(s.f[t](e,r),r)),[])),s.u=e=>"assets/js/"+e+".82a2b9c4.js",s.miniCssF=e=>{},s.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),s.p="/",s.gca=function(e){return e={}[e]||e,s.p+s.u(e)},(()=>{var e={7812:1};s.f.i=(r,t)=>{e[r]||importScripts(s.p+s.u(r))};var r=self.webpackChunkstylable_io=self.webpackChunkstylable_io||[],t=r.push.bind(r);r.push=r=>{var o=r[0],n=r[1],a=r[2];for(var i in n)s.o(n,i)&&(s.m[i]=n[i]);for(a&&a(s);o.length;)e[o.pop()]=1;t(r)}})(),r=s.x,s.x=()=>s.e(4491).then(r);s.x()})(); \ No newline at end of file diff --git a/assets/js/79455fbf.ae5d9ea9.js b/assets/js/79455fbf.043005c4.js similarity index 99% rename from assets/js/79455fbf.ae5d9ea9.js rename to assets/js/79455fbf.043005c4.js index d444569f..c4c573fc 100644 --- a/assets/js/79455fbf.ae5d9ea9.js +++ b/assets/js/79455fbf.043005c4.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[3879],{2349:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>o,contentTitle:()=>c,default:()=>h,frontMatter:()=>r,metadata:()=>l,toc:()=>i});const l=JSON.parse('{"id":"references/class-selectors","title":"Class Selector","description":"A CSS class selector is used as a generic way to target a DOM element with a matching class name. In Stylable a CSS class is used primarily as a component part, for example a .navBtn of gallery component, but can also be used as utility class or a mixin.","source":"@site/docs/references/class-selectors.md","sourceDirName":"references","slug":"/references/class-selectors","permalink":"/docs/references/class-selectors","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/class-selectors.md","tags":[],"version":"current","frontMatter":{"id":"class-selectors","title":"Class Selector"},"sidebar":"Specification Reference","previous":{"title":"Cheatsheet","permalink":"/docs/references/cheatsheet"},"next":{"title":"Containers","permalink":"/docs/references/contains"}}');var t=n(4848),a=n(8453);const r={id:"class-selectors",title:"Class Selector"},c=void 0,o={},i=[{value:"Syntax",id:"syntax",level:2},{value:"Root",id:"root",level:2},{value:"Import and Export",id:"import-and-export",level:2},{value:"Runtime",id:"runtime",level:2},{value:"Namespace",id:"namespace",level:2},{value:"Disable in selector",id:"disable-in-selector",level:3},{value:"Map to global selector",id:"map-to-global-selector",level:3},{value:"Related",id:"related",level:2}];function d(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,a.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(s.p,{children:["A CSS ",(0,t.jsx)(s.code,{children:"class selector"})," is used as a generic way to target a DOM element with a matching ",(0,t.jsx)(s.code,{children:"class name"}),". In Stylable a CSS class is used primarily as a component part, for example a ",(0,t.jsx)(s.code,{children:".navBtn"})," of gallery component, but can also be used as utility class or a mixin."]}),"\n",(0,t.jsxs)(s.p,{children:["This page goes over how Stylable handles ",(0,t.jsx)(s.code,{children:"class selector"}),", for more details about the language feature itself, checkout the following resources:"]}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsx)(s.li,{children:(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/Class_selectors",children:"MDN class selector"})}),"\n",(0,t.jsx)(s.li,{children:(0,t.jsx)(s.a,{href:"https://drafts.csswg.org/selectors/#class-html",children:"class selector in spec"})}),"\n"]}),"\n",(0,t.jsx)(s.h2,{id:"syntax",children:"Syntax"}),"\n",(0,t.jsxs)(s.p,{children:["To define a ",(0,t.jsx)(s.code,{children:"class symbol"}),": set a ",(0,t.jsx)(s.code,{children:"class selector"})," anywhere in a stylesheet."]}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"Standalone definition"})}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",children:".navBtn {}\n"})}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"In-selector definition"})}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",children:"/* compound */\nbutton.navBtn.baseBtn {}\n\n/* multiple selectors */\n.navBtn, .thumb {}\n"})}),"\n",(0,t.jsx)(s.h2,{id:"root",children:"Root"}),"\n",(0,t.jsxs)(s.p,{children:["The ",(0,t.jsx)(s.code,{children:".root"})," class has a special meaning in Stylable stylesheets. Every stylesheet has a root to represent the root element of the component or page of the stylesheet - ",(0,t.jsx)(s.a,{href:"/docs/references/root",children:"see root reference"}),"."]}),"\n",(0,t.jsx)(s.h2,{id:"import-and-export",children:"Import and Export"}),"\n",(0,t.jsxs)(s.p,{children:["A class selector can be imported into another stylesheet with the ",(0,t.jsx)(s.a,{href:"/docs/references/imports",children:(0,t.jsx)(s.code,{children:"@st-import"})})," atrule."]}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"Import class by name"})}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",children:"/* reference the navBtn class */\n@st-import [navBtn] from './gallery.st.css';\n\n/* reference multiple classes */\n@st-import [navBtn, thumb] from './gallery.st.css';\n\n/* map imported class to local name \"galleryNavBtn\" */\n@st-import [navBtn as galleryNavBtn] from './gallery.st.css';\n"})}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsxs)(s.strong,{children:["Import stylesheet ",(0,t.jsx)(s.code,{children:"root"})," class"]})}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",children:"/* get the gallery root class (default export) */\n@st-import Gallery from './gallery.st.css';\n\n/* reference the gallery named root class */\n@st-import [root as GalleryRoot] from './gallery.st.css';\n"})}),"\n",(0,t.jsx)(s.admonition,{title:"capitalize default stylesheet import",type:"caution",children:(0,t.jsxs)(s.p,{children:["While any valid ident can be used for the default root import, It is ",(0,t.jsx)(s.strong,{children:"strongly recommend"})," to capitalize the name to signify it represents a component element."]})}),"\n",(0,t.jsx)(s.h2,{id:"runtime",children:"Runtime"}),"\n",(0,t.jsxs)(s.p,{children:["A class can be accessed using the ",(0,t.jsx)(s.code,{children:"classes"})," mapping on the Stylable stylesheet runtime."]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-js",children:"import { classes } from './gallery.st.css';\n\n// map from local name to target class name\nclasses.part;\nclasses.root;\nclasses['dashed-class'];\n"})}),"\n",(0,t.jsx)(s.p,{children:"Use the class mapping to bind the stylesheet to the rendered view:"}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"React example"})}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-js",children:"/* gallery.jsx */\nimport { st, classes } from './gallery.st.css';\n\nfunction Gallery(props) {\n return (\n \n \n \n\n );\n}\n"})}),"\n",(0,t.jsx)(s.admonition,{title:"component instance customization",type:"note",children:(0,t.jsxs)(s.p,{children:["In the component example above, we call the ",(0,t.jsx)(s.a,{href:"/docs/references/runtime#st-function",children:"st() function"})," in order to pass both the gallery root class and any class name provided externally in order to style the component from the outside."]})}),"\n",(0,t.jsx)(s.h2,{id:"namespace",children:"Namespace"}),"\n",(0,t.jsxs)(s.p,{children:["Stylable automatically ",(0,t.jsx)(s.a,{href:"/docs/guides/handbook/namespacing",children:"namespaces"})," any class selector according to the stylesheet it is defined in:"]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",children:".a {}\n\n/* OUTPUT */\n.NAMESPACE__a {}\n"})}),"\n",(0,t.jsx)(s.h3,{id:"disable-in-selector",children:"Disable in selector"}),"\n",(0,t.jsxs)(s.p,{children:["Wrapping a class selector with ",(0,t.jsx)(s.code,{children:":global()"})," pseudo-class prevents namespacing:"]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",children:":global(.icon-heart) {}\n\n/* OUTPUT */\n.icon-heart {}\n"})}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsxs)(s.a,{href:"/docs/references/global-selectors",children:["see ",(0,t.jsx)(s.code,{children:"global selector"})," reference"]})}),"\n",(0,t.jsx)(s.h3,{id:"map-to-global-selector",children:"Map to global selector"}),"\n",(0,t.jsxs)(s.p,{children:["Class selector can be mapped to a custom global selector with the ",(0,t.jsx)(s.code,{children:"-st-global"})," declaration:"]}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"Map to global class"})}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",children:".button {\n -st-global: '.myLib__button';\n}\n.button:hover {}\n\n/* OUTPUT */\n.myLib__button {}\n.myLib__button:hover {}\n"})}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"Valid values"})}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",children:"/* global selector */\n.x { -st-global: '.a' }\n\n/* compound selector of multiple classes */\n.x { -st-global: '.a.b' }\n\n/* complex selector (runtime `classes.x` not exported) */\n.x { -st-global: '.a .b' }\n\n/* non class selectors (runtime `classes.x` not exported) */\n.x { -st-global: '[c]' }\n.x { -st-global: '.a[c]' }\n"})}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"Invalid values"})}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",children:"/* empty selector */\n.x { -st-global: '' }\n/* only a single selector is supported */\n.x { -st-global: '.a, .b' }\n"})}),"\n",(0,t.jsx)(s.h2,{id:"related",children:"Related"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsx)(s.li,{children:(0,t.jsx)(s.a,{href:"/docs/references/pseudo-elements",children:"Style pseudo-elements"})}),"\n",(0,t.jsx)(s.li,{children:(0,t.jsx)(s.a,{href:"/docs/references/mixins",children:"Use CSS mixins"})}),"\n"]})]})}function h(e={}){const{wrapper:s}={...(0,a.R)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},8453:(e,s,n)=>{n.d(s,{R:()=>r,x:()=>c});var l=n(6540);const t={},a=l.createContext(t);function r(e){const s=l.useContext(a);return l.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function c(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:r(e.components),l.createElement(a.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[3879],{1819:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>o,contentTitle:()=>c,default:()=>h,frontMatter:()=>r,metadata:()=>l,toc:()=>i});const l=JSON.parse('{"id":"references/class-selectors","title":"Class Selector","description":"A CSS class selector is used as a generic way to target a DOM element with a matching class name. In Stylable a CSS class is used primarily as a component part, for example a .navBtn of gallery component, but can also be used as utility class or a mixin.","source":"@site/docs/references/class-selectors.md","sourceDirName":"references","slug":"/references/class-selectors","permalink":"/docs/references/class-selectors","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/class-selectors.md","tags":[],"version":"current","frontMatter":{"id":"class-selectors","title":"Class Selector"},"sidebar":"Specification Reference","previous":{"title":"Cheatsheet","permalink":"/docs/references/cheatsheet"},"next":{"title":"Containers","permalink":"/docs/references/contains"}}');var t=n(4848),a=n(8453);const r={id:"class-selectors",title:"Class Selector"},c=void 0,o={},i=[{value:"Syntax",id:"syntax",level:2},{value:"Root",id:"root",level:2},{value:"Import and Export",id:"import-and-export",level:2},{value:"Runtime",id:"runtime",level:2},{value:"Namespace",id:"namespace",level:2},{value:"Disable in selector",id:"disable-in-selector",level:3},{value:"Map to global selector",id:"map-to-global-selector",level:3},{value:"Related",id:"related",level:2}];function d(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,a.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(s.p,{children:["A CSS ",(0,t.jsx)(s.code,{children:"class selector"})," is used as a generic way to target a DOM element with a matching ",(0,t.jsx)(s.code,{children:"class name"}),". In Stylable a CSS class is used primarily as a component part, for example a ",(0,t.jsx)(s.code,{children:".navBtn"})," of gallery component, but can also be used as utility class or a mixin."]}),"\n",(0,t.jsxs)(s.p,{children:["This page goes over how Stylable handles ",(0,t.jsx)(s.code,{children:"class selector"}),", for more details about the language feature itself, checkout the following resources:"]}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsx)(s.li,{children:(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/Class_selectors",children:"MDN class selector"})}),"\n",(0,t.jsx)(s.li,{children:(0,t.jsx)(s.a,{href:"https://drafts.csswg.org/selectors/#class-html",children:"class selector in spec"})}),"\n"]}),"\n",(0,t.jsx)(s.h2,{id:"syntax",children:"Syntax"}),"\n",(0,t.jsxs)(s.p,{children:["To define a ",(0,t.jsx)(s.code,{children:"class symbol"}),": set a ",(0,t.jsx)(s.code,{children:"class selector"})," anywhere in a stylesheet."]}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"Standalone definition"})}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",children:".navBtn {}\n"})}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"In-selector definition"})}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",children:"/* compound */\nbutton.navBtn.baseBtn {}\n\n/* multiple selectors */\n.navBtn, .thumb {}\n"})}),"\n",(0,t.jsx)(s.h2,{id:"root",children:"Root"}),"\n",(0,t.jsxs)(s.p,{children:["The ",(0,t.jsx)(s.code,{children:".root"})," class has a special meaning in Stylable stylesheets. Every stylesheet has a root to represent the root element of the component or page of the stylesheet - ",(0,t.jsx)(s.a,{href:"/docs/references/root",children:"see root reference"}),"."]}),"\n",(0,t.jsx)(s.h2,{id:"import-and-export",children:"Import and Export"}),"\n",(0,t.jsxs)(s.p,{children:["A class selector can be imported into another stylesheet with the ",(0,t.jsx)(s.a,{href:"/docs/references/imports",children:(0,t.jsx)(s.code,{children:"@st-import"})})," atrule."]}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"Import class by name"})}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",children:"/* reference the navBtn class */\n@st-import [navBtn] from './gallery.st.css';\n\n/* reference multiple classes */\n@st-import [navBtn, thumb] from './gallery.st.css';\n\n/* map imported class to local name \"galleryNavBtn\" */\n@st-import [navBtn as galleryNavBtn] from './gallery.st.css';\n"})}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsxs)(s.strong,{children:["Import stylesheet ",(0,t.jsx)(s.code,{children:"root"})," class"]})}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",children:"/* get the gallery root class (default export) */\n@st-import Gallery from './gallery.st.css';\n\n/* reference the gallery named root class */\n@st-import [root as GalleryRoot] from './gallery.st.css';\n"})}),"\n",(0,t.jsx)(s.admonition,{title:"capitalize default stylesheet import",type:"caution",children:(0,t.jsxs)(s.p,{children:["While any valid ident can be used for the default root import, It is ",(0,t.jsx)(s.strong,{children:"strongly recommend"})," to capitalize the name to signify it represents a component element."]})}),"\n",(0,t.jsx)(s.h2,{id:"runtime",children:"Runtime"}),"\n",(0,t.jsxs)(s.p,{children:["A class can be accessed using the ",(0,t.jsx)(s.code,{children:"classes"})," mapping on the Stylable stylesheet runtime."]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-js",children:"import { classes } from './gallery.st.css';\n\n// map from local name to target class name\nclasses.part;\nclasses.root;\nclasses['dashed-class'];\n"})}),"\n",(0,t.jsx)(s.p,{children:"Use the class mapping to bind the stylesheet to the rendered view:"}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"React example"})}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-js",children:"/* gallery.jsx */\nimport { st, classes } from './gallery.st.css';\n\nfunction Gallery(props) {\n return (\n\n \n \n\n );\n}\n"})}),"\n",(0,t.jsx)(s.admonition,{title:"component instance customization",type:"note",children:(0,t.jsxs)(s.p,{children:["In the component example above, we call the ",(0,t.jsx)(s.a,{href:"/docs/references/runtime#st-function",children:"st() function"})," in order to pass both the gallery root class and any class name provided externally in order to style the component from the outside."]})}),"\n",(0,t.jsx)(s.h2,{id:"namespace",children:"Namespace"}),"\n",(0,t.jsxs)(s.p,{children:["Stylable automatically ",(0,t.jsx)(s.a,{href:"/docs/guides/handbook/namespacing",children:"namespaces"})," any class selector according to the stylesheet it is defined in:"]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",children:".a {}\n\n/* OUTPUT */\n.NAMESPACE__a {}\n"})}),"\n",(0,t.jsx)(s.h3,{id:"disable-in-selector",children:"Disable in selector"}),"\n",(0,t.jsxs)(s.p,{children:["Wrapping a class selector with ",(0,t.jsx)(s.code,{children:":global()"})," pseudo-class prevents namespacing:"]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",children:":global(.icon-heart) {}\n\n/* OUTPUT */\n.icon-heart {}\n"})}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsxs)(s.a,{href:"/docs/references/global-selectors",children:["see ",(0,t.jsx)(s.code,{children:"global selector"})," reference"]})}),"\n",(0,t.jsx)(s.h3,{id:"map-to-global-selector",children:"Map to global selector"}),"\n",(0,t.jsxs)(s.p,{children:["Class selector can be mapped to a custom global selector with the ",(0,t.jsx)(s.code,{children:"-st-global"})," declaration:"]}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"Map to global class"})}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",children:".button {\n -st-global: '.myLib__button';\n}\n.button:hover {}\n\n/* OUTPUT */\n.myLib__button {}\n.myLib__button:hover {}\n"})}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"Valid values"})}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",children:"/* global selector */\n.x { -st-global: '.a' }\n\n/* compound selector of multiple classes */\n.x { -st-global: '.a.b' }\n\n/* complex selector (runtime `classes.x` not exported) */\n.x { -st-global: '.a .b' }\n\n/* non class selectors (runtime `classes.x` not exported) */\n.x { -st-global: '[c]' }\n.x { -st-global: '.a[c]' }\n"})}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.strong,{children:"Invalid values"})}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",children:"/* empty selector */\n.x { -st-global: '' }\n/* only a single selector is supported */\n.x { -st-global: '.a, .b' }\n"})}),"\n",(0,t.jsx)(s.h2,{id:"related",children:"Related"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsx)(s.li,{children:(0,t.jsx)(s.a,{href:"/docs/references/pseudo-elements",children:"Style pseudo-elements"})}),"\n",(0,t.jsx)(s.li,{children:(0,t.jsx)(s.a,{href:"/docs/references/mixins",children:"Use CSS mixins"})}),"\n"]})]})}function h(e={}){const{wrapper:s}={...(0,a.R)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},8453:(e,s,n)=>{n.d(s,{R:()=>r,x:()=>c});var l=n(6540);const t={},a=l.createContext(t);function r(e){const s=l.useContext(a);return l.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function c(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:r(e.components),l.createElement(a.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/7df4dfbf.5b189963.js b/assets/js/7df4dfbf.b9fac3b2.js similarity index 97% rename from assets/js/7df4dfbf.5b189963.js rename to assets/js/7df4dfbf.b9fac3b2.js index f46a7936..cc8963c6 100644 --- a/assets/js/7df4dfbf.5b189963.js +++ b/assets/js/7df4dfbf.b9fac3b2.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[2670],{9662:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>r,default:()=>h,frontMatter:()=>c,metadata:()=>i,toc:()=>a});const i=JSON.parse('{"id":"attributions","title":"Attributions","description":"Landing Page Images","source":"@site/docs/attributions.md","sourceDirName":".","slug":"/attributions","permalink":"/docs/attributions","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/attributions.md","tags":[],"version":"current","frontMatter":{"id":"attributions","title":"Attributions","hide_table_of_contents":true}}');var o=n(4848),s=n(8453);const c={id:"attributions",title:"Attributions",hide_table_of_contents:!0},r=void 0,l={},a=[{value:"Landing Page Images",id:"landing-page-images",level:2}];function d(e){const t={a:"a",h2:"h2",li:"li",p:"p",ul:"ul",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.h2,{id:"landing-page-images",children:"Landing Page Images"}),"\n",(0,o.jsx)(t.p,{children:"The following images have been used in the landing page."}),"\n",(0,o.jsx)(t.p,{children:"Icons made by Freepik"}),"\n",(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.a,{href:"https://www.flaticon.com/free-icon/api_921573",children:"https://www.flaticon.com/free-icon/api_921573"})}),"\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.a,{href:"https://www.flaticon.com/free-icon/stethoscope_1012652",children:"https://www.flaticon.com/free-icon/stethoscope_1012652"})}),"\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.a,{href:"https://www.flaticon.com/free-icon/tool_3964296",children:"https://www.flaticon.com/free-icon/tool_3964296"})}),"\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.a,{href:"https://www.flaticon.com/free-icon/web-design_781642",children:"https://www.flaticon.com/free-icon/web-design_781642"})}),"\n"]}),"\n",(0,o.jsx)(t.p,{children:"Icons made by Eucalyp"}),"\n",(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.a,{href:"https://www.flaticon.com/free-icon/checklist_2753153",children:"https://www.flaticon.com/free-icon/checklist_2753153"})}),"\n"]}),"\n",(0,o.jsx)(t.p,{children:"Icons made by wanicon"}),"\n",(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.a,{href:"https://www.flaticon.com/free-icon/prototype_2421271",children:"https://www.flaticon.com/free-icon/prototype_2421271"})}),"\n"]})]})}function h(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>c,x:()=>r});var i=n(6540);const o={},s=i.createContext(o);function c(e){const t=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:c(e.components),i.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[2670],{1564:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>r,default:()=>h,frontMatter:()=>c,metadata:()=>i,toc:()=>a});const i=JSON.parse('{"id":"attributions","title":"Attributions","description":"Landing Page Images","source":"@site/docs/attributions.md","sourceDirName":".","slug":"/attributions","permalink":"/docs/attributions","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/attributions.md","tags":[],"version":"current","frontMatter":{"id":"attributions","title":"Attributions","hide_table_of_contents":true}}');var o=n(4848),s=n(8453);const c={id:"attributions",title:"Attributions",hide_table_of_contents:!0},r=void 0,l={},a=[{value:"Landing Page Images",id:"landing-page-images",level:2}];function d(e){const t={a:"a",h2:"h2",li:"li",p:"p",ul:"ul",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.h2,{id:"landing-page-images",children:"Landing Page Images"}),"\n",(0,o.jsx)(t.p,{children:"The following images have been used in the landing page."}),"\n",(0,o.jsx)(t.p,{children:"Icons made by Freepik"}),"\n",(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.a,{href:"https://www.flaticon.com/free-icon/api_921573",children:"https://www.flaticon.com/free-icon/api_921573"})}),"\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.a,{href:"https://www.flaticon.com/free-icon/stethoscope_1012652",children:"https://www.flaticon.com/free-icon/stethoscope_1012652"})}),"\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.a,{href:"https://www.flaticon.com/free-icon/tool_3964296",children:"https://www.flaticon.com/free-icon/tool_3964296"})}),"\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.a,{href:"https://www.flaticon.com/free-icon/web-design_781642",children:"https://www.flaticon.com/free-icon/web-design_781642"})}),"\n"]}),"\n",(0,o.jsx)(t.p,{children:"Icons made by Eucalyp"}),"\n",(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.a,{href:"https://www.flaticon.com/free-icon/checklist_2753153",children:"https://www.flaticon.com/free-icon/checklist_2753153"})}),"\n"]}),"\n",(0,o.jsx)(t.p,{children:"Icons made by wanicon"}),"\n",(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsx)(t.li,{children:(0,o.jsx)(t.a,{href:"https://www.flaticon.com/free-icon/prototype_2421271",children:"https://www.flaticon.com/free-icon/prototype_2421271"})}),"\n"]})]})}function h(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>c,x:()=>r});var i=n(6540);const o={},s=i.createContext(o);function c(e){const t=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:c(e.components),i.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/825e4603.d8f06ee4.js b/assets/js/825e4603.55187120.js similarity index 99% rename from assets/js/825e4603.d8f06ee4.js rename to assets/js/825e4603.55187120.js index e71c6c1d..801d1939 100644 --- a/assets/js/825e4603.d8f06ee4.js +++ b/assets/js/825e4603.55187120.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[1026],{5926:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>i,contentTitle:()=>c,default:()=>p,frontMatter:()=>l,metadata:()=>t,toc:()=>o});const t=JSON.parse('{"id":"references/runtime","title":"Runtime","description":"Imported Stylable stylesheets in JavaScript contain minimal runtime code to help define the structure and state of the component.","source":"@site/docs/references/runtime.md","sourceDirName":"references","slug":"/references/runtime","permalink":"/docs/references/runtime","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/runtime.md","tags":[],"version":"current","frontMatter":{"id":"runtime","title":"Runtime"},"sidebar":"Specification Reference","previous":{"title":"Variables","permalink":"/docs/references/st-variables"},"next":{"title":"Programmatic API","permalink":"/docs/references/programmatic-api"}}');var a=n(4848),r=n(8453);const l={id:"runtime",title:"Runtime"},c=void 0,i={},o=[{value:"Manual mapping",id:"manual-mapping",level:2},{value:"Build vars",id:"build-vars",level:2},{value:"st()
function",id:"st-function",level:2},{value:"Custom state mapping",id:"custom-state-mapping",level:2}];function d(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.p,{children:"Imported Stylable stylesheets in JavaScript contain minimal runtime code to help define the structure and state of the component."}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-js",children:'/* index.jsx - stylesheet runtime api */\nimport {\n st, // runtime utility function\n classes, // class mapping\n vars, // custom properties mapping\n stVars, // stylable build-time variable values\n cssStates, // utility function for setting stylable states\n keyframes, // keyframes mapping\n layers // layer mapping\n containers,// container mapping\n} from "style.st.css";\n'})}),"\n",(0,a.jsx)(s.h2,{id:"manual-mapping",children:"Manual mapping"}),"\n",(0,a.jsx)(s.p,{children:"Any namespaced symbols, defined in the stylesheet, are exposed on maps from their local name to their target namespaced name:"}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-js",children:'import { classes, vars, keyframes, layers, containers } from \'style.st.css\';\n\n// class\nclasses.root; // "style__root"\nclasses.label; // "style__label"\nclasses.icon; // "style__icon"\nclasses[\'dashed-part\']; // "style__dashed-part"\n\n// custom property\nvars.color1 // "--style-color1"\n\n// keyframes\nkeyframes.slide // "style__slide"\n\n// layers\nlayers.theme // "style__theme"\n\n// containers\ncontainers.panel // "style__panel"\n'})}),"\n",(0,a.jsx)(s.admonition,{type:"note",children:(0,a.jsxs)(s.p,{children:["The ",(0,a.jsx)(s.a,{href:"/docs/references/root",children:"root class"})," is available even when it is not explicitly defined in the stylesheet."]})}),"\n",(0,a.jsx)(s.h2,{id:"build-vars",children:"Build vars"}),"\n",(0,a.jsxs)(s.p,{children:["Local stylesheet ",(0,a.jsx)(s.a,{href:"/docs/references/st-variables",children:"build vars"})," are exported with their set value."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",children:":vars {\n bg: black;\n color: gold;\n}\n"})}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-js",children:'import { stVars } from \'style.st.css\';\n\nstVars.bg; // "black"\nstVars.color; // "gold"\n'})}),"\n",(0,a.jsxs)(s.h2,{id:"st-function",children:[(0,a.jsx)(s.code,{children:"st()"})," function"]}),"\n",(0,a.jsxs)(s.p,{children:["A utility function for concatenating ",(0,a.jsx)(s.a,{href:"/docs/references/class-selectors",children:"classes"})," and activating ",(0,a.jsx)(s.a,{href:"/docs/references/pseudo-classes",children:"custom states"}),"."]}),"\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsxs)(s.li,{children:["the optional ",(0,a.jsx)(s.strong,{children:"second argument"})," can receive either a state activation or another class to concatenate"]}),"\n",(0,a.jsx)(s.li,{children:"multiple classes can be added with additional arguments"}),"\n"]}),"\n",(0,a.jsx)(s.p,{children:(0,a.jsx)(s.strong,{children:"Multiple classes"})}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-js",children:"import { st, classes } from 'style.st.css';\n\n// namespaced part class + additional class\nst(classes.part, 'additional'); // \"style__part additional\"\n\n// namespaced part class + multiple classes\nst(classes.part, 'a', 'b', 'c'); // \"style__part a b c\"\n\n// undefined is ignored\nst(classes.part, 'a', undefined, 'c'); // \"style__part a c\"\n"})}),"\n",(0,a.jsx)(s.p,{children:(0,a.jsx)(s.strong,{children:"State activation"})}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-js",children:'import { st, classes } from \'style.st.css\';\n\n// namespaced a + isOn boolean state\nst(classes.a, { isOn: true }); // "style__a style--isOn"\n\n// namespaced a + multiple states\nst(classes.a, { x: true, y: false }); // "style__a style--x"\n\n// namespaced a + parameter\nst(classes.a, { rank: \'first\' }); // "style__a style--rank-5-first"\n'})}),"\n",(0,a.jsx)(s.p,{children:(0,a.jsx)(s.strong,{children:"State activation + additional classes"})}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-js",children:"import { st, classes } from 'style.st.css';\n\n// namespaced a + isOn state + x class\nst(classes.a, { isOn: true }, 'x'); // \"style__a style--isOn x\"\n"})}),"\n",(0,a.jsx)(s.h2,{id:"custom-state-mapping",children:"Custom state mapping"}),"\n",(0,a.jsxs)(s.p,{children:["The ",(0,a.jsx)(s.code,{children:"cssStates"})," function can be used to produce just the active ",(0,a.jsx)(s.a,{href:"/docs/references/pseudo-classes",children:"custom state"})," classes."]}),"\n",(0,a.jsx)(s.p,{children:"The function accepts a map of local state names and generates a string with concatenated class names used to mark the element's state."}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-js",children:'import { cssStates } from \'style.st.css\';\n\n// single state\ncssStates({ selected: true }); // "style--selected"\n\n// un-active state\ncssStates({ selected: false }); // ""\n\n// string/enum state\ncssStates({ rank: \'first\' }); // "style--rank-5-first"\n\n// multiple states\ncssStates({ a: true, b: false, c: true }); // "a c"\n'})})]})}function p(e={}){const{wrapper:s}={...(0,r.R)(),...e.components};return s?(0,a.jsx)(s,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},8453:(e,s,n)=>{n.d(s,{R:()=>l,x:()=>c});var t=n(6540);const a={},r=t.createContext(a);function l(e){const s=t.useContext(r);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function c(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:l(e.components),t.createElement(r.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[1026],{1179:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>i,contentTitle:()=>c,default:()=>p,frontMatter:()=>l,metadata:()=>t,toc:()=>o});const t=JSON.parse('{"id":"references/runtime","title":"Runtime","description":"Imported Stylable stylesheets in JavaScript contain minimal runtime code to help define the structure and state of the component.","source":"@site/docs/references/runtime.md","sourceDirName":"references","slug":"/references/runtime","permalink":"/docs/references/runtime","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/runtime.md","tags":[],"version":"current","frontMatter":{"id":"runtime","title":"Runtime"},"sidebar":"Specification Reference","previous":{"title":"Variables","permalink":"/docs/references/st-variables"},"next":{"title":"Programmatic API","permalink":"/docs/references/programmatic-api"}}');var a=n(4848),r=n(8453);const l={id:"runtime",title:"Runtime"},c=void 0,i={},o=[{value:"Manual mapping",id:"manual-mapping",level:2},{value:"Build vars",id:"build-vars",level:2},{value:"st()
function",id:"st-function",level:2},{value:"Custom state mapping",id:"custom-state-mapping",level:2}];function d(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.p,{children:"Imported Stylable stylesheets in JavaScript contain minimal runtime code to help define the structure and state of the component."}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-js",children:'/* index.jsx - stylesheet runtime api */\nimport {\n st, // runtime utility function\n classes, // class mapping\n vars, // custom properties mapping\n stVars, // stylable build-time variable values\n cssStates, // utility function for setting stylable states\n keyframes, // keyframes mapping\n layers // layer mapping\n containers,// container mapping\n} from "style.st.css";\n'})}),"\n",(0,a.jsx)(s.h2,{id:"manual-mapping",children:"Manual mapping"}),"\n",(0,a.jsx)(s.p,{children:"Any namespaced symbols, defined in the stylesheet, are exposed on maps from their local name to their target namespaced name:"}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-js",children:'import { classes, vars, keyframes, layers, containers } from \'style.st.css\';\n\n// class\nclasses.root; // "style__root"\nclasses.label; // "style__label"\nclasses.icon; // "style__icon"\nclasses[\'dashed-part\']; // "style__dashed-part"\n\n// custom property\nvars.color1 // "--style-color1"\n\n// keyframes\nkeyframes.slide // "style__slide"\n\n// layers\nlayers.theme // "style__theme"\n\n// containers\ncontainers.panel // "style__panel"\n'})}),"\n",(0,a.jsx)(s.admonition,{type:"note",children:(0,a.jsxs)(s.p,{children:["The ",(0,a.jsx)(s.a,{href:"/docs/references/root",children:"root class"})," is available even when it is not explicitly defined in the stylesheet."]})}),"\n",(0,a.jsx)(s.h2,{id:"build-vars",children:"Build vars"}),"\n",(0,a.jsxs)(s.p,{children:["Local stylesheet ",(0,a.jsx)(s.a,{href:"/docs/references/st-variables",children:"build vars"})," are exported with their set value."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",children:":vars {\n bg: black;\n color: gold;\n}\n"})}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-js",children:'import { stVars } from \'style.st.css\';\n\nstVars.bg; // "black"\nstVars.color; // "gold"\n'})}),"\n",(0,a.jsxs)(s.h2,{id:"st-function",children:[(0,a.jsx)(s.code,{children:"st()"})," function"]}),"\n",(0,a.jsxs)(s.p,{children:["A utility function for concatenating ",(0,a.jsx)(s.a,{href:"/docs/references/class-selectors",children:"classes"})," and activating ",(0,a.jsx)(s.a,{href:"/docs/references/pseudo-classes",children:"custom states"}),"."]}),"\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsxs)(s.li,{children:["the optional ",(0,a.jsx)(s.strong,{children:"second argument"})," can receive either a state activation or another class to concatenate"]}),"\n",(0,a.jsx)(s.li,{children:"multiple classes can be added with additional arguments"}),"\n"]}),"\n",(0,a.jsx)(s.p,{children:(0,a.jsx)(s.strong,{children:"Multiple classes"})}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-js",children:"import { st, classes } from 'style.st.css';\n\n// namespaced part class + additional class\nst(classes.part, 'additional'); // \"style__part additional\"\n\n// namespaced part class + multiple classes\nst(classes.part, 'a', 'b', 'c'); // \"style__part a b c\"\n\n// undefined is ignored\nst(classes.part, 'a', undefined, 'c'); // \"style__part a c\"\n"})}),"\n",(0,a.jsx)(s.p,{children:(0,a.jsx)(s.strong,{children:"State activation"})}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-js",children:'import { st, classes } from \'style.st.css\';\n\n// namespaced a + isOn boolean state\nst(classes.a, { isOn: true }); // "style__a style--isOn"\n\n// namespaced a + multiple states\nst(classes.a, { x: true, y: false }); // "style__a style--x"\n\n// namespaced a + parameter\nst(classes.a, { rank: \'first\' }); // "style__a style--rank-5-first"\n'})}),"\n",(0,a.jsx)(s.p,{children:(0,a.jsx)(s.strong,{children:"State activation + additional classes"})}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-js",children:"import { st, classes } from 'style.st.css';\n\n// namespaced a + isOn state + x class\nst(classes.a, { isOn: true }, 'x'); // \"style__a style--isOn x\"\n"})}),"\n",(0,a.jsx)(s.h2,{id:"custom-state-mapping",children:"Custom state mapping"}),"\n",(0,a.jsxs)(s.p,{children:["The ",(0,a.jsx)(s.code,{children:"cssStates"})," function can be used to produce just the active ",(0,a.jsx)(s.a,{href:"/docs/references/pseudo-classes",children:"custom state"})," classes."]}),"\n",(0,a.jsx)(s.p,{children:"The function accepts a map of local state names and generates a string with concatenated class names used to mark the element's state."}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-js",children:'import { cssStates } from \'style.st.css\';\n\n// single state\ncssStates({ selected: true }); // "style--selected"\n\n// un-active state\ncssStates({ selected: false }); // ""\n\n// string/enum state\ncssStates({ rank: \'first\' }); // "style--rank-5-first"\n\n// multiple states\ncssStates({ a: true, b: false, c: true }); // "a c"\n'})})]})}function p(e={}){const{wrapper:s}={...(0,r.R)(),...e.components};return s?(0,a.jsx)(s,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},8453:(e,s,n)=>{n.d(s,{R:()=>l,x:()=>c});var t=n(6540);const a={},r=t.createContext(a);function l(e){const s=t.useContext(r);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function c(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:l(e.components),t.createElement(r.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/866f0f84.584ec891.js b/assets/js/866f0f84.31688e7e.js similarity index 97% rename from assets/js/866f0f84.584ec891.js rename to assets/js/866f0f84.31688e7e.js index ae418f6b..23c61ecf 100644 --- a/assets/js/866f0f84.584ec891.js +++ b/assets/js/866f0f84.31688e7e.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[2619],{8403:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>a,contentTitle:()=>i,default:()=>m,frontMatter:()=>r,metadata:()=>o,toc:()=>l});const o=JSON.parse('{"id":"guides/project-commons","title":"Project Commons","description":"The goal of the project file is to contain the CSS commons for the project, including variables, component variants and shared classes.","source":"@site/docs/guides/project-commons.md","sourceDirName":"guides","slug":"/guides/project-commons","permalink":"/docs/guides/project-commons","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/guides/project-commons.md","tags":[],"version":"current","frontMatter":{"id":"project-commons","title":"Project Commons"},"sidebar":"Guides","previous":{"title":"Component Best Practices","permalink":"/docs/guides/component-best-practices"},"next":{"title":"Shared Classes","permalink":"/docs/guides/shared-classes"}}');var t=s(4848),c=s(8453);const r={id:"project-commons",title:"Project Commons"},i=void 0,a={},l=[];function d(e){const n={a:"a",admonition:"admonition",code:"code",li:"li",p:"p",pre:"pre",ul:"ul",...(0,c.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.p,{children:["The goal of the project file is to contain the CSS commons for the project, including ",(0,t.jsx)(n.a,{href:"/docs/references/st-variables",children:"variables"}),", ",(0,t.jsx)(n.a,{href:"/docs/guides/component-variants",children:"component variants"})," and ",(0,t.jsx)(n.a,{href:"/docs/guides/shared-classes",children:"shared classes"}),"."]}),"\n",(0,t.jsx)(n.p,{children:"In the following code, you can see a project with:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"2 color, 2 font and 1 spacing size variables"}),"\n",(0,t.jsxs)(n.li,{children:["1 ",(0,t.jsx)(n.code,{children:"Button"})," component variant named ",(0,t.jsx)(n.code,{children:"cancelButton"})]}),"\n",(0,t.jsxs)(n.li,{children:["1 shared class for ",(0,t.jsx)(n.code,{children:"emphasisBox"})]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-css",metastring:'title="project.st.css"',children:':vars {\n color1: #f012be;\n color2: #ff4136;\n fontbig: 2rem;\n fontsmall: 1rem;\n spacing: 6px;\n}\n@st-import Button from "./button/button.st.css";\n\n.cancelButton {\n -st-extends: Button;\n}\n.emphasisBox {}\n'})}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["We recommend calling the project commons file ",(0,t.jsx)(n.code,{children:"project.st.css"}),"."]})})]})}function m(e={}){const{wrapper:n}={...(0,c.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>r,x:()=>i});var o=s(6540);const t={},c=o.createContext(t);function r(e){const n=o.useContext(c);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:r(e.components),o.createElement(c.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[2619],{1872:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>a,contentTitle:()=>i,default:()=>m,frontMatter:()=>r,metadata:()=>o,toc:()=>l});const o=JSON.parse('{"id":"guides/project-commons","title":"Project Commons","description":"The goal of the project file is to contain the CSS commons for the project, including variables, component variants and shared classes.","source":"@site/docs/guides/project-commons.md","sourceDirName":"guides","slug":"/guides/project-commons","permalink":"/docs/guides/project-commons","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/guides/project-commons.md","tags":[],"version":"current","frontMatter":{"id":"project-commons","title":"Project Commons"},"sidebar":"Guides","previous":{"title":"Component Best Practices","permalink":"/docs/guides/component-best-practices"},"next":{"title":"Shared Classes","permalink":"/docs/guides/shared-classes"}}');var t=s(4848),c=s(8453);const r={id:"project-commons",title:"Project Commons"},i=void 0,a={},l=[];function d(e){const n={a:"a",admonition:"admonition",code:"code",li:"li",p:"p",pre:"pre",ul:"ul",...(0,c.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.p,{children:["The goal of the project file is to contain the CSS commons for the project, including ",(0,t.jsx)(n.a,{href:"/docs/references/st-variables",children:"variables"}),", ",(0,t.jsx)(n.a,{href:"/docs/guides/component-variants",children:"component variants"})," and ",(0,t.jsx)(n.a,{href:"/docs/guides/shared-classes",children:"shared classes"}),"."]}),"\n",(0,t.jsx)(n.p,{children:"In the following code, you can see a project with:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"2 color, 2 font and 1 spacing size variables"}),"\n",(0,t.jsxs)(n.li,{children:["1 ",(0,t.jsx)(n.code,{children:"Button"})," component variant named ",(0,t.jsx)(n.code,{children:"cancelButton"})]}),"\n",(0,t.jsxs)(n.li,{children:["1 shared class for ",(0,t.jsx)(n.code,{children:"emphasisBox"})]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-css",metastring:'title="project.st.css"',children:':vars {\n color1: #f012be;\n color2: #ff4136;\n fontbig: 2rem;\n fontsmall: 1rem;\n spacing: 6px;\n}\n@st-import Button from "./button/button.st.css";\n\n.cancelButton {\n -st-extends: Button;\n}\n.emphasisBox {}\n'})}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["We recommend calling the project commons file ",(0,t.jsx)(n.code,{children:"project.st.css"}),"."]})})]})}function m(e={}){const{wrapper:n}={...(0,c.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>r,x:()=>i});var o=s(6540);const t={},c=o.createContext(t);function r(e){const n=o.useContext(c);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:r(e.components),o.createElement(c.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/89bbbeae.a5f1201d.js b/assets/js/89bbbeae.38c1abf6.js similarity index 99% rename from assets/js/89bbbeae.a5f1201d.js rename to assets/js/89bbbeae.38c1abf6.js index 0997419f..60d79383 100644 --- a/assets/js/89bbbeae.a5f1201d.js +++ b/assets/js/89bbbeae.38c1abf6.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[4715],{7190:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>t,contentTitle:()=>o,default:()=>x,frontMatter:()=>l,metadata:()=>s,toc:()=>c});const s=JSON.parse('{"id":"references/mixins","title":"Mixins","description":"Stylable mixins enable you to reuse complex styles and CSS behaviors, defined in CSS or Javascript, and apply them to any style-rule during build time.","source":"@site/docs/references/mixins.md","sourceDirName":"references","slug":"/references/mixins","permalink":"/docs/references/mixins","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/mixins.md","tags":[],"version":"current","frontMatter":{"id":"mixins","title":"Mixins"},"sidebar":"Specification Reference","previous":{"title":"Formatters","permalink":"/docs/references/formatters"},"next":{"title":"Variables","permalink":"/docs/references/st-variables"}}');var r=i(4848),a=i(8453);const l={id:"mixins",title:"Mixins"},o=void 0,t={},c=[{value:"CSS mixins",id:"css-mixins",level:2},{value:"Variable overrides",id:"variable-overrides",level:3},{value:"Partial CSS mixins",id:"partial-css-mixins",level:2},{value:"Example",id:"example",level:4},{value:"Example",id:"example-1",level:4},{value:"JavaScript mixins",id:"javascript-mixins",level:2},{value:"Create multiple style-rules",id:"create-multiple-style-rules",level:3},{value:"How mixins are applied",id:"how-mixins-are-applied",level:2},{value:"Considerations when using mixins",id:"considerations-when-using-mixins",level:2},{value:"Escape special characters",id:"escape-special-characters",level:3},{value:"Circular references",id:"circular-references",level:3}];function d(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,a.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Stylable"})," mixins enable you to reuse complex styles and CSS behaviors, defined in CSS or Javascript, and apply them to any style-rule during build time."]}),"\n",(0,r.jsx)(n.p,{children:"Here are some examples of when you can use mixins:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Presets/Variants - create reusable pieces of styling CSS"}),"\n",(0,r.jsx)(n.li,{children:"Layouts - easily describe complex layouts"}),"\n",(0,r.jsx)(n.li,{children:"Effects - easily describe complex effects"}),"\n",(0,r.jsx)(n.li,{children:"Macros - use code to define the CSS macros you need"}),"\n"]}),"\n",(0,r.jsx)(n.admonition,{type:"tip",children:(0,r.jsxs)(n.p,{children:["If you need to return only a single declaration value using code, we recommend instead using ",(0,r.jsx)(n.a,{href:"/docs/references/formatters",children:"formatters"}),"."]})}),"\n",(0,r.jsx)(n.h2,{id:"css-mixins",children:"CSS mixins"}),"\n",(0,r.jsxs)(n.p,{children:["Any CSS stylesheet, class or element that is defined in a ",(0,r.jsx)(n.strong,{children:"Stylable"})," CSS file can be used as a mixin source. You can use either a local class or element, or import the mixin from a different stylesheet."]}),"\n",(0,r.jsx)(n.p,{children:"In the following example, a locally defined class is used as a mixin in the same stylesheet."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:".style-mixin {\n color: green;\n background: yellow;\n}\n.someClass {\n -st-mixin: style-mixin;\n}\n"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:"/* CSS output */\n.someClass {\n color: green; /* from local mixin */\n background: yellow; /* from local mixin */\n}\n"})}),"\n",(0,r.jsxs)(n.p,{children:["Here is an example of a ",(0,r.jsx)(n.strong,{children:"Stylable"})," CSS file that is imported and mixed into the classes of a different stylesheet. The ",(0,r.jsx)(n.code,{children:".rootMixedIn"})," class as a stylesheet and ",(0,r.jsx)(n.code,{children:"classMixedIn"})," as a class."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:"/* mixins.st.css */\n.root {\n color: purple;\n}\n\n.someClass {\n color: green;\n}\n"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:'/* example.st.css - imports the above mixin */\n@st-import MixRoot, [someClass] from "./mixins.st.css";\n\n.rootMixedIn {\n -st-mixin: MixRoot; /* stylesheet mixin */\n}\n\n.classMixedIn {\n -st-mixin: someClass; /* class mixin */\n}\n'})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:"/* CSS output */\n.rootMixedIn {\n color: purple; /* from stylesheet mixin */\n}\n\n.rootMixedIn .someClass {\n /* ruleset added as a result of the stylesheet mixin */\n color: green;\n}\n\n.classMixedIn {\n color: green; /* from class mixin */\n}\n"})}),"\n",(0,r.jsx)(n.h3,{id:"variable-overrides",children:"Variable overrides"}),"\n",(0,r.jsx)(n.p,{children:"CSS mixins can accept named parameters in the following format:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:"mixin(variableName valueOverride, variableName2 valueOverride2)\n"})}),"\n",(0,r.jsx)(n.p,{children:"Multiple variables can be comma separated or written on multiple lines:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:"mixin (\n variableName valueOverride,\n variableName2 valueOverride2\n)\n"})}),"\n",(0,r.jsxs)(n.p,{children:["Using parameters in a mixin enables you to override specific ",(0,r.jsx)(n.a,{href:"/docs/references/st-variables",children:"variables"})," inside of a mixin before they are applied."]}),"\n",(0,r.jsx)(n.p,{children:"Here is an example of using a variable in a CSS mixin and how it can be overridden by the mixin's parameter value."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:":vars {\n color1: green;\n}\n\n.classToMixin {\n background: value(color1);\n}\n\n.targetClass {\n -st-mixin: classToMixin(color1 orange);\n}\n"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:"/* CSS output */\n.classToMixin {\n background: green; /* from local class */\n}\n\n.targetClass {\n background: orange; /* from mixin with override */\n}\n"})}),"\n",(0,r.jsx)(n.h2,{id:"partial-css-mixins",children:"Partial CSS mixins"}),"\n",(0,r.jsxs)(n.p,{children:["Partial CSS Mixins (",(0,r.jsx)(n.code,{children:"-st-partial-mixin"}),") is a continuation of the idea of mixins with parameter overrides. (as described above)"]}),"\n",(0,r.jsxs)(n.p,{children:["Where a regular ",(0,r.jsx)(n.code,{children:"-st-mixin"})," includes all declarations inside the targeted mixed-in class, partial mixins enable you to pass through overriding variable values and mix in only declarations that would be affected by such an override."]}),"\n",(0,r.jsx)(n.p,{children:"For a partial mixin to work, at least one overriding variable must be provided, additional ones being optional."}),"\n",(0,r.jsx)(n.h4,{id:"example",children:"Example"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:":vars {\n color1: red;\n color2: green;\n}\n\n.my-mixin {\n background: value(color1);\n color: value(color2);\n}\n\n.container {\n -st-partial-mixin: my-mixin(color1 gold);\n}\n"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:"/* output */\n.container {\n background: gold;\n}\n"})}),"\n",(0,r.jsx)(n.p,{children:"A partial mixin will include any declaration in the mixed-in class (or rules containing the mixed-in class) that contains a variable usage that will be overridden. Any other variables not overridden inside the mixed in declaration will retain their original values."}),"\n",(0,r.jsx)(n.h4,{id:"example-1",children:"Example"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:":vars {\n color1: red;\n color2: green;\n size1: 2px;\n}\n\n.my-mixin {\n background: value(color1);\n color: value(color2);\n}\n\n.my-mixin .part {\n border: value(size1) solid value(color2);\n}\n\n.container {\n -st-partial-mixin: my-mixin(color1 gold, size1 5px);\n}\n"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:"/* output */\n.container {\n background: gold;\n}\n\n.container .part {\n border: 5px solid green;\n}\n"})}),"\n",(0,r.jsx)(n.h2,{id:"javascript-mixins",children:"JavaScript mixins"}),"\n",(0,r.jsx)(n.p,{children:"JavaScript mixins allow you to create complex structures in CSS based on the arguments passed to the mixin."}),"\n",(0,r.jsx)(n.p,{children:"A JavaScript mixin returns a CSS fragment which can contain multiple declarations with optional sub style-rules."}),"\n",(0,r.jsx)(n.p,{children:"Arguments are passed to the mixin as a string argument and it's the mixin's responsibility to parse them."}),"\n",(0,r.jsx)(n.p,{children:"Here is an example of a mixin receiving multiple arguments and returning multiple declarations into the target ruleset."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"/* file my-mixin.js */\nmodule.exports = function colorAndBg([color, bgColor]) {\n /* arguments: array of string types */\n\n return {\n color: color,\n background: bgColor,\n };\n};\n"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:'/* file example.st.css */\n@st-import colorAndBg from "./my-mixin";\n\n.codeMixedIn {\n -st-mixin: colorAndBg(green, orange);\n font-family: monospace;\n}\n'})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:"/* CSS output */\n.codeMixedIn {\n color: green; /* from JS mixin */\n background: orange; /* from JS mixin */\n font-family: monospace; /* from local class */\n}\n"})}),"\n",(0,r.jsx)(n.h3,{id:"create-multiple-style-rules",children:"Create multiple style-rules"}),"\n",(0,r.jsx)(n.p,{children:"Mixins can return multiple style-rules that are mixed into the target stylesheet. These style-rules can be written with the following syntax options:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"selector"})," - resulting ruleset is appended as a descendent selector to its mixed in target (in below example ",(0,r.jsx)(n.code,{children:".otherClass"}),")"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"&selector"})," - resulting ruleset references the parent selector into which it was mixed in (in below example ",(0,r.jsx)(n.code,{children:"&:hover"}),", the parent selector is ",(0,r.jsx)(n.code,{children:".codeMixedIn"}),")"]}),"\n"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"/* file my-mixin.js */\nmodule.exports = function complexMixin([color, bgColor]) {\n /* arguments: array of string types */\n\n return {\n color: color,\n background: bgColor,\n '&:hover': {\n color: 'gold',\n },\n '.otherClass': {\n color: 'purple',\n },\n };\n};\n"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:'/* file example.st.css */\n@st-import complexMixin from "./my-mixin";\n\n.codeMixedIn {\n -st-mixin: complexMixin(green, orange);\n font-family: monospace;\n}\n'})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:"/* CSS output */\n.codeMixedIn {\n color: green; /* from JS mixin */\n background: orange; /* from JS mixin */\n font-family: monospace; /* from local class */\n}\n\n.codeMixedIn:hover {\n /* from JS mixin with & */\n color: gold;\n}\n\n.codeMixedIn .otherClass {\n /* from JS mixin with appended selector */\n color: purple;\n}\n"})}),"\n",(0,r.jsx)(n.h2,{id:"how-mixins-are-applied",children:"How mixins are applied"}),"\n",(0,r.jsx)(n.p,{children:"Mixins can add CSS declarations to the CSS ruleset to which they are applied."}),"\n",(0,r.jsxs)(n.p,{children:["Rules are added at the position in the CSS where the ",(0,r.jsx)(n.code,{children:"-st-mixin"})," is declared.\nAny selectors that are appended as a result of the mixin are added directly after the ruleset that the mixin was applied to."]}),"\n",(0,r.jsxs)(n.p,{children:["You can apply multiple mixins from either CSS or JavaScript, or both separated by comma ",(0,r.jsx)(n.code,{children:"-st-mixin: mixinA, mixinB"}),".\nMultiple mixins are applied according to the order that they are declared left to right."]}),"\n",(0,r.jsx)(n.h2,{id:"considerations-when-using-mixins",children:"Considerations when using mixins"}),"\n",(0,r.jsxs)(n.p,{children:["Take a look at these considerations before working with ",(0,r.jsx)(n.strong,{children:"Stylable"})," mixins."]}),"\n",(0,r.jsx)(n.h3,{id:"escape-special-characters",children:"Escape special characters"}),"\n",(0,r.jsxs)(n.p,{children:["You can escape special characters by wrapping them with quotes or using a backslash (",(0,r.jsx)(n.code,{children:"\\"}),")."]}),"\n",(0,r.jsx)(n.p,{children:"Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:'.x {\n /* use quotations to include comma */\n -st-mixin: mix(300, \'xx,x\'); /* ["300", "xx,x"] */\n}\n'})}),"\n",(0,r.jsx)(n.p,{children:"They can also be used to include quotes or backslashes as part of the parameter."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:'.y {\n /* escape slashes */\n -st-mixin: mix(300, \'"xxx"\'); /* ["300", "\\"xxx\\""] */\n}\n'})}),"\n",(0,r.jsx)(n.h3,{id:"circular-references",children:"Circular references"}),"\n",(0,r.jsxs)(n.p,{children:["It is possible to reach a state where you have circular references between mixins. These cannot be resolved, and a diagnostics warning is issued in your ",(0,r.jsx)(n.strong,{children:"Stylable"})," code intelligence and build process."]})]})}function x(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},8453:(e,n,i)=>{i.d(n,{R:()=>l,x:()=>o});var s=i(6540);const r={},a=s.createContext(r);function l(e){const n=s.useContext(a);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:l(e.components),s.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[4715],{7983:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>t,contentTitle:()=>o,default:()=>x,frontMatter:()=>l,metadata:()=>s,toc:()=>c});const s=JSON.parse('{"id":"references/mixins","title":"Mixins","description":"Stylable mixins enable you to reuse complex styles and CSS behaviors, defined in CSS or Javascript, and apply them to any style-rule during build time.","source":"@site/docs/references/mixins.md","sourceDirName":"references","slug":"/references/mixins","permalink":"/docs/references/mixins","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/mixins.md","tags":[],"version":"current","frontMatter":{"id":"mixins","title":"Mixins"},"sidebar":"Specification Reference","previous":{"title":"Formatters","permalink":"/docs/references/formatters"},"next":{"title":"Variables","permalink":"/docs/references/st-variables"}}');var r=i(4848),a=i(8453);const l={id:"mixins",title:"Mixins"},o=void 0,t={},c=[{value:"CSS mixins",id:"css-mixins",level:2},{value:"Variable overrides",id:"variable-overrides",level:3},{value:"Partial CSS mixins",id:"partial-css-mixins",level:2},{value:"Example",id:"example",level:4},{value:"Example",id:"example-1",level:4},{value:"JavaScript mixins",id:"javascript-mixins",level:2},{value:"Create multiple style-rules",id:"create-multiple-style-rules",level:3},{value:"How mixins are applied",id:"how-mixins-are-applied",level:2},{value:"Considerations when using mixins",id:"considerations-when-using-mixins",level:2},{value:"Escape special characters",id:"escape-special-characters",level:3},{value:"Circular references",id:"circular-references",level:3}];function d(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,a.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Stylable"})," mixins enable you to reuse complex styles and CSS behaviors, defined in CSS or Javascript, and apply them to any style-rule during build time."]}),"\n",(0,r.jsx)(n.p,{children:"Here are some examples of when you can use mixins:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Presets/Variants - create reusable pieces of styling CSS"}),"\n",(0,r.jsx)(n.li,{children:"Layouts - easily describe complex layouts"}),"\n",(0,r.jsx)(n.li,{children:"Effects - easily describe complex effects"}),"\n",(0,r.jsx)(n.li,{children:"Macros - use code to define the CSS macros you need"}),"\n"]}),"\n",(0,r.jsx)(n.admonition,{type:"tip",children:(0,r.jsxs)(n.p,{children:["If you need to return only a single declaration value using code, we recommend instead using ",(0,r.jsx)(n.a,{href:"/docs/references/formatters",children:"formatters"}),"."]})}),"\n",(0,r.jsx)(n.h2,{id:"css-mixins",children:"CSS mixins"}),"\n",(0,r.jsxs)(n.p,{children:["Any CSS stylesheet, class or element that is defined in a ",(0,r.jsx)(n.strong,{children:"Stylable"})," CSS file can be used as a mixin source. You can use either a local class or element, or import the mixin from a different stylesheet."]}),"\n",(0,r.jsx)(n.p,{children:"In the following example, a locally defined class is used as a mixin in the same stylesheet."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:".style-mixin {\n color: green;\n background: yellow;\n}\n.someClass {\n -st-mixin: style-mixin;\n}\n"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:"/* CSS output */\n.someClass {\n color: green; /* from local mixin */\n background: yellow; /* from local mixin */\n}\n"})}),"\n",(0,r.jsxs)(n.p,{children:["Here is an example of a ",(0,r.jsx)(n.strong,{children:"Stylable"})," CSS file that is imported and mixed into the classes of a different stylesheet. The ",(0,r.jsx)(n.code,{children:".rootMixedIn"})," class as a stylesheet and ",(0,r.jsx)(n.code,{children:"classMixedIn"})," as a class."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:"/* mixins.st.css */\n.root {\n color: purple;\n}\n\n.someClass {\n color: green;\n}\n"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:'/* example.st.css - imports the above mixin */\n@st-import MixRoot, [someClass] from "./mixins.st.css";\n\n.rootMixedIn {\n -st-mixin: MixRoot; /* stylesheet mixin */\n}\n\n.classMixedIn {\n -st-mixin: someClass; /* class mixin */\n}\n'})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:"/* CSS output */\n.rootMixedIn {\n color: purple; /* from stylesheet mixin */\n}\n\n.rootMixedIn .someClass {\n /* ruleset added as a result of the stylesheet mixin */\n color: green;\n}\n\n.classMixedIn {\n color: green; /* from class mixin */\n}\n"})}),"\n",(0,r.jsx)(n.h3,{id:"variable-overrides",children:"Variable overrides"}),"\n",(0,r.jsx)(n.p,{children:"CSS mixins can accept named parameters in the following format:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:"mixin(variableName valueOverride, variableName2 valueOverride2)\n"})}),"\n",(0,r.jsx)(n.p,{children:"Multiple variables can be comma separated or written on multiple lines:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:"mixin (\n variableName valueOverride,\n variableName2 valueOverride2\n)\n"})}),"\n",(0,r.jsxs)(n.p,{children:["Using parameters in a mixin enables you to override specific ",(0,r.jsx)(n.a,{href:"/docs/references/st-variables",children:"variables"})," inside of a mixin before they are applied."]}),"\n",(0,r.jsx)(n.p,{children:"Here is an example of using a variable in a CSS mixin and how it can be overridden by the mixin's parameter value."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:":vars {\n color1: green;\n}\n\n.classToMixin {\n background: value(color1);\n}\n\n.targetClass {\n -st-mixin: classToMixin(color1 orange);\n}\n"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:"/* CSS output */\n.classToMixin {\n background: green; /* from local class */\n}\n\n.targetClass {\n background: orange; /* from mixin with override */\n}\n"})}),"\n",(0,r.jsx)(n.h2,{id:"partial-css-mixins",children:"Partial CSS mixins"}),"\n",(0,r.jsxs)(n.p,{children:["Partial CSS Mixins (",(0,r.jsx)(n.code,{children:"-st-partial-mixin"}),") is a continuation of the idea of mixins with parameter overrides. (as described above)"]}),"\n",(0,r.jsxs)(n.p,{children:["Where a regular ",(0,r.jsx)(n.code,{children:"-st-mixin"})," includes all declarations inside the targeted mixed-in class, partial mixins enable you to pass through overriding variable values and mix in only declarations that would be affected by such an override."]}),"\n",(0,r.jsx)(n.p,{children:"For a partial mixin to work, at least one overriding variable must be provided, additional ones being optional."}),"\n",(0,r.jsx)(n.h4,{id:"example",children:"Example"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:":vars {\n color1: red;\n color2: green;\n}\n\n.my-mixin {\n background: value(color1);\n color: value(color2);\n}\n\n.container {\n -st-partial-mixin: my-mixin(color1 gold);\n}\n"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:"/* output */\n.container {\n background: gold;\n}\n"})}),"\n",(0,r.jsx)(n.p,{children:"A partial mixin will include any declaration in the mixed-in class (or rules containing the mixed-in class) that contains a variable usage that will be overridden. Any other variables not overridden inside the mixed in declaration will retain their original values."}),"\n",(0,r.jsx)(n.h4,{id:"example-1",children:"Example"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:":vars {\n color1: red;\n color2: green;\n size1: 2px;\n}\n\n.my-mixin {\n background: value(color1);\n color: value(color2);\n}\n\n.my-mixin .part {\n border: value(size1) solid value(color2);\n}\n\n.container {\n -st-partial-mixin: my-mixin(color1 gold, size1 5px);\n}\n"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:"/* output */\n.container {\n background: gold;\n}\n\n.container .part {\n border: 5px solid green;\n}\n"})}),"\n",(0,r.jsx)(n.h2,{id:"javascript-mixins",children:"JavaScript mixins"}),"\n",(0,r.jsx)(n.p,{children:"JavaScript mixins allow you to create complex structures in CSS based on the arguments passed to the mixin."}),"\n",(0,r.jsx)(n.p,{children:"A JavaScript mixin returns a CSS fragment which can contain multiple declarations with optional sub style-rules."}),"\n",(0,r.jsx)(n.p,{children:"Arguments are passed to the mixin as a string argument and it's the mixin's responsibility to parse them."}),"\n",(0,r.jsx)(n.p,{children:"Here is an example of a mixin receiving multiple arguments and returning multiple declarations into the target ruleset."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"/* file my-mixin.js */\nmodule.exports = function colorAndBg([color, bgColor]) {\n /* arguments: array of string types */\n\n return {\n color: color,\n background: bgColor,\n };\n};\n"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:'/* file example.st.css */\n@st-import colorAndBg from "./my-mixin";\n\n.codeMixedIn {\n -st-mixin: colorAndBg(green, orange);\n font-family: monospace;\n}\n'})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:"/* CSS output */\n.codeMixedIn {\n color: green; /* from JS mixin */\n background: orange; /* from JS mixin */\n font-family: monospace; /* from local class */\n}\n"})}),"\n",(0,r.jsx)(n.h3,{id:"create-multiple-style-rules",children:"Create multiple style-rules"}),"\n",(0,r.jsx)(n.p,{children:"Mixins can return multiple style-rules that are mixed into the target stylesheet. These style-rules can be written with the following syntax options:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"selector"})," - resulting ruleset is appended as a descendent selector to its mixed in target (in below example ",(0,r.jsx)(n.code,{children:".otherClass"}),")"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"&selector"})," - resulting ruleset references the parent selector into which it was mixed in (in below example ",(0,r.jsx)(n.code,{children:"&:hover"}),", the parent selector is ",(0,r.jsx)(n.code,{children:".codeMixedIn"}),")"]}),"\n"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"/* file my-mixin.js */\nmodule.exports = function complexMixin([color, bgColor]) {\n /* arguments: array of string types */\n\n return {\n color: color,\n background: bgColor,\n '&:hover': {\n color: 'gold',\n },\n '.otherClass': {\n color: 'purple',\n },\n };\n};\n"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:'/* file example.st.css */\n@st-import complexMixin from "./my-mixin";\n\n.codeMixedIn {\n -st-mixin: complexMixin(green, orange);\n font-family: monospace;\n}\n'})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:"/* CSS output */\n.codeMixedIn {\n color: green; /* from JS mixin */\n background: orange; /* from JS mixin */\n font-family: monospace; /* from local class */\n}\n\n.codeMixedIn:hover {\n /* from JS mixin with & */\n color: gold;\n}\n\n.codeMixedIn .otherClass {\n /* from JS mixin with appended selector */\n color: purple;\n}\n"})}),"\n",(0,r.jsx)(n.h2,{id:"how-mixins-are-applied",children:"How mixins are applied"}),"\n",(0,r.jsx)(n.p,{children:"Mixins can add CSS declarations to the CSS ruleset to which they are applied."}),"\n",(0,r.jsxs)(n.p,{children:["Rules are added at the position in the CSS where the ",(0,r.jsx)(n.code,{children:"-st-mixin"})," is declared.\nAny selectors that are appended as a result of the mixin are added directly after the ruleset that the mixin was applied to."]}),"\n",(0,r.jsxs)(n.p,{children:["You can apply multiple mixins from either CSS or JavaScript, or both separated by comma ",(0,r.jsx)(n.code,{children:"-st-mixin: mixinA, mixinB"}),".\nMultiple mixins are applied according to the order that they are declared left to right."]}),"\n",(0,r.jsx)(n.h2,{id:"considerations-when-using-mixins",children:"Considerations when using mixins"}),"\n",(0,r.jsxs)(n.p,{children:["Take a look at these considerations before working with ",(0,r.jsx)(n.strong,{children:"Stylable"})," mixins."]}),"\n",(0,r.jsx)(n.h3,{id:"escape-special-characters",children:"Escape special characters"}),"\n",(0,r.jsxs)(n.p,{children:["You can escape special characters by wrapping them with quotes or using a backslash (",(0,r.jsx)(n.code,{children:"\\"}),")."]}),"\n",(0,r.jsx)(n.p,{children:"Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:'.x {\n /* use quotations to include comma */\n -st-mixin: mix(300, \'xx,x\'); /* ["300", "xx,x"] */\n}\n'})}),"\n",(0,r.jsx)(n.p,{children:"They can also be used to include quotes or backslashes as part of the parameter."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:'.y {\n /* escape slashes */\n -st-mixin: mix(300, \'"xxx"\'); /* ["300", "\\"xxx\\""] */\n}\n'})}),"\n",(0,r.jsx)(n.h3,{id:"circular-references",children:"Circular references"}),"\n",(0,r.jsxs)(n.p,{children:["It is possible to reach a state where you have circular references between mixins. These cannot be resolved, and a diagnostics warning is issued in your ",(0,r.jsx)(n.strong,{children:"Stylable"})," code intelligence and build process."]})]})}function x(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},8453:(e,n,i)=>{i.d(n,{R:()=>l,x:()=>o});var s=i(6540);const r={},a=s.createContext(r);function l(e){const n=s.useContext(a);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:l(e.components),s.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/8abe6768.ac2745d5.js b/assets/js/8abe6768.6c61f143.js similarity index 67% rename from assets/js/8abe6768.ac2745d5.js rename to assets/js/8abe6768.6c61f143.js index 1428bcd6..361814ed 100644 --- a/assets/js/8abe6768.ac2745d5.js +++ b/assets/js/8abe6768.6c61f143.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[7774],{8778:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>u,contentTitle:()=>c,default:()=>h,frontMatter:()=>i,metadata:()=>r,toc:()=>d});const r=JSON.parse('{"id":"getting-started/stylable-config","title":"stylable.config.js","description":"The stylable.config.js file acts as a central place where you can write your top level configuration for the entire project, so that they are re-used across builds and integrations, and reduce code duplications.","source":"@site/docs/getting-started/stylable-config.mdx","sourceDirName":"getting-started","slug":"/getting-started/stylable-config","permalink":"/docs/getting-started/stylable-config","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/getting-started/stylable-config.mdx","tags":[],"version":"current","frontMatter":{"id":"stylable-config","title":"stylable.config.js"},"sidebar":"Discover","previous":{"title":"Manual Integration","permalink":"/docs/getting-started/manual-integration"},"next":{"title":"VSCode Extension","permalink":"/docs/getting-started/tooling/stylable-intelligence"}}');var s=n(4848),a=n(8453),l=n(9489),o=n(7227);n(2250);const i={id:"stylable-config",title:"stylable.config.js"},c=void 0,u={},d=[{value:"defaultConfig
",id:"defaultconfig",level:2},{value:"stcConfig
",id:"stcconfig",level:2},{value:"webpackPlugin
",id:"webpackplugin",level:2}];function p(e){const t={a:"a",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,a.R)(),...e.components},{Details:n}=t;return n||function(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.code,{children:"stylable.config.js"})," file acts as a central place where you can write your top level configuration for the entire project, so that they are re-used across builds and integrations, and reduce code duplications."]}),"\n",(0,s.jsx)(t.p,{children:"The configuration file should be located in the project root directory in order to be picked up automatically."}),"\n",(0,s.jsx)(t.h2,{id:"defaultconfig",children:(0,s.jsx)(t.code,{children:"defaultConfig"})}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.code,{children:"defaultConfig"})," export field is used to set default configuration for Stylable instances across all integrations and tooling."]}),"\n",(0,s.jsx)(t.p,{children:"Currently, the following options are supported:"}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.a,{href:"../references/programmatic-api#resolvenamespace",children:(0,s.jsx)(t.code,{children:"resolveNamespace"})})," - control the namespace of the generated CSS"]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.a,{href:"../references/programmatic-api#moduleresolver",children:(0,s.jsx)(t.code,{children:"resolveModule"})})," - control the module resolution"]}),"\n"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",metastring:'title="stylable.config.js - example"',children:"const { createDefaultResolver } = require('@stylable/core');\nconst { createNamespaceStrategyNode } = require('@stylable/node');\nconst { TsconfigPathsPlugin } = require('tsconfig-paths-webpack-plugin');\n\nmodule.exports = {\n defaultConfig(fs) {\n return {\n // set a custom namespace resolver\n resolveNamespace: createNamespaceStrategyNode({\n prefix: 'mylib',\n strict: true,\n }),\n\n // set a custom module resolver with TS paths resolution\n resolveModule: createDefaultResolver(fs, {\n plugins: [\n new TsconfigPathsPlugin({\n configFile: require.resolve('./tsconfig.json'),\n extensions: ['.st.css'],\n }),\n ],\n }),\n };\n },\n};\n"})}),"\n",(0,s.jsx)(t.h2,{id:"stcconfig",children:(0,s.jsx)(t.code,{children:"stcConfig"})}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.code,{children:"stcConfig"})," export field is used as a single point to define multiple build tasks for the Stylable CLI."]}),"\n",(0,s.jsxs)(t.p,{children:["To run this configuration, either run the CLI using the ",(0,s.jsx)(t.code,{children:"stc"})," command, or pass the ",(0,s.jsx)(t.code,{children:"stcConfig"})," option to the Webpack or rollup integrations."]}),"\n","\n",(0,s.jsxs)(l.A,{groupId:"stcConfigExamples",children:[(0,s.jsx)(o.A,{value:"singleProject",label:"Single build task",default:!0,children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"const { stcConfig } = require('@stylable/cli');\n\n// use the `stcConfig` function to get type completion and validation\nexports.stcConfig = stcConfig({\n\n // build type definitions for all stylesheets into the st-types directory\n options: {\n srcDir: './src',\n outDir: './st-types',\n dts: true\n }\n});\n"})})}),(0,s.jsx)(o.A,{value:"multiProject",label:"Multiple build tasks",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"const { stcConfig } = require('@stylable/cli');\n\nexports.stcConfig = stcConfig({\n\n // default options for each build task set to output sources\n options: {\n srcDir: './src',\n outDir: './dist',\n outputSources: true,\n },\n\n // define a glob path for each build task\n projects: ['packages/*']\n});\n"})})})]}),"\n",(0,s.jsxs)(n,{children:[(0,s.jsx)("summary",{children:"Multiple build tasks interface"}),(0,s.jsx)("p",{children:(0,s.jsxs)(t.p,{children:["Projects allow sharing ",(0,s.jsx)(t.code,{children:"stc"})," configurations and management of Stylable projects in one location. They provides a controllable and predictable build order with caching optimizations."]})}),(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ts",children:"interface MultipleProjectsConfig{\n options?: PartialBuildOptions;\n presets?: Presets ;\n projects: Projects ;\n projectsOptions?: {\n resolveRequests?: ResolveRequests;\n };\n}\n\ntype Projects =\n | Array \n | Record ;\n\ntype ProjectEntryValues =\n | ProjectEntryValue \n | Array >;\n\ntype ProjectEntryValue =\n | PRESET\n | PartialBuildOptions\n | {\n preset?: PRESET;\n presets?: Array ;\n options: PartialBuildOptions;\n };\n"})})]}),"\n","\n",(0,s.jsxs)(t.p,{children:["To learn more about the various CLI flags, see the ",(0,s.jsx)(t.a,{href:"./tooling/cli#cli-arguments",children:"CLI page"}),"."]}),"\n","\n",(0,s.jsx)(t.h2,{id:"webpackplugin",children:(0,s.jsx)(t.code,{children:"webpackPlugin"})}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.code,{children:"webpackPlugin"})," export field is used to configure any Stylable Webpack plugins in the project. The ",(0,s.jsx)(t.code,{children:"StylableWebpackPlugin"})," will attempt to load the nearest ",(0,s.jsx)(t.code,{children:"stylable.config.js"})," file and use its ",(0,s.jsx)(t.code,{children:"webpackPlugin"})," export as for its options."]}),"\n",(0,s.jsxs)(t.p,{children:["To learn more about the building Stylable using Webpack, see the ",(0,s.jsx)(t.a,{href:"./webpack-integration#stylableconfigjs",children:"Webpack integration"})," page."]})]})}function h(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}},7227:(e,t,n)=>{n.d(t,{A:()=>l});n(6540);var r=n(4164);const s={tabItem:"tabItem_Ymn6"};var a=n(4848);function l(e){let{children:t,hidden:n,className:l}=e;return(0,a.jsx)("div",{role:"tabpanel",className:(0,r.A)(s.tabItem,l),hidden:n,children:t})}},9489:(e,t,n)=>{n.d(t,{A:()=>w});var r=n(6540),s=n(4164),a=n(4245),l=n(6347),o=n(6494),i=n(2814),c=n(5167),u=n(9900);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:s}}=e;return{value:t,label:n,attributes:r,default:s}}))}(n);return function(e){const t=(0,c.XI)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function h(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function f(e){let{queryString:t=!1,groupId:n}=e;const s=(0,l.W6)(),a=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,i.aZ)(a),(0,r.useCallback)((e=>{if(!a)return;const t=new URLSearchParams(s.location.search);t.set(a,e),s.replace({...s.location,search:t.toString()})}),[a,s])]}function g(e){const{defaultValue:t,queryString:n=!1,groupId:s}=e,a=p(e),[l,i]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!h({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:a}))),[c,d]=f({queryString:n,groupId:s}),[g,b]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[s,a]=(0,u.Dv)(n);return[s,(0,r.useCallback)((e=>{n&&a.set(e)}),[n,a])]}({groupId:s}),m=(()=>{const e=c??g;return h({value:e,tabValues:a})?e:null})();(0,o.A)((()=>{m&&i(m)}),[m]);return{selectedValue:l,selectValue:(0,r.useCallback)((e=>{if(!h({value:e,tabValues:a}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),b(e)}),[d,b,a]),tabValues:a}}var b=n(1062);const m={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var j=n(4848);function y(e){let{className:t,block:n,selectedValue:r,selectValue:l,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,a.a_)(),u=e=>{const t=e.currentTarget,n=i.indexOf(t),s=o[n].value;s!==r&&(c(t),l(s))},d=e=>{let t=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const n=i.indexOf(e.currentTarget)+1;t=i[n]??i[0];break}case"ArrowLeft":{const n=i.indexOf(e.currentTarget)-1;t=i[n]??i[i.length-1];break}}t?.focus()};return(0,j.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":n},t),children:o.map((e=>{let{value:t,label:n,attributes:a}=e;return(0,j.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>i.push(e),onKeyDown:d,onClick:u,...a,className:(0,s.A)("tabs__item",m.tabItem,a?.className,{"tabs__item--active":r===t}),children:n??t},t)}))})}function x(e){let{lazy:t,children:n,selectedValue:a}=e;const l=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=l.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:(0,s.A)("margin-top--md",e.props.className)}):null}return(0,j.jsx)("div",{className:"margin-top--md",children:l.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==a})))})}function v(e){const t=g(e);return(0,j.jsxs)("div",{className:(0,s.A)("tabs-container",m.tabList),children:[(0,j.jsx)(y,{...t,...e}),(0,j.jsx)(x,{...t,...e})]})}function w(e){const t=(0,b.A)();return(0,j.jsx)(v,{...e,children:d(e.children)},String(t))}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[7774],{7062:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>u,contentTitle:()=>c,default:()=>h,frontMatter:()=>i,metadata:()=>r,toc:()=>d});const r=JSON.parse('{"id":"getting-started/stylable-config","title":"stylable.config.js","description":"The stylable.config.js file acts as a central place where you can write your top level configuration for the entire project, so that they are re-used across builds and integrations, and reduce code duplications.","source":"@site/docs/getting-started/stylable-config.mdx","sourceDirName":"getting-started","slug":"/getting-started/stylable-config","permalink":"/docs/getting-started/stylable-config","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/getting-started/stylable-config.mdx","tags":[],"version":"current","frontMatter":{"id":"stylable-config","title":"stylable.config.js"},"sidebar":"Discover","previous":{"title":"Manual Integration","permalink":"/docs/getting-started/manual-integration"},"next":{"title":"VSCode Extension","permalink":"/docs/getting-started/tooling/stylable-intelligence"}}');var s=n(4848),a=n(8453),l=n(1470),o=n(9365);n(1432);const i={id:"stylable-config",title:"stylable.config.js"},c=void 0,u={},d=[{value:" defaultConfig
",id:"defaultconfig",level:2},{value:"stcConfig
",id:"stcconfig",level:2},{value:"webpackPlugin
",id:"webpackplugin",level:2}];function p(e){const t={a:"a",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,a.R)(),...e.components},{Details:n}=t;return n||function(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.code,{children:"stylable.config.js"})," file acts as a central place where you can write your top level configuration for the entire project, so that they are re-used across builds and integrations, and reduce code duplications."]}),"\n",(0,s.jsx)(t.p,{children:"The configuration file should be located in the project root directory in order to be picked up automatically."}),"\n",(0,s.jsx)(t.h2,{id:"defaultconfig",children:(0,s.jsx)(t.code,{children:"defaultConfig"})}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.code,{children:"defaultConfig"})," export field is used to set default configuration for Stylable instances across all integrations and tooling."]}),"\n",(0,s.jsx)(t.p,{children:"Currently, the following options are supported:"}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.a,{href:"../references/programmatic-api#resolvenamespace",children:(0,s.jsx)(t.code,{children:"resolveNamespace"})})," - control the namespace of the generated CSS"]}),"\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.a,{href:"../references/programmatic-api#moduleresolver",children:(0,s.jsx)(t.code,{children:"resolveModule"})})," - control the module resolution"]}),"\n"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",metastring:'title="stylable.config.js - example"',children:"const { createDefaultResolver } = require('@stylable/core');\nconst { createNamespaceStrategyNode } = require('@stylable/node');\nconst { TsconfigPathsPlugin } = require('tsconfig-paths-webpack-plugin');\n\nmodule.exports = {\n defaultConfig(fs) {\n return {\n // set a custom namespace resolver\n resolveNamespace: createNamespaceStrategyNode({\n prefix: 'mylib',\n strict: true,\n }),\n\n // set a custom module resolver with TS paths resolution\n resolveModule: createDefaultResolver(fs, {\n plugins: [\n new TsconfigPathsPlugin({\n configFile: require.resolve('./tsconfig.json'),\n extensions: ['.st.css'],\n }),\n ],\n }),\n };\n },\n};\n"})}),"\n",(0,s.jsx)(t.h2,{id:"stcconfig",children:(0,s.jsx)(t.code,{children:"stcConfig"})}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.code,{children:"stcConfig"})," export field is used as a single point to define multiple build tasks for the Stylable CLI."]}),"\n",(0,s.jsxs)(t.p,{children:["To run this configuration, either run the CLI using the ",(0,s.jsx)(t.code,{children:"stc"})," command, or pass the ",(0,s.jsx)(t.code,{children:"stcConfig"})," option to the Webpack or rollup integrations."]}),"\n","\n",(0,s.jsxs)(l.A,{groupId:"stcConfigExamples",children:[(0,s.jsx)(o.A,{value:"singleProject",label:"Single build task",default:!0,children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"const { stcConfig } = require('@stylable/cli');\n\n// use the `stcConfig` function to get type completion and validation\nexports.stcConfig = stcConfig({\n\n // build type definitions for all stylesheets into the st-types directory\n options: {\n srcDir: './src',\n outDir: './st-types',\n dts: true\n }\n});\n"})})}),(0,s.jsx)(o.A,{value:"multiProject",label:"Multiple build tasks",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-js",children:"const { stcConfig } = require('@stylable/cli');\n\nexports.stcConfig = stcConfig({\n\n // default options for each build task set to output sources\n options: {\n srcDir: './src',\n outDir: './dist',\n outputSources: true,\n },\n\n // define a glob path for each build task\n projects: ['packages/*']\n});\n"})})})]}),"\n",(0,s.jsxs)(n,{children:[(0,s.jsx)("summary",{children:"Multiple build tasks interface"}),(0,s.jsx)("p",{children:(0,s.jsxs)(t.p,{children:["Projects allow sharing ",(0,s.jsx)(t.code,{children:"stc"})," configurations and management of Stylable projects in one location. They provides a controllable and predictable build order with caching optimizations."]})}),(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ts",children:"interface MultipleProjectsConfig{\n options?: PartialBuildOptions;\n presets?: Presets ;\n projects: Projects ;\n projectsOptions?: {\n resolveRequests?: ResolveRequests;\n };\n}\n\ntype Projects =\n | Array \n | Record ;\n\ntype ProjectEntryValues =\n | ProjectEntryValue \n | Array >;\n\ntype ProjectEntryValue =\n | PRESET\n | PartialBuildOptions\n | {\n preset?: PRESET;\n presets?: Array ;\n options: PartialBuildOptions;\n };\n"})})]}),"\n","\n",(0,s.jsxs)(t.p,{children:["To learn more about the various CLI flags, see the ",(0,s.jsx)(t.a,{href:"./tooling/cli#cli-arguments",children:"CLI page"}),"."]}),"\n","\n",(0,s.jsx)(t.h2,{id:"webpackplugin",children:(0,s.jsx)(t.code,{children:"webpackPlugin"})}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.code,{children:"webpackPlugin"})," export field is used to configure any Stylable Webpack plugins in the project. The ",(0,s.jsx)(t.code,{children:"StylableWebpackPlugin"})," will attempt to load the nearest ",(0,s.jsx)(t.code,{children:"stylable.config.js"})," file and use its ",(0,s.jsx)(t.code,{children:"webpackPlugin"})," export as for its options."]}),"\n",(0,s.jsxs)(t.p,{children:["To learn more about the building Stylable using Webpack, see the ",(0,s.jsx)(t.a,{href:"./webpack-integration#stylableconfigjs",children:"Webpack integration"})," page."]})]})}function h(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}},9365:(e,t,n)=>{n.d(t,{A:()=>l});n(6540);var r=n(4164);const s={tabItem:"tabItem_Ymn6"};var a=n(4848);function l(e){let{children:t,hidden:n,className:l}=e;return(0,a.jsx)("div",{role:"tabpanel",className:(0,r.A)(s.tabItem,l),hidden:n,children:t})}},1470:(e,t,n)=>{n.d(t,{A:()=>w});var r=n(6540),s=n(4164),a=n(3104),l=n(6347),o=n(205),i=n(7485),c=n(1682),u=n(679);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:s}}=e;return{value:t,label:n,attributes:r,default:s}}))}(n);return function(e){const t=(0,c.XI)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function h(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function f(e){let{queryString:t=!1,groupId:n}=e;const s=(0,l.W6)(),a=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,i.aZ)(a),(0,r.useCallback)((e=>{if(!a)return;const t=new URLSearchParams(s.location.search);t.set(a,e),s.replace({...s.location,search:t.toString()})}),[a,s])]}function g(e){const{defaultValue:t,queryString:n=!1,groupId:s}=e,a=p(e),[l,i]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!h({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:a}))),[c,d]=f({queryString:n,groupId:s}),[g,b]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[s,a]=(0,u.Dv)(n);return[s,(0,r.useCallback)((e=>{n&&a.set(e)}),[n,a])]}({groupId:s}),m=(()=>{const e=c??g;return h({value:e,tabValues:a})?e:null})();(0,o.A)((()=>{m&&i(m)}),[m]);return{selectedValue:l,selectValue:(0,r.useCallback)((e=>{if(!h({value:e,tabValues:a}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),b(e)}),[d,b,a]),tabValues:a}}var b=n(2303);const m={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var j=n(4848);function y(e){let{className:t,block:n,selectedValue:r,selectValue:l,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,a.a_)(),u=e=>{const t=e.currentTarget,n=i.indexOf(t),s=o[n].value;s!==r&&(c(t),l(s))},d=e=>{let t=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const n=i.indexOf(e.currentTarget)+1;t=i[n]??i[0];break}case"ArrowLeft":{const n=i.indexOf(e.currentTarget)-1;t=i[n]??i[i.length-1];break}}t?.focus()};return(0,j.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":n},t),children:o.map((e=>{let{value:t,label:n,attributes:a}=e;return(0,j.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>{i.push(e)},onKeyDown:d,onClick:u,...a,className:(0,s.A)("tabs__item",m.tabItem,a?.className,{"tabs__item--active":r===t}),children:n??t},t)}))})}function x(e){let{lazy:t,children:n,selectedValue:a}=e;const l=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=l.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:(0,s.A)("margin-top--md",e.props.className)}):null}return(0,j.jsx)("div",{className:"margin-top--md",children:l.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==a})))})}function v(e){const t=g(e);return(0,j.jsxs)("div",{className:(0,s.A)("tabs-container",m.tabList),children:[(0,j.jsx)(y,{...t,...e}),(0,j.jsx)(x,{...t,...e})]})}function w(e){const t=(0,b.A)();return(0,j.jsx)(v,{...e,children:d(e.children)},String(t))}}}]); \ No newline at end of file diff --git a/assets/js/922647ed.41f45d35.js b/assets/js/922647ed.156ba5b9.js similarity index 98% rename from assets/js/922647ed.41f45d35.js rename to assets/js/922647ed.156ba5b9.js index d9d09e96..5bccb1f2 100644 --- a/assets/js/922647ed.41f45d35.js +++ b/assets/js/922647ed.156ba5b9.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[1274],{9109:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>r,contentTitle:()=>c,default:()=>p,frontMatter:()=>a,metadata:()=>i,toc:()=>o});const i=JSON.parse('{"id":"getting-started/webpack-integration","title":"Webpack","description":"The Stylable Webpack integration provides development, build, and bundle capabilities.","source":"@site/docs/getting-started/webpack-integration.md","sourceDirName":"getting-started","slug":"/getting-started/webpack-integration","permalink":"/docs/getting-started/webpack-integration","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/getting-started/webpack-integration.md","tags":[],"version":"current","frontMatter":{"id":"webpack-integration","title":"Webpack"},"sidebar":"Discover","previous":{"title":"TypeScript","permalink":"/docs/getting-started/typescript-integration"}}');var s=t(4848),l=t(8453);const a={id:"webpack-integration",title:"Webpack"},c=void 0,r={},o=[{value:"Install",id:"install",level:2},{value:"Configuration",id:"configuration",level:2},{value:"With another CSS solution",id:"with-another-css-solution",level:3},{value:" stylable.config.js
",id:"stylableconfigjs",level:3}];function d(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",pre:"pre",strong:"strong",...(0,l.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.p,{children:"The Stylable Webpack integration provides development, build, and bundle capabilities."}),"\n",(0,s.jsx)(n.h2,{id:"install",children:"Install"}),"\n",(0,s.jsxs)(n.p,{children:["Install the ",(0,s.jsx)(n.strong,{children:"@stylable/webpack-plugin"})," as a dev dependency in your local project."]}),"\n",(0,s.jsx)(n.p,{children:"Using npm:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"npm install @stylable/webpack-plugin --save-dev\n"})}),"\n",(0,s.jsx)(n.p,{children:"Using Yarn:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"yarn add @stylable/webpack-plugin --dev\n"})}),"\n",(0,s.jsx)(n.h2,{id:"configuration",children:"Configuration"}),"\n",(0,s.jsxs)(n.p,{children:["In ",(0,s.jsx)(n.code,{children:"webpack.config"}),", add the ",(0,s.jsx)(n.code,{children:"StylableWebpackPlugin"})," to set up Stylable:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const { StylableWebpackPlugin } = require('@stylable/webpack-plugin');\n\n// webpack config\n{\n plugins: [new StylableWebpackPlugin()],\n}\n"})}),"\n",(0,s.jsxs)(n.p,{children:["For more information on configuring the ",(0,s.jsx)(n.code,{children:"@stylable/webpack-plugin"}),", see the ",(0,s.jsx)(n.a,{href:"https://github.com/wix/stylable/tree/master/packages/webpack-plugin",children:"readme file"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"with-another-css-solution",children:"With another CSS solution"}),"\n",(0,s.jsxs)(n.p,{children:["When coming into a project with an existing Webpack CSS integration, you will need to exclude ",(0,s.jsx)(n.code,{children:".st.css"})," files from any other integration."]}),"\n",(0,s.jsxs)(n.p,{children:["For example, to exclude Stylable from ",(0,s.jsx)(n.code,{children:"css-loader"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:"{11}",children:"const { StylableWebpackPlugin } = require('@stylable/webpack-plugin');\n\n{\n plugins: [\n new StylableWebpackPlugin()\n ],\n module: {\n rules: [\n {\n test: /\\.css$/i,\n exclude: /\\.st\\.css?/,\n use: [\"css-loader\"],\n },\n ],\n },\n}\n"})}),"\n",(0,s.jsx)(n.h3,{id:"stylableconfigjs",children:(0,s.jsx)(n.code,{children:"stylable.config.js"})}),"\n",(0,s.jsxs)(n.p,{children:["Adding the ",(0,s.jsx)(n.code,{children:"webpackPlugin"})," export field to the ",(0,s.jsx)(n.a,{href:"./stylable-config",children:(0,s.jsx)(n.code,{children:"stylable.config.js"})})," will set as the default configuration for any Stylable Webpack plugins in the project."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"module.exports.webpackPlugin = function (config) {\n return {\n ...config,\n optimize: {\n shortNamespaces: true,\n minify: true,\n },\n };\n};\n"})})]})}function p(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>c});var i=t(6540);const s={},l=i.createContext(s);function a(e){const n=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),i.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[1274],{6059:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>r,contentTitle:()=>c,default:()=>p,frontMatter:()=>a,metadata:()=>i,toc:()=>o});const i=JSON.parse('{"id":"getting-started/webpack-integration","title":"Webpack","description":"The Stylable Webpack integration provides development, build, and bundle capabilities.","source":"@site/docs/getting-started/webpack-integration.md","sourceDirName":"getting-started","slug":"/getting-started/webpack-integration","permalink":"/docs/getting-started/webpack-integration","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/getting-started/webpack-integration.md","tags":[],"version":"current","frontMatter":{"id":"webpack-integration","title":"Webpack"},"sidebar":"Discover","previous":{"title":"TypeScript","permalink":"/docs/getting-started/typescript-integration"}}');var s=t(4848),l=t(8453);const a={id:"webpack-integration",title:"Webpack"},c=void 0,r={},o=[{value:"Install",id:"install",level:2},{value:"Configuration",id:"configuration",level:2},{value:"With another CSS solution",id:"with-another-css-solution",level:3},{value:"stylable.config.js
",id:"stylableconfigjs",level:3}];function d(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",pre:"pre",strong:"strong",...(0,l.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.p,{children:"The Stylable Webpack integration provides development, build, and bundle capabilities."}),"\n",(0,s.jsx)(n.h2,{id:"install",children:"Install"}),"\n",(0,s.jsxs)(n.p,{children:["Install the ",(0,s.jsx)(n.strong,{children:"@stylable/webpack-plugin"})," as a dev dependency in your local project."]}),"\n",(0,s.jsx)(n.p,{children:"Using npm:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"npm install @stylable/webpack-plugin --save-dev\n"})}),"\n",(0,s.jsx)(n.p,{children:"Using Yarn:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"yarn add @stylable/webpack-plugin --dev\n"})}),"\n",(0,s.jsx)(n.h2,{id:"configuration",children:"Configuration"}),"\n",(0,s.jsxs)(n.p,{children:["In ",(0,s.jsx)(n.code,{children:"webpack.config"}),", add the ",(0,s.jsx)(n.code,{children:"StylableWebpackPlugin"})," to set up Stylable:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const { StylableWebpackPlugin } = require('@stylable/webpack-plugin');\n\n// webpack config\n{\n plugins: [new StylableWebpackPlugin()],\n}\n"})}),"\n",(0,s.jsxs)(n.p,{children:["For more information on configuring the ",(0,s.jsx)(n.code,{children:"@stylable/webpack-plugin"}),", see the ",(0,s.jsx)(n.a,{href:"https://github.com/wix/stylable/tree/master/packages/webpack-plugin",children:"readme file"}),"."]}),"\n",(0,s.jsx)(n.h3,{id:"with-another-css-solution",children:"With another CSS solution"}),"\n",(0,s.jsxs)(n.p,{children:["When coming into a project with an existing Webpack CSS integration, you will need to exclude ",(0,s.jsx)(n.code,{children:".st.css"})," files from any other integration."]}),"\n",(0,s.jsxs)(n.p,{children:["For example, to exclude Stylable from ",(0,s.jsx)(n.code,{children:"css-loader"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:"{11}",children:"const { StylableWebpackPlugin } = require('@stylable/webpack-plugin');\n\n{\n plugins: [\n new StylableWebpackPlugin()\n ],\n module: {\n rules: [\n {\n test: /\\.css$/i,\n exclude: /\\.st\\.css?/,\n use: [\"css-loader\"],\n },\n ],\n },\n}\n"})}),"\n",(0,s.jsx)(n.h3,{id:"stylableconfigjs",children:(0,s.jsx)(n.code,{children:"stylable.config.js"})}),"\n",(0,s.jsxs)(n.p,{children:["Adding the ",(0,s.jsx)(n.code,{children:"webpackPlugin"})," export field to the ",(0,s.jsx)(n.a,{href:"./stylable-config",children:(0,s.jsx)(n.code,{children:"stylable.config.js"})})," will set as the default configuration for any Stylable Webpack plugins in the project."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"module.exports.webpackPlugin = function (config) {\n return {\n ...config,\n optimize: {\n shortNamespaces: true,\n minify: true,\n },\n };\n};\n"})})]})}function p(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>c});var i=t(6540);const s={},l=i.createContext(s);function a(e){const n=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),i.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/945a8992.9bfc53d1.js b/assets/js/945a8992.07b1c858.js similarity index 99% rename from assets/js/945a8992.9bfc53d1.js rename to assets/js/945a8992.07b1c858.js index 4b8506e6..63caabc5 100644 --- a/assets/js/945a8992.9bfc53d1.js +++ b/assets/js/945a8992.07b1c858.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[9729],{8080:(e,a,n)=>{n.r(a),n.d(a,{assets:()=>o,contentTitle:()=>i,default:()=>u,frontMatter:()=>l,metadata:()=>s,toc:()=>c});const s=JSON.parse('{"id":"references/st-variables","title":"Variables","description":"Stylable variables provide a way to define common values to be used across the stylesheet and exposed for sharing and theming.","source":"@site/docs/references/variables.md","sourceDirName":"references","slug":"/references/st-variables","permalink":"/docs/references/st-variables","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/variables.md","tags":[],"version":"current","frontMatter":{"id":"st-variables","title":"Variables"},"sidebar":"Specification Reference","previous":{"title":"Mixins","permalink":"/docs/references/mixins"},"next":{"title":"Runtime","permalink":"/docs/references/runtime"}}');var r=n(4848),t=n(8453);const l={id:"st-variables",title:"Variables"},i=void 0,o={},c=[{value:"Syntax",id:"syntax",level:2},{value:"Define",id:"define",level:3},{value:"Evaluate",id:"evaluate",level:3},{value:"Compose",id:"compose",level:3},{value:"Array",id:"array",level:3},{value:"Map",id:"map",level:3},{value:"Import and Export",id:"import-and-export",level:2},{value:"Runtime",id:"runtime",level:2},{value:"Custom variable",id:"custom-variable",level:2}];function d(e){const a={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",p:"p",pre:"pre",strong:"strong",...(0,t.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.p,{children:"Stylable variables provide a way to define common values to be used across the stylesheet and exposed for sharing and theming.\nThese variables are used only during build-time and have no runtime impact."}),"\n",(0,r.jsxs)(a.p,{children:["If you wish to use native dynamic variables, that can change value during runtime, see ",(0,r.jsx)(a.a,{href:"/docs/references/css-vars",children:"css custom properties"})," for further details."]}),"\n",(0,r.jsx)(a.h2,{id:"syntax",children:"Syntax"}),"\n",(0,r.jsxs)(a.p,{children:["Use the ",(0,r.jsx)(a.code,{children:":vars"})," top level rule to define build variables."]}),"\n",(0,r.jsx)(a.h3,{id:"define",children:"Define"}),"\n",(0,r.jsxs)(a.p,{children:["To define a variable, add a variable declaration within a ",(0,r.jsx)(a.code,{children:":vars"})," ruleset."]}),"\n",(0,r.jsx)(a.pre,{children:(0,r.jsx)(a.code,{className:"language-css",children:":vars {\n /* define x with value green */\n x: green;\n\n /* define y with value blue */\n y: blue;\n}\n"})}),"\n",(0,r.jsx)(a.h3,{id:"evaluate",children:"Evaluate"}),"\n",(0,r.jsxs)(a.p,{children:["To get a variable value, use the ",(0,r.jsx)(a.code,{children:"value()"})," function with the variable name as the first argument."]}),"\n",(0,r.jsx)(a.pre,{children:(0,r.jsx)(a.code,{className:"language-css",children:".a {\n /* evaluate in declaration value */\n color: value(x);\n\n /* compose in declaration value */\n background: url(a.jpg) no-repeat, url(b.jpg) repeat-x value(x);\n}\n\n/* set media params from a variable */\n@media value(y) {}\n"})}),"\n",(0,r.jsx)(a.h3,{id:"compose",children:"Compose"}),"\n",(0,r.jsx)(a.p,{children:"Variables can be composed into a declaration value."}),"\n",(0,r.jsx)(a.pre,{children:(0,r.jsx)(a.code,{className:"language-css",children:":vars {\n x: green;\n\n /* define y with the value green from x */\n y: value(x);\n\n /* define z with composed x value */\n z: red, value(x), blue;\n}\n"})}),"\n",(0,r.jsx)(a.h3,{id:"array",children:"Array"}),"\n",(0,r.jsxs)(a.p,{children:["Use ",(0,r.jsx)(a.code,{children:"st-array"})," to define a variable that holds a list of comma separated values that can be accessed by a zero-based index as the second argument to the ",(0,r.jsx)(a.code,{children:"value()"})," function."]}),"\n",(0,r.jsx)(a.pre,{children:(0,r.jsx)(a.code,{className:"language-css",children:":vars {\n /* comma separated list */\n colors: st-array(red, green, blue);\n}\n\n.a {\n /* access 2nd cell value */\n color: value(colors, 1); /* green */\n}\n"})}),"\n",(0,r.jsx)(a.h3,{id:"map",children:"Map"}),"\n",(0,r.jsxs)(a.p,{children:["Use ",(0,r.jsx)(a.code,{children:"st-map"})," to define a variable that holds key/value pairs with a space as a delimiter between them, and a comma separating each pair."]}),"\n",(0,r.jsxs)(a.p,{children:["These values can then be accessed by providing the key as the second argument to the ",(0,r.jsx)(a.code,{children:"value()"})," function."]}),"\n",(0,r.jsx)(a.pre,{children:(0,r.jsx)(a.code,{className:"language-css",children:":vars {\n /* comma separated key/value pairs */\n colors: st-map(\n bg black, \n text gold,\n );\n}\n\n.a {\n /* access 'text' key value */\n color: value(colors, text); /* gold */\n}\n"})}),"\n",(0,r.jsx)(a.h2,{id:"import-and-export",children:"Import and Export"}),"\n",(0,r.jsxs)(a.p,{children:["An exported build variable can be imported into another stylesheet with the ",(0,r.jsx)(a.a,{href:"./imports",children:"@st-import"})," at-rule."]}),"\n",(0,r.jsx)(a.pre,{children:(0,r.jsx)(a.code,{className:"language-css",metastring:'title="example2.st.css"',children:'@st-import [color1] from "./common.st.css";\n\n.a {\n /* compose color1 to border value*/\n border: 10px solid value(color1);\n}\n'})}),"\n",(0,r.jsx)(a.h2,{id:"runtime",children:"Runtime"}),"\n",(0,r.jsxs)(a.p,{children:["A build variable value can be accessed using the ",(0,r.jsx)(a.code,{children:"stVars"})," mapping on the Stylable stylesheet runtime."]}),"\n",(0,r.jsx)(a.pre,{children:(0,r.jsx)(a.code,{className:"language-jsx",children:"import { stVars } from './common.st.css';\n\n// map from local name to value\nstVars.color1; // \"green\"\nstVars['dashed-name']; // \"blue\"\n"})}),"\n",(0,r.jsx)(a.admonition,{title:"local export only",type:"important",children:(0,r.jsxs)(a.p,{children:["Only build variables that are defined by the stylesheet are exported to Javascript - ",(0,r.jsx)(a.strong,{children:"imported ones are not!"})]})}),"\n",(0,r.jsx)(a.h2,{id:"custom-variable",children:"Custom variable"}),"\n",(0,r.jsx)(a.admonition,{title:"experimental",type:"danger",children:(0,r.jsx)(a.p,{children:"This API is not stable"})}),"\n",(0,r.jsxs)(a.p,{children:["Composed data structures like ",(0,r.jsx)(a.code,{children:"st-array"})," and ",(0,r.jsx)(a.code,{children:"st-map"})," can be defined from Javascript. Take a look at ",(0,r.jsx)(a.code,{children:"stBorder"})," from the ",(0,r.jsx)(a.a,{href:"https://github.com/wix/stylable/tree/master/packages/custom-value",children:"@stylable/custom-value"})," to see how it works."]}),"\n",(0,r.jsx)(a.pre,{children:(0,r.jsx)(a.code,{className:"language-css",metastring:'title="stBorder usage example"',children:'@st-import [stBorder] from "@stylable/custom-value";\n\n:vars {\n /* order of arguments: size style color */\n myborder: stBorder(1px, solid, green);\n}\n\n.root {\n border: value(myBorder); /* 1px solid green */\n background-color: value(myBorder, color); /* green */\n}\n'})})]})}function u(e={}){const{wrapper:a}={...(0,t.R)(),...e.components};return a?(0,r.jsx)(a,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},8453:(e,a,n)=>{n.d(a,{R:()=>l,x:()=>i});var s=n(6540);const r={},t=s.createContext(r);function l(e){const a=s.useContext(t);return s.useMemo((function(){return"function"==typeof e?e(a):{...a,...e}}),[a,e])}function i(e){let a;return a=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:l(e.components),s.createElement(t.Provider,{value:a},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[9729],{3735:(e,a,n)=>{n.r(a),n.d(a,{assets:()=>o,contentTitle:()=>i,default:()=>u,frontMatter:()=>l,metadata:()=>s,toc:()=>c});const s=JSON.parse('{"id":"references/st-variables","title":"Variables","description":"Stylable variables provide a way to define common values to be used across the stylesheet and exposed for sharing and theming.","source":"@site/docs/references/variables.md","sourceDirName":"references","slug":"/references/st-variables","permalink":"/docs/references/st-variables","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/variables.md","tags":[],"version":"current","frontMatter":{"id":"st-variables","title":"Variables"},"sidebar":"Specification Reference","previous":{"title":"Mixins","permalink":"/docs/references/mixins"},"next":{"title":"Runtime","permalink":"/docs/references/runtime"}}');var r=n(4848),t=n(8453);const l={id:"st-variables",title:"Variables"},i=void 0,o={},c=[{value:"Syntax",id:"syntax",level:2},{value:"Define",id:"define",level:3},{value:"Evaluate",id:"evaluate",level:3},{value:"Compose",id:"compose",level:3},{value:"Array",id:"array",level:3},{value:"Map",id:"map",level:3},{value:"Import and Export",id:"import-and-export",level:2},{value:"Runtime",id:"runtime",level:2},{value:"Custom variable",id:"custom-variable",level:2}];function d(e){const a={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",p:"p",pre:"pre",strong:"strong",...(0,t.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.p,{children:"Stylable variables provide a way to define common values to be used across the stylesheet and exposed for sharing and theming.\nThese variables are used only during build-time and have no runtime impact."}),"\n",(0,r.jsxs)(a.p,{children:["If you wish to use native dynamic variables, that can change value during runtime, see ",(0,r.jsx)(a.a,{href:"/docs/references/css-vars",children:"css custom properties"})," for further details."]}),"\n",(0,r.jsx)(a.h2,{id:"syntax",children:"Syntax"}),"\n",(0,r.jsxs)(a.p,{children:["Use the ",(0,r.jsx)(a.code,{children:":vars"})," top level rule to define build variables."]}),"\n",(0,r.jsx)(a.h3,{id:"define",children:"Define"}),"\n",(0,r.jsxs)(a.p,{children:["To define a variable, add a variable declaration within a ",(0,r.jsx)(a.code,{children:":vars"})," ruleset."]}),"\n",(0,r.jsx)(a.pre,{children:(0,r.jsx)(a.code,{className:"language-css",children:":vars {\n /* define x with value green */\n x: green;\n\n /* define y with value blue */\n y: blue;\n}\n"})}),"\n",(0,r.jsx)(a.h3,{id:"evaluate",children:"Evaluate"}),"\n",(0,r.jsxs)(a.p,{children:["To get a variable value, use the ",(0,r.jsx)(a.code,{children:"value()"})," function with the variable name as the first argument."]}),"\n",(0,r.jsx)(a.pre,{children:(0,r.jsx)(a.code,{className:"language-css",children:".a {\n /* evaluate in declaration value */\n color: value(x);\n\n /* compose in declaration value */\n background: url(a.jpg) no-repeat, url(b.jpg) repeat-x value(x);\n}\n\n/* set media params from a variable */\n@media value(y) {}\n"})}),"\n",(0,r.jsx)(a.h3,{id:"compose",children:"Compose"}),"\n",(0,r.jsx)(a.p,{children:"Variables can be composed into a declaration value."}),"\n",(0,r.jsx)(a.pre,{children:(0,r.jsx)(a.code,{className:"language-css",children:":vars {\n x: green;\n\n /* define y with the value green from x */\n y: value(x);\n\n /* define z with composed x value */\n z: red, value(x), blue;\n}\n"})}),"\n",(0,r.jsx)(a.h3,{id:"array",children:"Array"}),"\n",(0,r.jsxs)(a.p,{children:["Use ",(0,r.jsx)(a.code,{children:"st-array"})," to define a variable that holds a list of comma separated values that can be accessed by a zero-based index as the second argument to the ",(0,r.jsx)(a.code,{children:"value()"})," function."]}),"\n",(0,r.jsx)(a.pre,{children:(0,r.jsx)(a.code,{className:"language-css",children:":vars {\n /* comma separated list */\n colors: st-array(red, green, blue);\n}\n\n.a {\n /* access 2nd cell value */\n color: value(colors, 1); /* green */\n}\n"})}),"\n",(0,r.jsx)(a.h3,{id:"map",children:"Map"}),"\n",(0,r.jsxs)(a.p,{children:["Use ",(0,r.jsx)(a.code,{children:"st-map"})," to define a variable that holds key/value pairs with a space as a delimiter between them, and a comma separating each pair."]}),"\n",(0,r.jsxs)(a.p,{children:["These values can then be accessed by providing the key as the second argument to the ",(0,r.jsx)(a.code,{children:"value()"})," function."]}),"\n",(0,r.jsx)(a.pre,{children:(0,r.jsx)(a.code,{className:"language-css",children:":vars {\n /* comma separated key/value pairs */\n colors: st-map(\n bg black, \n text gold,\n );\n}\n\n.a {\n /* access 'text' key value */\n color: value(colors, text); /* gold */\n}\n"})}),"\n",(0,r.jsx)(a.h2,{id:"import-and-export",children:"Import and Export"}),"\n",(0,r.jsxs)(a.p,{children:["An exported build variable can be imported into another stylesheet with the ",(0,r.jsx)(a.a,{href:"./imports",children:"@st-import"})," at-rule."]}),"\n",(0,r.jsx)(a.pre,{children:(0,r.jsx)(a.code,{className:"language-css",metastring:'title="example2.st.css"',children:'@st-import [color1] from "./common.st.css";\n\n.a {\n /* compose color1 to border value*/\n border: 10px solid value(color1);\n}\n'})}),"\n",(0,r.jsx)(a.h2,{id:"runtime",children:"Runtime"}),"\n",(0,r.jsxs)(a.p,{children:["A build variable value can be accessed using the ",(0,r.jsx)(a.code,{children:"stVars"})," mapping on the Stylable stylesheet runtime."]}),"\n",(0,r.jsx)(a.pre,{children:(0,r.jsx)(a.code,{className:"language-jsx",children:"import { stVars } from './common.st.css';\n\n// map from local name to value\nstVars.color1; // \"green\"\nstVars['dashed-name']; // \"blue\"\n"})}),"\n",(0,r.jsx)(a.admonition,{title:"local export only",type:"important",children:(0,r.jsxs)(a.p,{children:["Only build variables that are defined by the stylesheet are exported to Javascript - ",(0,r.jsx)(a.strong,{children:"imported ones are not!"})]})}),"\n",(0,r.jsx)(a.h2,{id:"custom-variable",children:"Custom variable"}),"\n",(0,r.jsx)(a.admonition,{title:"experimental",type:"danger",children:(0,r.jsx)(a.p,{children:"This API is not stable"})}),"\n",(0,r.jsxs)(a.p,{children:["Composed data structures like ",(0,r.jsx)(a.code,{children:"st-array"})," and ",(0,r.jsx)(a.code,{children:"st-map"})," can be defined from Javascript. Take a look at ",(0,r.jsx)(a.code,{children:"stBorder"})," from the ",(0,r.jsx)(a.a,{href:"https://github.com/wix/stylable/tree/master/packages/custom-value",children:"@stylable/custom-value"})," to see how it works."]}),"\n",(0,r.jsx)(a.pre,{children:(0,r.jsx)(a.code,{className:"language-css",metastring:'title="stBorder usage example"',children:'@st-import [stBorder] from "@stylable/custom-value";\n\n:vars {\n /* order of arguments: size style color */\n myborder: stBorder(1px, solid, green);\n}\n\n.root {\n border: value(myBorder); /* 1px solid green */\n background-color: value(myBorder, color); /* green */\n}\n'})})]})}function u(e={}){const{wrapper:a}={...(0,t.R)(),...e.components};return a?(0,r.jsx)(a,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},8453:(e,a,n)=>{n.d(a,{R:()=>l,x:()=>i});var s=n(6540);const r={},t=s.createContext(r);function l(e){const a=s.useContext(t);return s.useMemo((function(){return"function"==typeof e?e(a):{...a,...e}}),[a,e])}function i(e){let a;return a=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:l(e.components),s.createElement(t.Provider,{value:a},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/9e4087bc.5f0ca831.js b/assets/js/9e4087bc.488edf24.js similarity index 87% rename from assets/js/9e4087bc.5f0ca831.js rename to assets/js/9e4087bc.488edf24.js index 27880e76..bb692488 100644 --- a/assets/js/9e4087bc.5f0ca831.js +++ b/assets/js/9e4087bc.488edf24.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[2711],{5496:(e,t,r)=>{r.r(t),r.d(t,{default:()=>m});r(6540);var a=r(4783),n=r(3230),s=r(6644),i=r(9191),c=r(7635),l=r(5225),o=r(4848);function d(e){let{year:t,posts:r}=e;const n=(0,i.i)({day:"numeric",month:"long",timeZone:"UTC"});return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(l.A,{as:"h3",id:t,children:t}),(0,o.jsx)("ul",{children:r.map((e=>{return(0,o.jsx)("li",{children:(0,o.jsxs)(a.A,{to:e.metadata.permalink,children:[(t=e.metadata.date,n.format(new Date(t)))," - ",e.metadata.title]})},e.metadata.date);var t}))})]})}function h(e){let{years:t}=e;return(0,o.jsx)("section",{className:"margin-vert--lg",children:(0,o.jsx)("div",{className:"container",children:(0,o.jsx)("div",{className:"row",children:t.map(((e,t)=>(0,o.jsx)("div",{className:"col col--4 margin-vert--lg",children:(0,o.jsx)(d,{...e})},t)))})})})}function m(e){let{archive:t}=e;const r=(0,n.T)({id:"theme.blog.archive.title",message:"Archive",description:"The page & hero title of the blog archive page"}),a=(0,n.T)({id:"theme.blog.archive.description",message:"Archive",description:"The page & hero description of the blog archive page"}),i=function(e){const t=e.reduce(((e,t)=>{const r=t.metadata.date.split("-")[0],a=e.get(r)??[];return e.set(r,[t,...a])}),new Map);return Array.from(t,(e=>{let[t,r]=e;return{year:t,posts:r}}))}(t.blogPosts);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(s.be,{title:r,description:a}),(0,o.jsxs)(c.A,{children:[(0,o.jsx)("header",{className:"hero hero--primary",children:(0,o.jsxs)("div",{className:"container",children:[(0,o.jsx)(l.A,{as:"h1",className:"hero__title",children:r}),(0,o.jsx)("p",{className:"hero__subtitle",children:a})]})}),(0,o.jsx)("main",{children:i.length>0&&(0,o.jsx)(h,{years:i})})]})]})}},9191:(e,t,r)=>{r.d(t,{i:()=>n});var a=r(7639);function n(e){void 0===e&&(e={});const{i18n:{currentLocale:t}}=(0,a.A)(),r=function(){const{i18n:{currentLocale:e,localeConfigs:t}}=(0,a.A)();return t[e].calendar}();return new Intl.DateTimeFormat(t,{calendar:r,...e})}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[2711],{9331:(e,t,r)=>{r.r(t),r.d(t,{default:()=>m});r(6540);var a=r(8774),n=r(1312),s=r(1213),i=r(6266),c=r(7823),l=r(1107),o=r(4848);function d(e){let{year:t,posts:r}=e;const n=(0,i.i)({day:"numeric",month:"long",timeZone:"UTC"});return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(l.A,{as:"h3",id:t,children:t}),(0,o.jsx)("ul",{children:r.map((e=>{return(0,o.jsx)("li",{children:(0,o.jsxs)(a.A,{to:e.metadata.permalink,children:[(t=e.metadata.date,n.format(new Date(t)))," - ",e.metadata.title]})},e.metadata.date);var t}))})]})}function h(e){let{years:t}=e;return(0,o.jsx)("section",{className:"margin-vert--lg",children:(0,o.jsx)("div",{className:"container",children:(0,o.jsx)("div",{className:"row",children:t.map(((e,t)=>(0,o.jsx)("div",{className:"col col--4 margin-vert--lg",children:(0,o.jsx)(d,{...e})},t)))})})})}function m(e){let{archive:t}=e;const r=(0,n.T)({id:"theme.blog.archive.title",message:"Archive",description:"The page & hero title of the blog archive page"}),a=(0,n.T)({id:"theme.blog.archive.description",message:"Archive",description:"The page & hero description of the blog archive page"}),i=function(e){const t=e.reduce(((e,t)=>{const r=t.metadata.date.split("-")[0],a=e.get(r)??[];return e.set(r,[t,...a])}),new Map);return Array.from(t,(e=>{let[t,r]=e;return{year:t,posts:r}}))}(t.blogPosts);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(s.be,{title:r,description:a}),(0,o.jsxs)(c.A,{children:[(0,o.jsx)("header",{className:"hero hero--primary",children:(0,o.jsxs)("div",{className:"container",children:[(0,o.jsx)(l.A,{as:"h1",className:"hero__title",children:r}),(0,o.jsx)("p",{className:"hero__subtitle",children:a})]})}),(0,o.jsx)("main",{children:i.length>0&&(0,o.jsx)(h,{years:i})})]})]})}},6266:(e,t,r)=>{r.d(t,{i:()=>n});var a=r(4586);function n(e){void 0===e&&(e={});const{i18n:{currentLocale:t}}=(0,a.A)(),r=function(){const{i18n:{currentLocale:e,localeConfigs:t}}=(0,a.A)();return t[e].calendar}();return new Intl.DateTimeFormat(t,{calendar:r,...e})}}}]); \ No newline at end of file diff --git a/assets/js/a2b316bf.170c1449.js b/assets/js/a2b316bf.7180e85f.js similarity index 98% rename from assets/js/a2b316bf.170c1449.js rename to assets/js/a2b316bf.7180e85f.js index f165d383..5a0cdaa8 100644 --- a/assets/js/a2b316bf.170c1449.js +++ b/assets/js/a2b316bf.7180e85f.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[150],{8218:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>r,contentTitle:()=>l,default:()=>h,frontMatter:()=>i,metadata:()=>t,toc:()=>c});const t=JSON.parse('{"id":"guides/handbook/class","title":"Classes","description":"Classes are the most basic building block of stylable, used to mark elements on the DOM, so those could in turn be targeted and styled via our CSS.","source":"@site/docs/guides/handbook/class.mdx","sourceDirName":"guides/handbook","slug":"/guides/handbook/class","permalink":"/docs/guides/handbook/class","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/guides/handbook/class.mdx","tags":[],"version":"current","frontMatter":{"id":"class","title":"Classes"},"sidebar":"Guides","previous":{"title":"Introduction","permalink":"/docs/guides/handbook/intro"},"next":{"title":"Namespacing","permalink":"/docs/guides/handbook/namespacing"}}');var a=n(4848),o=n(8453);const i={id:"class",title:"Classes"},l=void 0,r={},c=[{value:"CSS classes",id:"css-classes",level:2},{value:"Resolve global conflicts",id:"resolve-global-conflicts",level:2},{value:"Runtime mapping",id:"runtime-mapping",level:2},{value:"Naming tip",id:"naming-tip",level:2}];function d(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.p,{children:"Classes are the most basic building block of stylable, used to mark elements on the DOM, so those could in turn be targeted and styled via our CSS."}),"\n",(0,a.jsx)(s.h2,{id:"css-classes",children:"CSS classes"}),"\n",(0,a.jsxs)(s.p,{children:["A CSS class starts with a ",(0,a.jsx)(s.code,{children:"."})," (period) following a CSS identifier. Read more about ",(0,a.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/Class_selectors",children:"CSS classes"})," in the MDN documentation."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="game.st.css"',children:".player {\n background: green;\n}\n"})}),"\n",(0,a.jsxs)(s.p,{children:["Here we create a ",(0,a.jsx)(s.code,{children:"game.st.css"})," stylesheet and define a class named ",(0,a.jsx)(s.code,{children:"player"})," that will color the background of the element it targets with the color ",(0,a.jsx)(s.code,{children:"green"}),"."]}),"\n",(0,a.jsx)(s.h2,{id:"resolve-global-conflicts",children:"Resolve global conflicts"}),"\n",(0,a.jsxs)(s.p,{children:["All CSS loaded to the browser for a given page is global, and so other stylesheets can create their own ",(0,a.jsx)(s.code,{children:"player"}),", and conflict with our definition"]}),"\n",(0,a.jsxs)(s.p,{children:["To resolve this, we can use a ",(0,a.jsx)(s.a,{href:"http://getbem.com/introduction/",children:"BEM methodology"})," to namespace our ",(0,a.jsx)(s.code,{children:"player"})," class with a unique prefix."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="game.st.css"',children:".game__player {\n background: green;\n}\n"})}),"\n",(0,a.jsx)(s.p,{children:"This conventions-based solution works, but is difficult to scale, requires communication and agreement, demands manual upkeep, and makes our code more verbose than it needs to be."}),"\n",(0,a.jsxs)(s.p,{children:["Stylable automates the namespacing process, using a similar convention to BEM for CSS classes and other symbols (more on that in the ",(0,a.jsx)(s.a,{href:"/docs/guides/handbook/namespacing",children:"Namespacing chapter"}),")."]}),"\n",(0,a.jsx)(s.h2,{id:"runtime-mapping",children:"Runtime mapping"}),"\n",(0,a.jsx)(s.p,{children:"By turning the namespacing process to an automatic one, we find ourselves needing to map the runtime classes on the DOM to the original classes we defined in our stylesheet."}),"\n",(0,a.jsxs)(s.p,{children:["To access this class name mappings, we will import the stylesheet to our JavaScript, and utilize the ",(0,a.jsx)(s.code,{children:"classes"})," object to get our desired global name."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-jsx",metastring:'title="game.jsx"',children:"import { classes } from './game.st.css';\n\nconsole.log(classes.player); // \"game__player\"\n\n;\n"})}),"\n",(0,a.jsx)(s.admonition,{title:"Prerequisite",type:"info",children:(0,a.jsx)(s.p,{children:"The example above assumes that Stylable was run as part of a build process, using one of our integrations or hooks to generate the runtime JavaScript module with the required mappings and utility functions."})}),"\n",(0,a.jsx)(s.h2,{id:"naming-tip",children:"Naming tip"}),"\n",(0,a.jsxs)(s.p,{children:["Due to the fact that these class symbols are generated from the stylesheet, but are also consumed in JavaScript, we recommend using camelCase for class names to avoid cases that require ",(0,a.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors",children:"property accessors"}),"."]}),"\n","\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-js",children:'import { classes } from "./dialog.st.css";\n\nclasses.okButton; // recommended\nclasses["ok-button"]; // not recommended\n'})}),"\n","\n",(0,a.jsx)(s.p,{children:"We would further recommend to avoid using special characters that are not valid JavaScript identifiers."})]})}function h(e={}){const{wrapper:s}={...(0,o.R)(),...e.components};return s?(0,a.jsx)(s,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},8453:(e,s,n)=>{n.d(s,{R:()=>i,x:()=>l});var t=n(6540);const a={},o=t.createContext(a);function i(e){const s=t.useContext(o);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function l(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:i(e.components),t.createElement(o.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[150],{7518:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>r,contentTitle:()=>l,default:()=>h,frontMatter:()=>i,metadata:()=>t,toc:()=>c});const t=JSON.parse('{"id":"guides/handbook/class","title":"Classes","description":"Classes are the most basic building block of stylable, used to mark elements on the DOM, so those could in turn be targeted and styled via our CSS.","source":"@site/docs/guides/handbook/class.mdx","sourceDirName":"guides/handbook","slug":"/guides/handbook/class","permalink":"/docs/guides/handbook/class","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/guides/handbook/class.mdx","tags":[],"version":"current","frontMatter":{"id":"class","title":"Classes"},"sidebar":"Guides","previous":{"title":"Introduction","permalink":"/docs/guides/handbook/intro"},"next":{"title":"Namespacing","permalink":"/docs/guides/handbook/namespacing"}}');var a=n(4848),o=n(8453);const i={id:"class",title:"Classes"},l=void 0,r={},c=[{value:"CSS classes",id:"css-classes",level:2},{value:"Resolve global conflicts",id:"resolve-global-conflicts",level:2},{value:"Runtime mapping",id:"runtime-mapping",level:2},{value:"Naming tip",id:"naming-tip",level:2}];function d(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.p,{children:"Classes are the most basic building block of stylable, used to mark elements on the DOM, so those could in turn be targeted and styled via our CSS."}),"\n",(0,a.jsx)(s.h2,{id:"css-classes",children:"CSS classes"}),"\n",(0,a.jsxs)(s.p,{children:["A CSS class starts with a ",(0,a.jsx)(s.code,{children:"."})," (period) following a CSS identifier. Read more about ",(0,a.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/Class_selectors",children:"CSS classes"})," in the MDN documentation."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="game.st.css"',children:".player {\n background: green;\n}\n"})}),"\n",(0,a.jsxs)(s.p,{children:["Here we create a ",(0,a.jsx)(s.code,{children:"game.st.css"})," stylesheet and define a class named ",(0,a.jsx)(s.code,{children:"player"})," that will color the background of the element it targets with the color ",(0,a.jsx)(s.code,{children:"green"}),"."]}),"\n",(0,a.jsx)(s.h2,{id:"resolve-global-conflicts",children:"Resolve global conflicts"}),"\n",(0,a.jsxs)(s.p,{children:["All CSS loaded to the browser for a given page is global, and so other stylesheets can create their own ",(0,a.jsx)(s.code,{children:"player"}),", and conflict with our definition"]}),"\n",(0,a.jsxs)(s.p,{children:["To resolve this, we can use a ",(0,a.jsx)(s.a,{href:"http://getbem.com/introduction/",children:"BEM methodology"})," to namespace our ",(0,a.jsx)(s.code,{children:"player"})," class with a unique prefix."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="game.st.css"',children:".game__player {\n background: green;\n}\n"})}),"\n",(0,a.jsx)(s.p,{children:"This conventions-based solution works, but is difficult to scale, requires communication and agreement, demands manual upkeep, and makes our code more verbose than it needs to be."}),"\n",(0,a.jsxs)(s.p,{children:["Stylable automates the namespacing process, using a similar convention to BEM for CSS classes and other symbols (more on that in the ",(0,a.jsx)(s.a,{href:"/docs/guides/handbook/namespacing",children:"Namespacing chapter"}),")."]}),"\n",(0,a.jsx)(s.h2,{id:"runtime-mapping",children:"Runtime mapping"}),"\n",(0,a.jsx)(s.p,{children:"By turning the namespacing process to an automatic one, we find ourselves needing to map the runtime classes on the DOM to the original classes we defined in our stylesheet."}),"\n",(0,a.jsxs)(s.p,{children:["To access this class name mappings, we will import the stylesheet to our JavaScript, and utilize the ",(0,a.jsx)(s.code,{children:"classes"})," object to get our desired global name."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-jsx",metastring:'title="game.jsx"',children:"import { classes } from './game.st.css';\n\nconsole.log(classes.player); // \"game__player\"\n\n;\n"})}),"\n",(0,a.jsx)(s.admonition,{title:"Prerequisite",type:"info",children:(0,a.jsx)(s.p,{children:"The example above assumes that Stylable was run as part of a build process, using one of our integrations or hooks to generate the runtime JavaScript module with the required mappings and utility functions."})}),"\n",(0,a.jsx)(s.h2,{id:"naming-tip",children:"Naming tip"}),"\n",(0,a.jsxs)(s.p,{children:["Due to the fact that these class symbols are generated from the stylesheet, but are also consumed in JavaScript, we recommend using camelCase for class names to avoid cases that require ",(0,a.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors",children:"property accessors"}),"."]}),"\n","\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-js",children:'import { classes } from "./dialog.st.css";\n\nclasses.okButton; // recommended\nclasses["ok-button"]; // not recommended\n'})}),"\n","\n",(0,a.jsx)(s.p,{children:"We would further recommend to avoid using special characters that are not valid JavaScript identifiers."})]})}function h(e={}){const{wrapper:s}={...(0,o.R)(),...e.components};return s?(0,a.jsx)(s,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},8453:(e,s,n)=>{n.d(s,{R:()=>i,x:()=>l});var t=n(6540);const a={},o=t.createContext(a);function i(e){const s=t.useContext(o);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function l(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:i(e.components),t.createElement(o.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/a2cbecc3.6e24772c.js b/assets/js/a2cbecc3.6e24772c.js new file mode 100644 index 00000000..9ac10af6 --- /dev/null +++ b/assets/js/a2cbecc3.6e24772c.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[5299],{665:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>a,default:()=>p,frontMatter:()=>s,metadata:()=>i,toc:()=>d});const i=JSON.parse('{"id":"getting-started/manual-integration","title":"Manual Integration","description":"When integrating Stylable into a project, there are key differences to consider whether the project is an application or a component library.","source":"@site/docs/getting-started/manual-integration.mdx","sourceDirName":"getting-started","slug":"/getting-started/manual-integration","permalink":"/docs/getting-started/manual-integration","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/getting-started/manual-integration.mdx","tags":[],"version":"current","frontMatter":{"id":"manual-integration","title":"Manual Integration"},"sidebar":"Discover","previous":{"title":"Boilerplate","permalink":"/docs/getting-started/boilerplate"},"next":{"title":"stylable.config.js","permalink":"/docs/getting-started/stylable-config"}}');var r=n(4848),o=n(8453);const s={id:"manual-integration",title:"Manual Integration"},a=void 0,l={},d=[{value:"TypeScript development",id:"typescript-development",level:2},{value:"Application",id:"application",level:2},{value:"Bundler",id:"bundler",level:3},{value:"Server-side rendering (SSR)",id:"server-side-rendering-ssr",level:3},{value:"Component library",id:"component-library",level:2},{value:"Additional tooling support",id:"additional-tooling-support",level:2},{value:"Integrated and ready to learn?",id:"integrated-and-ready-to-learn",level:2}];function c(e){const t={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",strong:"strong",ul:"ul",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.p,{children:["When integrating ",(0,r.jsx)(t.strong,{children:"Stylable"})," into a project, there are key differences to consider whether the project is an ",(0,r.jsx)(t.em,{children:"application"})," or a ",(0,r.jsx)(t.em,{children:"component library"}),"."]}),"\n",(0,r.jsx)(t.p,{children:"An application is a project that is deployed to production for end-users to access. While a component library is a project that is published to a package manager for other developers to consume in their projects."}),"\n",(0,r.jsx)(t.p,{children:"This difference mostly manifests in how these projects are built. For example, an application might build a final bundle for deployment, while a component library would build standalone modules to be consumed in various ways."}),"\n",(0,r.jsx)(t.h2,{id:"typescript-development",children:"TypeScript development"}),"\n",(0,r.jsxs)(t.p,{children:["For any project using TypeScript (applications or component libraries), it is strongly recommended to configure the project integrations to ",(0,r.jsxs)(t.a,{href:"/docs/getting-started/typescript-integration#generating-types-per-stylesheet",children:["generate ",(0,r.jsx)(t.code,{children:".d.ts"})," definitions"]})," for all ",(0,r.jsx)(t.strong,{children:"Stylable"})," stylesheets. This will provide contextual completions and type-checking for imported stylesheets during development."]}),"\n",(0,r.jsx)(t.h2,{id:"application",children:"Application"}),"\n",(0,r.jsx)(t.h3,{id:"bundler",children:"Bundler"}),"\n",(0,r.jsxs)(t.p,{children:["Stylable officially supports two different bundlers, ",(0,r.jsx)(t.a,{href:"/docs/getting-started/webpack-integration",children:"webpack"})," and ",(0,r.jsx)(t.a,{href:"/docs/getting-started/rollup-integration",children:"Rollup"}),". These bundlers are used to process and bundle your CSS, JavaScript and asset files for use in a web application."]}),"\n",(0,r.jsx)(t.h3,{id:"server-side-rendering-ssr",children:"Server-side rendering (SSR)"}),"\n",(0,r.jsx)(t.p,{children:"To integrate Stylable with server-side rendering, you have two options."}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:"The first option is to pre-build your stylesheets and assets using the Stylable, and then consume them on the server without any further Stylable-specific integration. "}),"\n",(0,r.jsxs)(t.li,{children:["The second option is to use the ",(0,r.jsxs)(t.a,{href:"/docs/guides/ssr#transforming-stylable-in-the-server",children:[(0,r.jsx)(t.strong,{children:"Stylable"})," node integration"]}),", which allows you to load and render Stylable stylesheets directly on the server. To use this option, you will need to integrate ",(0,r.jsx)(t.code,{children:"@stylable/node"})," into your server-side rendering pipeline."]}),"\n"]}),"\n",(0,r.jsx)(t.h2,{id:"component-library",children:"Component library"}),"\n",(0,r.jsx)(t.admonition,{type:"note",children:(0,r.jsx)(t.p,{children:"This section is a work in progress and will be updated further soon."})}),"\n",(0,r.jsx)(t.h2,{id:"additional-tooling-support",children:"Additional tooling support"}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Stylable"})," offers several additional ready-made integrations to pick from:"]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.a,{href:"/docs/getting-started/nextjs-integration",children:"Next.js integration"})," - for applications using the NextJS framework"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.a,{href:"/docs/getting-started/storybook-integration",children:"Storybook integration"})," - for projects using Storybook to demo their components"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.a,{href:"https://codux.com",children:"Codux"})," - a visual IDE for react projects, supports Stylable out of the box, no special integration needed"]}),"\n"]}),"\n",(0,r.jsx)(t.hr,{}),"\n",(0,r.jsx)(t.h2,{id:"integrated-and-ready-to-learn",children:"Integrated and ready to learn?"}),"\n",(0,r.jsxs)(t.p,{children:["Once you've finished configuring your project, you can begin styling with ",(0,r.jsx)(t.strong,{children:"Stylable"}),". Read through the ",(0,r.jsx)(t.a,{href:"/docs/guides/handbook/intro",children:"Handbook"})," or explore the ",(0,r.jsx)(t.a,{href:"/docs/references/cheatsheet",children:"API References"})," to help guide you in your work."]})]})}function p(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>s,x:()=>a});var i=n(6540);const r={},o=i.createContext(r);function s(e){const t=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:s(e.components),i.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/a2cbecc3.6eda11bb.js b/assets/js/a2cbecc3.6eda11bb.js deleted file mode 100644 index 4a264cdb..00000000 --- a/assets/js/a2cbecc3.6eda11bb.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[5299],{6771:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>a,default:()=>p,frontMatter:()=>s,metadata:()=>i,toc:()=>d});const i=JSON.parse('{"id":"getting-started/manual-integration","title":"Manual Integration","description":"When integrating Stylable into a project, there are key differences to consider whether the project is an application or a component library.","source":"@site/docs/getting-started/manual-integration.mdx","sourceDirName":"getting-started","slug":"/getting-started/manual-integration","permalink":"/docs/getting-started/manual-integration","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/getting-started/manual-integration.mdx","tags":[],"version":"current","frontMatter":{"id":"manual-integration","title":"Manual Integration"},"sidebar":"Discover","previous":{"title":"Boilerplate","permalink":"/docs/getting-started/boilerplate"},"next":{"title":"stylable.config.js","permalink":"/docs/getting-started/stylable-config"}}');var r=n(4848),o=n(8453);const s={id:"manual-integration",title:"Manual Integration"},a=void 0,l={},d=[{value:"TypeScript development",id:"typescript-development",level:2},{value:"Application",id:"application",level:2},{value:"Bundler",id:"bundler",level:3},{value:"Server-side rendering (SSR)",id:"server-side-rendering-ssr",level:3},{value:"Component library",id:"component-library",level:2},{value:"Additional tooling support",id:"additional-tooling-support",level:2},{value:"Integrated and ready to learn?",id:"integrated-and-ready-to-learn",level:2}];function c(e){const t={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",strong:"strong",ul:"ul",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.p,{children:["When integrating ",(0,r.jsx)(t.strong,{children:"Stylable"})," into a project, there are key differences to consider whether the project is an ",(0,r.jsx)(t.em,{children:"application"})," or a ",(0,r.jsx)(t.em,{children:"component library"}),"."]}),"\n",(0,r.jsx)(t.p,{children:"An application is a project that is deployed to production for end-users to access. While a component library is a project that is published to a package manager for other developers to consume in their projects."}),"\n",(0,r.jsx)(t.p,{children:"This difference mostly manifests in how these projects are built. For example, an application might build a final bundle for deployment, while a component library would build standalone modules to be consumed in various ways."}),"\n",(0,r.jsx)(t.h2,{id:"typescript-development",children:"TypeScript development"}),"\n",(0,r.jsxs)(t.p,{children:["For any project using TypeScript (applications or component libraries), it is strongly recommended to configure the project integrations to ",(0,r.jsxs)(t.a,{href:"/docs/getting-started/typescript-integration#generating-types-per-stylesheet",children:["generate ",(0,r.jsx)(t.code,{children:".d.ts"})," definitions"]})," for all ",(0,r.jsx)(t.strong,{children:"Stylable"})," stylesheets. This will provide contextual completions and type-checking for imported stylesheets during development."]}),"\n",(0,r.jsx)(t.h2,{id:"application",children:"Application"}),"\n",(0,r.jsx)(t.h3,{id:"bundler",children:"Bundler"}),"\n",(0,r.jsxs)(t.p,{children:["Stylable officially supports two different bundlers, ",(0,r.jsx)(t.a,{href:"/docs/getting-started/webpack-integration",children:"webpack"})," and ",(0,r.jsx)(t.a,{href:"/docs/getting-started/rollup-integration",children:"Rollup"}),". These bundlers are used to process and bundle your CSS, JavaScript and asset files for use in a web application."]}),"\n",(0,r.jsx)(t.h3,{id:"server-side-rendering-ssr",children:"Server-side rendering (SSR)"}),"\n",(0,r.jsx)(t.p,{children:"To integrate Stylable with server-side rendering, you have two options."}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:"The first option is to pre-build your stylesheets and assets using the Stylable, and then consume them on the server without any further Stylable-specific integration. "}),"\n",(0,r.jsxs)(t.li,{children:["The second option is to use the ",(0,r.jsxs)(t.a,{href:"/docs/guides/ssr#transforming-stylable-in-the-server",children:[(0,r.jsx)(t.strong,{children:"Stylable"})," node integration"]}),", which allows you to load and render Stylable stylesheets directly on the server. To use this option, you will need to integrate ",(0,r.jsx)(t.code,{children:"@stylable/node"})," into your server-side rendering pipeline."]}),"\n"]}),"\n",(0,r.jsx)(t.h2,{id:"component-library",children:"Component library"}),"\n",(0,r.jsx)(t.admonition,{type:"note",children:(0,r.jsx)(t.p,{children:"This section is a work in progress and will be updated further soon."})}),"\n",(0,r.jsx)(t.h2,{id:"additional-tooling-support",children:"Additional tooling support"}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Stylable"})," offers several additional ready-made integrations to pick from:"]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.a,{href:"/docs/getting-started/nextjs-integration",children:"Next.js integration"})," - for applications using the NextJS framework"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.a,{href:"/docs/getting-started/storybook-integration",children:"Storybook integration"})," - for projects using Storybook to demo their components"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.a,{href:"https://codux.com",children:"Codux"})," - a visual IDE for react projects, supports Stylable out of the box, no special integration needed"]}),"\n"]}),"\n",(0,r.jsx)(t.hr,{}),"\n",(0,r.jsx)(t.h2,{id:"integrated-and-ready-to-learn",children:"Integrated and ready to learn?"}),"\n",(0,r.jsxs)(t.p,{children:["Once you've finished configuring your project, you can begin styling with ",(0,r.jsx)(t.strong,{children:"Stylable"}),". Read through the ",(0,r.jsx)(t.a,{href:"/docs/guides/handbook/intro",children:"Handbook"})," or explore the ",(0,r.jsx)(t.a,{href:"/docs/references/cheatsheet",children:"API References"})," to help guide you in your work."]})]})}function p(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>s,x:()=>a});var i=n(6540);const r={},o=i.createContext(r);function s(e){const t=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:s(e.components),i.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/a399b375.29e0324c.js b/assets/js/a399b375.8bfc7039.js similarity index 99% rename from assets/js/a399b375.29e0324c.js rename to assets/js/a399b375.8bfc7039.js index c693d496..d9dcd7e6 100644 --- a/assets/js/a399b375.29e0324c.js +++ b/assets/js/a399b375.8bfc7039.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[5076],{7484:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>a,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>n,toc:()=>c});const n=JSON.parse('{"id":"getting-started/typescript-integration","title":"TypeScript","description":"Whenever a TypeScript file imports a Stylable stylesheet, you must provide a type for it. This is because TypeScript has no way of knowing what\'s inside Stylable *.st.css files.","source":"@site/docs/getting-started/typescript-integration.md","sourceDirName":"getting-started","slug":"/getting-started/typescript-integration","permalink":"/docs/getting-started/typescript-integration","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/getting-started/typescript-integration.md","tags":[],"version":"current","frontMatter":{"id":"typescript-integration","title":"TypeScript"},"sidebar":"Discover","previous":{"title":"Storybook","permalink":"/docs/getting-started/storybook-integration"},"next":{"title":"Webpack","permalink":"/docs/getting-started/webpack-integration"}}');var i=s(4848),r=s(8453);const l={id:"typescript-integration",title:"TypeScript"},o=void 0,a={},c=[{value:"Generating types per stylesheet",id:"generating-types-per-stylesheet",level:2},{value:"Generated files",id:"generated-files",level:3},{value:"Using the CLI",id:"using-the-cli",level:3},{value:"Using a bundler",id:"using-a-bundler",level:3},{value:"Global definition",id:"global-definition",level:2},{value:"Typing 3rd-party stylesheets",id:"typing-3rd-party-stylesheets",level:3},{value:"Publishing",id:"publishing",level:2}];function d(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",ul:"ul",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(t.p,{children:["Whenever a TypeScript file imports a Stylable stylesheet, you must provide a type for it. This is because TypeScript has no way of knowing what's inside Stylable ",(0,i.jsx)(t.code,{children:"*.st.css"})," files."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ts",metastring:'title="Import example"',children:"import { classes } from './button.st.css'; // requires typings\n"})}),"\n",(0,i.jsx)(t.h2,{id:"generating-types-per-stylesheet",children:"Generating types per stylesheet"}),"\n",(0,i.jsxs)(t.p,{children:["Stylable can generate a declaration file for each stylesheet. This approach has the advantage of providing exact typing information for each individual ",(0,i.jsx)(t.a,{href:"/docs/references/runtime",children:"stylesheet runtime API"}),"."]}),"\n",(0,i.jsx)(t.h3,{id:"generated-files",children:"Generated files"}),"\n",(0,i.jsx)(t.p,{children:"Stylable generates two kinds of type-related files:"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"*.d.ts"})," provides typing for the stylesheet runtime API."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"*.d.ts.map"})," provides mapping from the generated ",(0,i.jsx)(t.code,{children:".d.ts"})," file to the original ",(0,i.jsx)(t.code,{children:".st.css"})," stylesheet. This allows jumping to definitions in the original source straight from the TypeScript file."]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"Type definitions that are generated adjacent to the stylesheet are automatically detected and used by TypeScript. This can cause bloat in the project source files, however. To prevent clutter in your project, we recommend that you generate all stylesheet typings to a single directory."}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{children:"/* type files grouped in st-types folder */\n \u251c\u2500\u2500 src\n | \u251c\u2500\u2500 button.st.css - source stylesheet\n | \u2514\u2500\u2500 button.tsx - component file\n |\n \u2514\u2500\u2500 st-types\n \u251c\u2500\u2500 button.st.css.d.ts - type definition\n \u2514\u2500\u2500 button.st.css.d.ts.map - type definition source-map\n"})}),"\n",(0,i.jsxs)(t.p,{children:["You'll then need to configure TypeScript to use that directory. To do this, modify your ",(0,i.jsx)(t.code,{children:"tsconfig.json"})," to specify two ",(0,i.jsx)(t.code,{children:"rootDirs"})," - your source files, and the generated typings (learn more about this by reading the ",(0,i.jsxs)(t.a,{href:"https://www.typescriptlang.org/tsconfig#rootDirs",children:[(0,i.jsx)(t.code,{children:"tsconfig.json"})," documentation"]}),") like this:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-jsonc",metastring:'title="tsconfig.json"',children:'{\n "compilerOptions": {\n "rootDirs": ["./src", "./st-types"],\n },\n}\n'})}),"\n",(0,i.jsx)(t.admonition,{type:"tip",children:(0,i.jsxs)(t.p,{children:["We recommend adding the generated ",(0,i.jsx)(t.code,{children:"*.st.css.d.ts"})," and ",(0,i.jsx)(t.code,{children:"*.st.css.d.ts.map"})," files to your ",(0,i.jsx)(t.code,{children:".gitignore"})," file, and to only include them in your published packages."]})}),"\n",(0,i.jsx)(t.h3,{id:"using-the-cli",children:"Using the CLI"}),"\n",(0,i.jsxs)(t.p,{children:["To generate type definition files to the ",(0,i.jsx)(t.code,{children:"st-types"})," directory using the ",(0,i.jsxs)(t.a,{href:"https://github.com/wix/stylable/tree/master/packages/cli#cli-arguments",children:[(0,i.jsx)(t.code,{children:"stc"})," CLI"]}),", provide it with the ",(0,i.jsx)(t.code,{children:"--srcDir"}),", ",(0,i.jsx)(t.code,{children:"--outDir"})," and ",(0,i.jsx)(t.code,{children:"--dts"})," flags:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-sh",children:'stc --srcDir="src" --outDir="st-types" --dts\n'})}),"\n",(0,i.jsxs)(t.p,{children:["Source maps are generated by default when generating ",(0,i.jsx)(t.code,{children:".d.ts"})," files. If these are not wanted, the ",(0,i.jsx)(t.code,{children:"--dtsSourceMap"})," flag should be set to ",(0,i.jsx)(t.code,{children:"false"}),"."]}),"\n",(0,i.jsx)(t.admonition,{type:"tip",children:(0,i.jsxs)(t.p,{children:["Use ",(0,i.jsx)(t.a,{href:"https://github.com/wix/stylable/tree/master/packages/cli#configuration-file",children:(0,i.jsx)(t.code,{children:"stylable.config.js"})})," as a central location to share common Stylable configurations across tools and integrations."]})}),"\n",(0,i.jsx)(t.h3,{id:"using-a-bundler",children:"Using a bundler"}),"\n",(0,i.jsxs)(t.p,{children:["For projects that are already using one of our bundler integrations (",(0,i.jsx)(t.a,{href:"./webpack-integration",children:"webpack"})," or ",(0,i.jsx)(t.a,{href:"./rollup-integration",children:"rollup"}),"), you can configure the Stylable plugin to auto-generate types per stylesheet. This means that as you are working in your normal development flows, types will be updated in the background, and be available in your IDE."]}),"\n",(0,i.jsxs)(t.p,{children:["This functionality is dependant on a ",(0,i.jsx)(t.a,{href:"https://github.com/wix/stylable/tree/master/packages/cli#configuration-file",children:(0,i.jsx)(t.code,{children:"stylable.config.js"})})," file that includes configuration for generating ",(0,i.jsx)(t.code,{children:".d.ts"})," files."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",metastring:'title="stylable.config.js"',children:"//@ts-check\nconst { typedConfiguration } = require('@stylable/cli');\n\nexports.stcConfig = typedConfiguration({\n options: {\n srcDir: './src',\n outDir: './st-types',\n dts: true,\n },\n});\n"})}),"\n",(0,i.jsxs)(t.p,{children:["To activate this functionality in the bundler, configure the Stylable plugin with ",(0,i.jsx)(t.code,{children:"{ stcConfig: true }"}),"."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"// create a webpack plugin instance\nnew StylableWebpackPlugin({ stcConfig: true });\n\n// create a rollup plugin instance\nstylableRollupPlugin({ stcConfig: true });\n"})}),"\n",(0,i.jsx)(t.h2,{id:"global-definition",children:"Global definition"}),"\n",(0,i.jsxs)(t.p,{children:["If you choose not to generate ",(0,i.jsx)(t.code,{children:".d.ts"})," typings for each stylesheet, you'll have to include in your project a general purpose ",(0,i.jsx)(t.code,{children:"*.st.css"})," global declaration. This provides a broad signature of a Stylable stylesheet."]}),"\n",(0,i.jsxs)(t.p,{children:["To do this, create a ",(0,i.jsx)(t.code,{children:"globals.d.ts"})," file in your ",(0,i.jsx)(t.code,{children:"./src"})," directory and add the following declaration:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ts",metastring:'title="globals.d.ts"',children:"declare module '*.st.css' {\n export * from '@stylable/runtime/stylesheet';\n\n const defaultExport: unknown;\n export default defaultExport;\n}\n"})}),"\n",(0,i.jsx)(t.h3,{id:"typing-3rd-party-stylesheets",children:"Typing 3rd-party stylesheets"}),"\n",(0,i.jsxs)(t.p,{children:["If your project generates ",(0,i.jsx)(t.code,{children:".d.ts"})," typings for each stylesheet but you're consuming a package that published ",(0,i.jsx)(t.code,{children:".st.css"})," files without typings, you will have to declare global typings for that specific package."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ts",metastring:'title="globals.d.ts"',children:"declare module 'third-party-package/*.st.css' {\n export * from '@stylable/runtime/stylesheet';\n\n const defaultExport: unknown;\n export default defaultExport;\n}\n"})}),"\n",(0,i.jsx)(t.h2,{id:"publishing",children:"Publishing"}),"\n",(0,i.jsxs)(t.p,{children:["If you publish any ",(0,i.jsx)(t.code,{children:"*.st.css"})," files in your package, you should also publish the ",(0,i.jsx)(t.code,{children:".d.ts"})," and ",(0,i.jsx)(t.code,{children:".d.ts.map"})," files adjacent to them. This practice leads to a better experience for users consuming your project."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-sh",children:'stc --srcDir="src" --outDir="dist" --stcss --dts\n'})})]})}function h(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},8453:(e,t,s)=>{s.d(t,{R:()=>l,x:()=>o});var n=s(6540);const i={},r=n.createContext(i);function l(e){const t=n.useContext(r);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),n.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[5076],{5961:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>a,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>n,toc:()=>c});const n=JSON.parse('{"id":"getting-started/typescript-integration","title":"TypeScript","description":"Whenever a TypeScript file imports a Stylable stylesheet, you must provide a type for it. This is because TypeScript has no way of knowing what\'s inside Stylable *.st.css files.","source":"@site/docs/getting-started/typescript-integration.md","sourceDirName":"getting-started","slug":"/getting-started/typescript-integration","permalink":"/docs/getting-started/typescript-integration","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/getting-started/typescript-integration.md","tags":[],"version":"current","frontMatter":{"id":"typescript-integration","title":"TypeScript"},"sidebar":"Discover","previous":{"title":"Storybook","permalink":"/docs/getting-started/storybook-integration"},"next":{"title":"Webpack","permalink":"/docs/getting-started/webpack-integration"}}');var i=s(4848),r=s(8453);const l={id:"typescript-integration",title:"TypeScript"},o=void 0,a={},c=[{value:"Generating types per stylesheet",id:"generating-types-per-stylesheet",level:2},{value:"Generated files",id:"generated-files",level:3},{value:"Using the CLI",id:"using-the-cli",level:3},{value:"Using a bundler",id:"using-a-bundler",level:3},{value:"Global definition",id:"global-definition",level:2},{value:"Typing 3rd-party stylesheets",id:"typing-3rd-party-stylesheets",level:3},{value:"Publishing",id:"publishing",level:2}];function d(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",ul:"ul",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(t.p,{children:["Whenever a TypeScript file imports a Stylable stylesheet, you must provide a type for it. This is because TypeScript has no way of knowing what's inside Stylable ",(0,i.jsx)(t.code,{children:"*.st.css"})," files."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ts",metastring:'title="Import example"',children:"import { classes } from './button.st.css'; // requires typings\n"})}),"\n",(0,i.jsx)(t.h2,{id:"generating-types-per-stylesheet",children:"Generating types per stylesheet"}),"\n",(0,i.jsxs)(t.p,{children:["Stylable can generate a declaration file for each stylesheet. This approach has the advantage of providing exact typing information for each individual ",(0,i.jsx)(t.a,{href:"/docs/references/runtime",children:"stylesheet runtime API"}),"."]}),"\n",(0,i.jsx)(t.h3,{id:"generated-files",children:"Generated files"}),"\n",(0,i.jsx)(t.p,{children:"Stylable generates two kinds of type-related files:"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"*.d.ts"})," provides typing for the stylesheet runtime API."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"*.d.ts.map"})," provides mapping from the generated ",(0,i.jsx)(t.code,{children:".d.ts"})," file to the original ",(0,i.jsx)(t.code,{children:".st.css"})," stylesheet. This allows jumping to definitions in the original source straight from the TypeScript file."]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"Type definitions that are generated adjacent to the stylesheet are automatically detected and used by TypeScript. This can cause bloat in the project source files, however. To prevent clutter in your project, we recommend that you generate all stylesheet typings to a single directory."}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{children:"/* type files grouped in st-types folder */\n \u251c\u2500\u2500 src\n | \u251c\u2500\u2500 button.st.css - source stylesheet\n | \u2514\u2500\u2500 button.tsx - component file\n |\n \u2514\u2500\u2500 st-types\n \u251c\u2500\u2500 button.st.css.d.ts - type definition\n \u2514\u2500\u2500 button.st.css.d.ts.map - type definition source-map\n"})}),"\n",(0,i.jsxs)(t.p,{children:["You'll then need to configure TypeScript to use that directory. To do this, modify your ",(0,i.jsx)(t.code,{children:"tsconfig.json"})," to specify two ",(0,i.jsx)(t.code,{children:"rootDirs"})," - your source files, and the generated typings (learn more about this by reading the ",(0,i.jsxs)(t.a,{href:"https://www.typescriptlang.org/tsconfig#rootDirs",children:[(0,i.jsx)(t.code,{children:"tsconfig.json"})," documentation"]}),") like this:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-jsonc",metastring:'title="tsconfig.json"',children:'{\n "compilerOptions": {\n "rootDirs": ["./src", "./st-types"],\n },\n}\n'})}),"\n",(0,i.jsx)(t.admonition,{type:"tip",children:(0,i.jsxs)(t.p,{children:["We recommend adding the generated ",(0,i.jsx)(t.code,{children:"*.st.css.d.ts"})," and ",(0,i.jsx)(t.code,{children:"*.st.css.d.ts.map"})," files to your ",(0,i.jsx)(t.code,{children:".gitignore"})," file, and to only include them in your published packages."]})}),"\n",(0,i.jsx)(t.h3,{id:"using-the-cli",children:"Using the CLI"}),"\n",(0,i.jsxs)(t.p,{children:["To generate type definition files to the ",(0,i.jsx)(t.code,{children:"st-types"})," directory using the ",(0,i.jsxs)(t.a,{href:"https://github.com/wix/stylable/tree/master/packages/cli#cli-arguments",children:[(0,i.jsx)(t.code,{children:"stc"})," CLI"]}),", provide it with the ",(0,i.jsx)(t.code,{children:"--srcDir"}),", ",(0,i.jsx)(t.code,{children:"--outDir"})," and ",(0,i.jsx)(t.code,{children:"--dts"})," flags:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-sh",children:'stc --srcDir="src" --outDir="st-types" --dts\n'})}),"\n",(0,i.jsxs)(t.p,{children:["Source maps are generated by default when generating ",(0,i.jsx)(t.code,{children:".d.ts"})," files. If these are not wanted, the ",(0,i.jsx)(t.code,{children:"--dtsSourceMap"})," flag should be set to ",(0,i.jsx)(t.code,{children:"false"}),"."]}),"\n",(0,i.jsx)(t.admonition,{type:"tip",children:(0,i.jsxs)(t.p,{children:["Use ",(0,i.jsx)(t.a,{href:"https://github.com/wix/stylable/tree/master/packages/cli#configuration-file",children:(0,i.jsx)(t.code,{children:"stylable.config.js"})})," as a central location to share common Stylable configurations across tools and integrations."]})}),"\n",(0,i.jsx)(t.h3,{id:"using-a-bundler",children:"Using a bundler"}),"\n",(0,i.jsxs)(t.p,{children:["For projects that are already using one of our bundler integrations (",(0,i.jsx)(t.a,{href:"./webpack-integration",children:"webpack"})," or ",(0,i.jsx)(t.a,{href:"./rollup-integration",children:"rollup"}),"), you can configure the Stylable plugin to auto-generate types per stylesheet. This means that as you are working in your normal development flows, types will be updated in the background, and be available in your IDE."]}),"\n",(0,i.jsxs)(t.p,{children:["This functionality is dependant on a ",(0,i.jsx)(t.a,{href:"https://github.com/wix/stylable/tree/master/packages/cli#configuration-file",children:(0,i.jsx)(t.code,{children:"stylable.config.js"})})," file that includes configuration for generating ",(0,i.jsx)(t.code,{children:".d.ts"})," files."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",metastring:'title="stylable.config.js"',children:"//@ts-check\nconst { typedConfiguration } = require('@stylable/cli');\n\nexports.stcConfig = typedConfiguration({\n options: {\n srcDir: './src',\n outDir: './st-types',\n dts: true,\n },\n});\n"})}),"\n",(0,i.jsxs)(t.p,{children:["To activate this functionality in the bundler, configure the Stylable plugin with ",(0,i.jsx)(t.code,{children:"{ stcConfig: true }"}),"."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"// create a webpack plugin instance\nnew StylableWebpackPlugin({ stcConfig: true });\n\n// create a rollup plugin instance\nstylableRollupPlugin({ stcConfig: true });\n"})}),"\n",(0,i.jsx)(t.h2,{id:"global-definition",children:"Global definition"}),"\n",(0,i.jsxs)(t.p,{children:["If you choose not to generate ",(0,i.jsx)(t.code,{children:".d.ts"})," typings for each stylesheet, you'll have to include in your project a general purpose ",(0,i.jsx)(t.code,{children:"*.st.css"})," global declaration. This provides a broad signature of a Stylable stylesheet."]}),"\n",(0,i.jsxs)(t.p,{children:["To do this, create a ",(0,i.jsx)(t.code,{children:"globals.d.ts"})," file in your ",(0,i.jsx)(t.code,{children:"./src"})," directory and add the following declaration:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ts",metastring:'title="globals.d.ts"',children:"declare module '*.st.css' {\n export * from '@stylable/runtime/stylesheet';\n\n const defaultExport: unknown;\n export default defaultExport;\n}\n"})}),"\n",(0,i.jsx)(t.h3,{id:"typing-3rd-party-stylesheets",children:"Typing 3rd-party stylesheets"}),"\n",(0,i.jsxs)(t.p,{children:["If your project generates ",(0,i.jsx)(t.code,{children:".d.ts"})," typings for each stylesheet but you're consuming a package that published ",(0,i.jsx)(t.code,{children:".st.css"})," files without typings, you will have to declare global typings for that specific package."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ts",metastring:'title="globals.d.ts"',children:"declare module 'third-party-package/*.st.css' {\n export * from '@stylable/runtime/stylesheet';\n\n const defaultExport: unknown;\n export default defaultExport;\n}\n"})}),"\n",(0,i.jsx)(t.h2,{id:"publishing",children:"Publishing"}),"\n",(0,i.jsxs)(t.p,{children:["If you publish any ",(0,i.jsx)(t.code,{children:"*.st.css"})," files in your package, you should also publish the ",(0,i.jsx)(t.code,{children:".d.ts"})," and ",(0,i.jsx)(t.code,{children:".d.ts.map"})," files adjacent to them. This practice leads to a better experience for users consuming your project."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-sh",children:'stc --srcDir="src" --outDir="dist" --stcss --dts\n'})})]})}function h(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},8453:(e,t,s)=>{s.d(t,{R:()=>l,x:()=>o});var n=s(6540);const i={},r=n.createContext(i);function l(e){const t=n.useContext(r);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),n.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/a6aa9e1f.6922b99d.js b/assets/js/a6aa9e1f.4afca62e.js similarity index 78% rename from assets/js/a6aa9e1f.6922b99d.js rename to assets/js/a6aa9e1f.4afca62e.js index eedb3de8..44c9bae3 100644 --- a/assets/js/a6aa9e1f.6922b99d.js +++ b/assets/js/a6aa9e1f.4afca62e.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[7643],{2783:(e,t,n)=>{n.r(t),n.d(t,{default:()=>m});n(6540);var a=n(4164),i=n(7639),s=n(6644),r=n(8630),l=n(6953),o=n(4934),c=n(1210),g=n(4331),p=n(1141),d=n(9101),x=n(4848);function b(e){const t=(0,d.kJ)(e);return(0,x.jsx)(p.A,{children:(0,x.jsx)("script",{type:"application/ld+json",children:JSON.stringify(t)})})}function h(e){const{metadata:t}=e,{siteConfig:{title:n}}=(0,i.A)(),{blogDescription:a,blogTitle:r,permalink:l}=t,o="/"===l?n:r;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(s.be,{title:o,description:a}),(0,x.jsx)(c.A,{tag:"blog_posts_list"})]})}function j(e){const{metadata:t,items:n,sidebar:a}=e;return(0,x.jsxs)(l.A,{sidebar:a,children:[(0,x.jsx)(g.A,{items:n}),(0,x.jsx)(o.A,{metadata:t})]})}function m(e){return(0,x.jsxs)(s.e3,{className:(0,a.A)(r.G.wrapper.blogPages,r.G.page.blogListPage),children:[(0,x.jsx)(h,{...e}),(0,x.jsx)(b,{...e}),(0,x.jsx)(j,{...e})]})}},4934:(e,t,n)=>{n.d(t,{A:()=>r});n(6540);var a=n(3230),i=n(3555),s=n(4848);function r(e){const{metadata:t}=e,{previousPage:n,nextPage:r}=t;return(0,s.jsxs)("nav",{className:"pagination-nav","aria-label":(0,a.T)({id:"theme.blog.paginator.navAriaLabel",message:"Blog list page navigation",description:"The ARIA label for the blog pagination"}),children:[n&&(0,s.jsx)(i.A,{permalink:n,title:(0,s.jsx)(a.A,{id:"theme.blog.paginator.newerEntries",description:"The label used to navigate to the newer blog posts page (previous page)",children:"Newer entries"})}),r&&(0,s.jsx)(i.A,{permalink:r,title:(0,s.jsx)(a.A,{id:"theme.blog.paginator.olderEntries",description:"The label used to navigate to the older blog posts page (next page)",children:"Older entries"}),isNext:!0})]})}},4331:(e,t,n)=>{n.d(t,{A:()=>r});n(6540);var a=n(9101),i=n(8406),s=n(4848);function r(e){let{items:t,component:n=i.A}=e;return(0,s.jsx)(s.Fragment,{children:t.map((e=>{let{content:t}=e;return(0,s.jsx)(a.in,{content:t,children:(0,s.jsx)(n,{children:(0,s.jsx)(t,{})})},t.metadata.permalink)}))})}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[7643],{5124:(e,t,n)=>{n.r(t),n.d(t,{default:()=>m});n(6540);var a=n(4164),i=n(4586),s=n(1213),r=n(7559),l=n(8027),o=n(7713),c=n(1463),g=n(3892),p=n(5260),d=n(4096),x=n(4848);function b(e){const t=(0,d.kJ)(e);return(0,x.jsx)(p.A,{children:(0,x.jsx)("script",{type:"application/ld+json",children:JSON.stringify(t)})})}function h(e){const{metadata:t}=e,{siteConfig:{title:n}}=(0,i.A)(),{blogDescription:a,blogTitle:r,permalink:l}=t,o="/"===l?n:r;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(s.be,{title:o,description:a}),(0,x.jsx)(c.A,{tag:"blog_posts_list"})]})}function j(e){const{metadata:t,items:n,sidebar:a}=e;return(0,x.jsxs)(l.A,{sidebar:a,children:[(0,x.jsx)(g.A,{items:n}),(0,x.jsx)(o.A,{metadata:t})]})}function m(e){return(0,x.jsxs)(s.e3,{className:(0,a.A)(r.G.wrapper.blogPages,r.G.page.blogListPage),children:[(0,x.jsx)(h,{...e}),(0,x.jsx)(b,{...e}),(0,x.jsx)(j,{...e})]})}},7713:(e,t,n)=>{n.d(t,{A:()=>r});n(6540);var a=n(1312),i=n(9022),s=n(4848);function r(e){const{metadata:t}=e,{previousPage:n,nextPage:r}=t;return(0,s.jsxs)("nav",{className:"pagination-nav","aria-label":(0,a.T)({id:"theme.blog.paginator.navAriaLabel",message:"Blog list page navigation",description:"The ARIA label for the blog pagination"}),children:[n&&(0,s.jsx)(i.A,{permalink:n,title:(0,s.jsx)(a.A,{id:"theme.blog.paginator.newerEntries",description:"The label used to navigate to the newer blog posts page (previous page)",children:"Newer entries"})}),r&&(0,s.jsx)(i.A,{permalink:r,title:(0,s.jsx)(a.A,{id:"theme.blog.paginator.olderEntries",description:"The label used to navigate to the older blog posts page (next page)",children:"Older entries"}),isNext:!0})]})}},3892:(e,t,n)=>{n.d(t,{A:()=>r});n(6540);var a=n(4096),i=n(4387),s=n(4848);function r(e){let{items:t,component:n=i.A}=e;return(0,s.jsx)(s.Fragment,{children:t.map((e=>{let{content:t}=e;return(0,s.jsx)(a.in,{content:t,children:(0,s.jsx)(n,{children:(0,s.jsx)(t,{})})},t.metadata.permalink)}))})}}}]); \ No newline at end of file diff --git a/assets/js/a7bd4aaa.6fbe4646.js b/assets/js/a7bd4aaa.579ec113.js similarity index 72% rename from assets/js/a7bd4aaa.6fbe4646.js rename to assets/js/a7bd4aaa.579ec113.js index 4c3624f9..52c7ecfb 100644 --- a/assets/js/a7bd4aaa.6fbe4646.js +++ b/assets/js/a7bd4aaa.579ec113.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[7098],{2881:(n,e,s)=>{s.r(e),s.d(e,{default:()=>x});s(6540);var r=s(6644),o=s(3718),t=s(1704),i=s(2831),l=s(1210),c=s(4848);function a(n){const{version:e}=n;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(l.A,{version:e.version,tag:(0,o.k)(e.pluginId,e.version)}),(0,c.jsx)(r.be,{children:e.noIndex&&(0,c.jsx)("meta",{name:"robots",content:"noindex, nofollow"})})]})}function u(n){const{version:e,route:s}=n;return(0,c.jsx)(r.e3,{className:e.className,children:(0,c.jsx)(t.n,{version:e,children:(0,i.v)(s.routes)})})}function x(n){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(a,{...n}),(0,c.jsx)(u,{...n})]})}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[7098],{4532:(n,e,s)=>{s.r(e),s.d(e,{default:()=>x});s(6540);var r=s(1213),o=s(2565),t=s(3025),i=s(2831),l=s(1463),c=s(4848);function a(n){const{version:e}=n;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(l.A,{version:e.version,tag:(0,o.k)(e.pluginId,e.version)}),(0,c.jsx)(r.be,{children:e.noIndex&&(0,c.jsx)("meta",{name:"robots",content:"noindex, nofollow"})})]})}function u(n){const{version:e,route:s}=n;return(0,c.jsx)(r.e3,{className:e.className,children:(0,c.jsx)(t.n,{version:e,children:(0,i.v)(s.routes)})})}function x(n){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(a,{...n}),(0,c.jsx)(u,{...n})]})}}}]); \ No newline at end of file diff --git a/assets/js/a94703ab.852b20e9.js b/assets/js/a94703ab.852b20e9.js new file mode 100644 index 00000000..d1417f0f --- /dev/null +++ b/assets/js/a94703ab.852b20e9.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[9048],{1377:(e,t,n)=>{n.r(t),n.d(t,{default:()=>pe});var a=n(6540),o=n(4164),i=n(1213),s=n(7559),l=n(6972),r=n(609),c=n(1312),d=n(3104),u=n(5062);const m={backToTopButton:"backToTopButton_sjWU",backToTopButtonShow:"backToTopButtonShow_xfvO"};var b=n(4848);function h(){const{shown:e,scrollToTop:t}=function(e){let{threshold:t}=e;const[n,o]=(0,a.useState)(!1),i=(0,a.useRef)(!1),{startScroll:s,cancelScroll:l}=(0,d.gk)();return(0,d.Mq)(((e,n)=>{let{scrollY:a}=e;const s=n?.scrollY;s&&(i.current?i.current=!1:a>=s?(l(),o(!1)):a{e.location.hash&&(i.current=!0,o(!1))})),{shown:n,scrollToTop:()=>s(0)}}({threshold:300});return(0,b.jsx)("button",{"aria-label":(0,c.T)({id:"theme.BackToTopButton.buttonAriaLabel",message:"Scroll back to top",description:"The ARIA label for the back to top button"}),className:(0,o.A)("clean-btn",s.G.common.backToTopButton,m.backToTopButton,e&&m.backToTopButtonShow),type:"button",onClick:t})}var p=n(3109),x=n(6347),f=n(4581),j=n(6342),v=n(3465);function _(e){return(0,b.jsx)("svg",{width:"20",height:"20","aria-hidden":"true",...e,children:(0,b.jsxs)("g",{fill:"#7a7a7a",children:[(0,b.jsx)("path",{d:"M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"}),(0,b.jsx)("path",{d:"M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"})]})})}const g="collapseSidebarButton_PEFL",A="collapseSidebarButtonIcon_kv0_";function C(e){let{onClick:t}=e;return(0,b.jsx)("button",{type:"button",title:(0,c.T)({id:"theme.docs.sidebar.collapseButtonTitle",message:"Collapse sidebar",description:"The title attribute for collapse button of doc sidebar"}),"aria-label":(0,c.T)({id:"theme.docs.sidebar.collapseButtonAriaLabel",message:"Collapse sidebar",description:"The title attribute for collapse button of doc sidebar"}),className:(0,o.A)("button button--secondary button--outline",g),onClick:t,children:(0,b.jsx)(_,{className:A})})}var k=n(5041),S=n(9532);const T=Symbol("EmptyContext"),N=a.createContext(T);function I(e){let{children:t}=e;const[n,o]=(0,a.useState)(null),i=(0,a.useMemo)((()=>({expandedItem:n,setExpandedItem:o})),[n]);return(0,b.jsx)(N.Provider,{value:i,children:t})}var y=n(1422),B=n(9169),w=n(8774),L=n(2303);function E(e){let{collapsed:t,categoryLabel:n,onClick:a}=e;return(0,b.jsx)("button",{"aria-label":t?(0,c.T)({id:"theme.DocSidebarItem.expandCategoryAriaLabel",message:"Expand sidebar category '{label}'",description:"The ARIA label to expand the sidebar category"},{label:n}):(0,c.T)({id:"theme.DocSidebarItem.collapseCategoryAriaLabel",message:"Collapse sidebar category '{label}'",description:"The ARIA label to collapse the sidebar category"},{label:n}),"aria-expanded":!t,type:"button",className:"clean-btn menu__caret",onClick:a})}function M(e){let{item:t,onItemClick:n,activePath:i,level:r,index:c,...d}=e;const{items:u,label:m,collapsible:h,className:p,href:x}=t,{docs:{sidebar:{autoCollapseCategories:f}}}=(0,j.p)(),v=function(e){const t=(0,L.A)();return(0,a.useMemo)((()=>e.href&&!e.linkUnlisted?e.href:!t&&e.collapsible?(0,l.Nr)(e):void 0),[e,t])}(t),_=(0,l.w8)(t,i),g=(0,B.ys)(x,i),{collapsed:A,setCollapsed:C}=(0,y.u)({initialState:()=>!!h&&(!_&&t.collapsed)}),{expandedItem:k,setExpandedItem:I}=function(){const e=(0,a.useContext)(N);if(e===T)throw new S.dV("DocSidebarItemsExpandedStateProvider");return e}(),M=function(e){void 0===e&&(e=!A),I(e?null:c),C(e)};return function(e){let{isActive:t,collapsed:n,updateCollapsed:o}=e;const i=(0,S.ZC)(t);(0,a.useEffect)((()=>{t&&!i&&n&&o(!1)}),[t,i,n,o])}({isActive:_,collapsed:A,updateCollapsed:M}),(0,a.useEffect)((()=>{h&&null!=k&&k!==c&&f&&C(!0)}),[h,k,c,C,f]),(0,b.jsxs)("li",{className:(0,o.A)(s.G.docs.docSidebarItemCategory,s.G.docs.docSidebarItemCategoryLevel(r),"menu__list-item",{"menu__list-item--collapsed":A},p),children:[(0,b.jsxs)("div",{className:(0,o.A)("menu__list-item-collapsible",{"menu__list-item-collapsible--active":g}),children:[(0,b.jsx)(w.A,{className:(0,o.A)("menu__link",{"menu__link--sublist":h,"menu__link--sublist-caret":!x&&h,"menu__link--active":_}),onClick:h?e=>{n?.(t),x?M(!1):(e.preventDefault(),M())}:()=>{n?.(t)},"aria-current":g?"page":void 0,role:h&&!x?"button":void 0,"aria-expanded":h&&!x?!A:void 0,href:h?v??"#":v,...d,children:m}),x&&h&&(0,b.jsx)(E,{collapsed:A,categoryLabel:m,onClick:e=>{e.preventDefault(),M()}})]}),(0,b.jsx)(y.N,{lazy:!0,as:"ul",className:"menu__list",collapsed:A,children:(0,b.jsx)(V,{items:u,tabIndex:A?-1:0,onItemClick:n,activePath:i,level:r+1})})]})}var H=n(6654),G=n(3186);const P="menuExternalLink_NmtK";function R(e){let{item:t,onItemClick:n,activePath:a,level:i,index:r,...c}=e;const{href:d,label:u,className:m,autoAddBaseUrl:h}=t,p=(0,l.w8)(t,a),x=(0,H.A)(d);return(0,b.jsx)("li",{className:(0,o.A)(s.G.docs.docSidebarItemLink,s.G.docs.docSidebarItemLinkLevel(i),"menu__list-item",m),children:(0,b.jsxs)(w.A,{className:(0,o.A)("menu__link",!x&&P,{"menu__link--active":p}),autoAddBaseUrl:h,"aria-current":p?"page":void 0,to:d,...x&&{onClick:n?()=>n(t):void 0},...c,children:[u,!x&&(0,b.jsx)(G.A,{})]})},u)}const W="menuHtmlItem_M9Kj";function D(e){let{item:t,level:n,index:a}=e;const{value:i,defaultStyle:l,className:r}=t;return(0,b.jsx)("li",{className:(0,o.A)(s.G.docs.docSidebarItemLink,s.G.docs.docSidebarItemLinkLevel(n),l&&[W,"menu__list-item"],r),dangerouslySetInnerHTML:{__html:i}},a)}function F(e){let{item:t,...n}=e;switch(t.type){case"category":return(0,b.jsx)(M,{item:t,...n});case"html":return(0,b.jsx)(D,{item:t,...n});default:return(0,b.jsx)(R,{item:t,...n})}}function U(e){let{items:t,...n}=e;const a=(0,l.Y)(t,n.activePath);return(0,b.jsx)(I,{children:a.map(((e,t)=>(0,b.jsx)(F,{item:e,index:t,...n},t)))})}const V=(0,a.memo)(U),Y="menu_SIkG",K="menuWithAnnouncementBar_GW3s";function z(e){let{path:t,sidebar:n,className:i}=e;const l=function(){const{isActive:e}=(0,k.M)(),[t,n]=(0,a.useState)(e);return(0,d.Mq)((t=>{let{scrollY:a}=t;e&&n(0===a)}),[e]),e&&t}();return(0,b.jsx)("nav",{"aria-label":(0,c.T)({id:"theme.docs.sidebar.navAriaLabel",message:"Docs sidebar",description:"The ARIA label for the sidebar navigation"}),className:(0,o.A)("menu thin-scrollbar",Y,l&&K,i),children:(0,b.jsx)("ul",{className:(0,o.A)(s.G.docs.docSidebarMenu,"menu__list"),children:(0,b.jsx)(V,{items:n,activePath:t,level:1})})})}const q="sidebar_njMd",O="sidebarWithHideableNavbar_wUlq",J="sidebarHidden_VK0M",Q="sidebarLogo_isFc";function X(e){let{path:t,sidebar:n,onCollapse:a,isHidden:i}=e;const{navbar:{hideOnScroll:s},docs:{sidebar:{hideable:l}}}=(0,j.p)();return(0,b.jsxs)("div",{className:(0,o.A)(q,s&&O,i&&J),children:[s&&(0,b.jsx)(v.A,{tabIndex:-1,className:Q}),(0,b.jsx)(z,{path:t,sidebar:n}),l&&(0,b.jsx)(C,{onClick:a})]})}const Z=a.memo(X);var $=n(5600),ee=n(2069);const te=e=>{let{sidebar:t,path:n}=e;const a=(0,ee.M)();return(0,b.jsx)("ul",{className:(0,o.A)(s.G.docs.docSidebarMenu,"menu__list"),children:(0,b.jsx)(V,{items:t,activePath:n,onItemClick:e=>{"category"===e.type&&e.href&&a.toggle(),"link"===e.type&&a.toggle()},level:1})})};function ne(e){return(0,b.jsx)($.GX,{component:te,props:e})}const ae=a.memo(ne);function oe(e){const t=(0,f.l)(),n="desktop"===t||"ssr"===t,a="mobile"===t;return(0,b.jsxs)(b.Fragment,{children:[n&&(0,b.jsx)(Z,{...e}),a&&(0,b.jsx)(ae,{...e})]})}const ie={expandButton:"expandButton_TmdG",expandButtonIcon:"expandButtonIcon_i1dp"};function se(e){let{toggleSidebar:t}=e;return(0,b.jsx)("div",{className:ie.expandButton,title:(0,c.T)({id:"theme.docs.sidebar.expandButtonTitle",message:"Expand sidebar",description:"The ARIA label and title attribute for expand button of doc sidebar"}),"aria-label":(0,c.T)({id:"theme.docs.sidebar.expandButtonAriaLabel",message:"Expand sidebar",description:"The ARIA label and title attribute for expand button of doc sidebar"}),tabIndex:0,role:"button",onKeyDown:t,onClick:t,children:(0,b.jsx)(_,{className:ie.expandButtonIcon})})}const le={docSidebarContainer:"docSidebarContainer_YfHR",docSidebarContainerHidden:"docSidebarContainerHidden_DPk8",sidebarViewport:"sidebarViewport_aRkj"};function re(e){let{children:t}=e;const n=(0,r.t)();return(0,b.jsx)(a.Fragment,{children:t},n?.name??"noSidebar")}function ce(e){let{sidebar:t,hiddenSidebarContainer:n,setHiddenSidebarContainer:i}=e;const{pathname:l}=(0,x.zy)(),[r,c]=(0,a.useState)(!1),d=(0,a.useCallback)((()=>{r&&c(!1),!r&&(0,p.O)()&&c(!0),i((e=>!e))}),[i,r]);return(0,b.jsx)("aside",{className:(0,o.A)(s.G.docs.docSidebarContainer,le.docSidebarContainer,n&&le.docSidebarContainerHidden),onTransitionEnd:e=>{e.currentTarget.classList.contains(le.docSidebarContainer)&&n&&c(!0)},children:(0,b.jsx)(re,{children:(0,b.jsxs)("div",{className:(0,o.A)(le.sidebarViewport,r&&le.sidebarViewportHidden),children:[(0,b.jsx)(oe,{sidebar:t,path:l,onCollapse:d,isHidden:r}),r&&(0,b.jsx)(se,{toggleSidebar:d})]})})})}const de={docMainContainer:"docMainContainer_TBSr",docMainContainerEnhanced:"docMainContainerEnhanced_lQrH",docItemWrapperEnhanced:"docItemWrapperEnhanced_JWYK"};function ue(e){let{hiddenSidebarContainer:t,children:n}=e;const a=(0,r.t)();return(0,b.jsx)("main",{className:(0,o.A)(de.docMainContainer,(t||!a)&&de.docMainContainerEnhanced),children:(0,b.jsx)("div",{className:(0,o.A)("container padding-top--md padding-bottom--lg",de.docItemWrapper,t&&de.docItemWrapperEnhanced),children:n})})}const me={docRoot:"docRoot_UBD9",docsWrapper:"docsWrapper_hBAB"};function be(e){let{children:t}=e;const n=(0,r.t)(),[o,i]=(0,a.useState)(!1);return(0,b.jsxs)("div",{className:me.docsWrapper,children:[(0,b.jsx)(h,{}),(0,b.jsxs)("div",{className:me.docRoot,children:[n&&(0,b.jsx)(ce,{sidebar:n.items,hiddenSidebarContainer:o,setHiddenSidebarContainer:i}),(0,b.jsx)(ue,{hiddenSidebarContainer:o,children:t})]})]})}var he=n(3363);function pe(e){const t=(0,l.B5)(e);if(!t)return(0,b.jsx)(he.A,{});const{docElement:n,sidebarName:a,sidebarItems:c}=t;return(0,b.jsx)(i.e3,{className:(0,o.A)(s.G.page.docsDocPage),children:(0,b.jsx)(r.V,{name:a,items:c,children:(0,b.jsx)(be,{children:n})})})}},3363:(e,t,n)=>{n.d(t,{A:()=>l});n(6540);var a=n(4164),o=n(1312),i=n(1107),s=n(4848);function l(e){let{className:t}=e;return(0,s.jsx)("main",{className:(0,a.A)("container margin-vert--xl",t),children:(0,s.jsx)("div",{className:"row",children:(0,s.jsxs)("div",{className:"col col--6 col--offset-3",children:[(0,s.jsx)(i.A,{as:"h1",className:"hero__title",children:(0,s.jsx)(o.A,{id:"theme.NotFound.title",description:"The title of the 404 page",children:"Page Not Found"})}),(0,s.jsx)("p",{children:(0,s.jsx)(o.A,{id:"theme.NotFound.p1",description:"The first paragraph of the 404 page",children:"We could not find what you were looking for."})}),(0,s.jsx)("p",{children:(0,s.jsx)(o.A,{id:"theme.NotFound.p2",description:"The 2nd paragraph of the 404 page",children:"Please contact the owner of the site that linked you to the original URL and let them know their link is broken."})})]})})})}}}]); \ No newline at end of file diff --git a/assets/js/a94703ab.94ecb513.js b/assets/js/a94703ab.94ecb513.js deleted file mode 100644 index 8a591ccb..00000000 --- a/assets/js/a94703ab.94ecb513.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[9048],{8001:(e,t,n)=>{n.r(t),n.d(t,{default:()=>pe});var a=n(6540),o=n(4164),i=n(6644),s=n(8630),l=n(5357),r=n(40),c=n(3230),d=n(4245),u=n(4067);const m={backToTopButton:"backToTopButton_sjWU",backToTopButtonShow:"backToTopButtonShow_xfvO"};var b=n(4848);function h(){const{shown:e,scrollToTop:t}=function(e){let{threshold:t}=e;const[n,o]=(0,a.useState)(!1),i=(0,a.useRef)(!1),{startScroll:s,cancelScroll:l}=(0,d.gk)();return(0,d.Mq)(((e,n)=>{let{scrollY:a}=e;const s=n?.scrollY;s&&(i.current?i.current=!1:a>=s?(l(),o(!1)):a {e.location.hash&&(i.current=!0,o(!1))})),{shown:n,scrollToTop:()=>s(0)}}({threshold:300});return(0,b.jsx)("button",{"aria-label":(0,c.T)({id:"theme.BackToTopButton.buttonAriaLabel",message:"Scroll back to top",description:"The ARIA label for the back to top button"}),className:(0,o.A)("clean-btn",s.G.common.backToTopButton,m.backToTopButton,e&&m.backToTopButtonShow),type:"button",onClick:t})}var p=n(6350),x=n(6347),f=n(2216),j=n(6957),v=n(20);function _(e){return(0,b.jsx)("svg",{width:"20",height:"20","aria-hidden":"true",...e,children:(0,b.jsxs)("g",{fill:"#7a7a7a",children:[(0,b.jsx)("path",{d:"M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"}),(0,b.jsx)("path",{d:"M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"})]})})}const g="collapseSidebarButton_PEFL",A="collapseSidebarButtonIcon_kv0_";function C(e){let{onClick:t}=e;return(0,b.jsx)("button",{type:"button",title:(0,c.T)({id:"theme.docs.sidebar.collapseButtonTitle",message:"Collapse sidebar",description:"The title attribute for collapse button of doc sidebar"}),"aria-label":(0,c.T)({id:"theme.docs.sidebar.collapseButtonAriaLabel",message:"Collapse sidebar",description:"The title attribute for collapse button of doc sidebar"}),className:(0,o.A)("button button--secondary button--outline",g),onClick:t,children:(0,b.jsx)(_,{className:A})})}var k=n(2),S=n(4799);const T=Symbol("EmptyContext"),N=a.createContext(T);function I(e){let{children:t}=e;const[n,o]=(0,a.useState)(null),i=(0,a.useMemo)((()=>({expandedItem:n,setExpandedItem:o})),[n]);return(0,b.jsx)(N.Provider,{value:i,children:t})}var y=n(4549),B=n(260),w=n(4783),L=n(1062);function E(e){let{collapsed:t,categoryLabel:n,onClick:a}=e;return(0,b.jsx)("button",{"aria-label":t?(0,c.T)({id:"theme.DocSidebarItem.expandCategoryAriaLabel",message:"Expand sidebar category '{label}'",description:"The ARIA label to expand the sidebar category"},{label:n}):(0,c.T)({id:"theme.DocSidebarItem.collapseCategoryAriaLabel",message:"Collapse sidebar category '{label}'",description:"The ARIA label to collapse the sidebar category"},{label:n}),"aria-expanded":!t,type:"button",className:"clean-btn menu__caret",onClick:a})}function M(e){let{item:t,onItemClick:n,activePath:i,level:r,index:c,...d}=e;const{items:u,label:m,collapsible:h,className:p,href:x}=t,{docs:{sidebar:{autoCollapseCategories:f}}}=(0,j.p)(),v=function(e){const t=(0,L.A)();return(0,a.useMemo)((()=>e.href&&!e.linkUnlisted?e.href:!t&&e.collapsible?(0,l.Nr)(e):void 0),[e,t])}(t),_=(0,l.w8)(t,i),g=(0,B.ys)(x,i),{collapsed:A,setCollapsed:C}=(0,y.u)({initialState:()=>!!h&&(!_&&t.collapsed)}),{expandedItem:k,setExpandedItem:I}=function(){const e=(0,a.useContext)(N);if(e===T)throw new S.dV("DocSidebarItemsExpandedStateProvider");return e}(),M=function(e){void 0===e&&(e=!A),I(e?null:c),C(e)};return function(e){let{isActive:t,collapsed:n,updateCollapsed:o}=e;const i=(0,S.ZC)(t);(0,a.useEffect)((()=>{t&&!i&&n&&o(!1)}),[t,i,n,o])}({isActive:_,collapsed:A,updateCollapsed:M}),(0,a.useEffect)((()=>{h&&null!=k&&k!==c&&f&&C(!0)}),[h,k,c,C,f]),(0,b.jsxs)("li",{className:(0,o.A)(s.G.docs.docSidebarItemCategory,s.G.docs.docSidebarItemCategoryLevel(r),"menu__list-item",{"menu__list-item--collapsed":A},p),children:[(0,b.jsxs)("div",{className:(0,o.A)("menu__list-item-collapsible",{"menu__list-item-collapsible--active":g}),children:[(0,b.jsx)(w.A,{className:(0,o.A)("menu__link",{"menu__link--sublist":h,"menu__link--sublist-caret":!x&&h,"menu__link--active":_}),onClick:h?e=>{n?.(t),x?M(!1):(e.preventDefault(),M())}:()=>{n?.(t)},"aria-current":g?"page":void 0,role:h&&!x?"button":void 0,"aria-expanded":h&&!x?!A:void 0,href:h?v??"#":v,...d,children:m}),x&&h&&(0,b.jsx)(E,{collapsed:A,categoryLabel:m,onClick:e=>{e.preventDefault(),M()}})]}),(0,b.jsx)(y.N,{lazy:!0,as:"ul",className:"menu__list",collapsed:A,children:(0,b.jsx)(V,{items:u,tabIndex:A?-1:0,onItemClick:n,activePath:i,level:r+1})})]})}var H=n(877),G=n(716);const P="menuExternalLink_NmtK";function R(e){let{item:t,onItemClick:n,activePath:a,level:i,index:r,...c}=e;const{href:d,label:u,className:m,autoAddBaseUrl:h}=t,p=(0,l.w8)(t,a),x=(0,H.A)(d);return(0,b.jsx)("li",{className:(0,o.A)(s.G.docs.docSidebarItemLink,s.G.docs.docSidebarItemLinkLevel(i),"menu__list-item",m),children:(0,b.jsxs)(w.A,{className:(0,o.A)("menu__link",!x&&P,{"menu__link--active":p}),autoAddBaseUrl:h,"aria-current":p?"page":void 0,to:d,...x&&{onClick:n?()=>n(t):void 0},...c,children:[u,!x&&(0,b.jsx)(G.A,{})]})},u)}const W="menuHtmlItem_M9Kj";function D(e){let{item:t,level:n,index:a}=e;const{value:i,defaultStyle:l,className:r}=t;return(0,b.jsx)("li",{className:(0,o.A)(s.G.docs.docSidebarItemLink,s.G.docs.docSidebarItemLinkLevel(n),l&&[W,"menu__list-item"],r),dangerouslySetInnerHTML:{__html:i}},a)}function F(e){let{item:t,...n}=e;switch(t.type){case"category":return(0,b.jsx)(M,{item:t,...n});case"html":return(0,b.jsx)(D,{item:t,...n});default:return(0,b.jsx)(R,{item:t,...n})}}function U(e){let{items:t,...n}=e;const a=(0,l.Y)(t,n.activePath);return(0,b.jsx)(I,{children:a.map(((e,t)=>(0,b.jsx)(F,{item:e,index:t,...n},t)))})}const V=(0,a.memo)(U),Y="menu_SIkG",K="menuWithAnnouncementBar_GW3s";function z(e){let{path:t,sidebar:n,className:i}=e;const l=function(){const{isActive:e}=(0,k.M)(),[t,n]=(0,a.useState)(e);return(0,d.Mq)((t=>{let{scrollY:a}=t;e&&n(0===a)}),[e]),e&&t}();return(0,b.jsx)("nav",{"aria-label":(0,c.T)({id:"theme.docs.sidebar.navAriaLabel",message:"Docs sidebar",description:"The ARIA label for the sidebar navigation"}),className:(0,o.A)("menu thin-scrollbar",Y,l&&K,i),children:(0,b.jsx)("ul",{className:(0,o.A)(s.G.docs.docSidebarMenu,"menu__list"),children:(0,b.jsx)(V,{items:n,activePath:t,level:1})})})}const q="sidebar_njMd",O="sidebarWithHideableNavbar_wUlq",J="sidebarHidden_VK0M",Q="sidebarLogo_isFc";function X(e){let{path:t,sidebar:n,onCollapse:a,isHidden:i}=e;const{navbar:{hideOnScroll:s},docs:{sidebar:{hideable:l}}}=(0,j.p)();return(0,b.jsxs)("div",{className:(0,o.A)(q,s&&O,i&&J),children:[s&&(0,b.jsx)(v.A,{tabIndex:-1,className:Q}),(0,b.jsx)(z,{path:t,sidebar:n}),l&&(0,b.jsx)(C,{onClick:a})]})}const Z=a.memo(X);var $=n(763),ee=n(1938);const te=e=>{let{sidebar:t,path:n}=e;const a=(0,ee.M)();return(0,b.jsx)("ul",{className:(0,o.A)(s.G.docs.docSidebarMenu,"menu__list"),children:(0,b.jsx)(V,{items:t,activePath:n,onItemClick:e=>{"category"===e.type&&e.href&&a.toggle(),"link"===e.type&&a.toggle()},level:1})})};function ne(e){return(0,b.jsx)($.GX,{component:te,props:e})}const ae=a.memo(ne);function oe(e){const t=(0,f.l)(),n="desktop"===t||"ssr"===t,a="mobile"===t;return(0,b.jsxs)(b.Fragment,{children:[n&&(0,b.jsx)(Z,{...e}),a&&(0,b.jsx)(ae,{...e})]})}const ie={expandButton:"expandButton_TmdG",expandButtonIcon:"expandButtonIcon_i1dp"};function se(e){let{toggleSidebar:t}=e;return(0,b.jsx)("div",{className:ie.expandButton,title:(0,c.T)({id:"theme.docs.sidebar.expandButtonTitle",message:"Expand sidebar",description:"The ARIA label and title attribute for expand button of doc sidebar"}),"aria-label":(0,c.T)({id:"theme.docs.sidebar.expandButtonAriaLabel",message:"Expand sidebar",description:"The ARIA label and title attribute for expand button of doc sidebar"}),tabIndex:0,role:"button",onKeyDown:t,onClick:t,children:(0,b.jsx)(_,{className:ie.expandButtonIcon})})}const le={docSidebarContainer:"docSidebarContainer_YfHR",docSidebarContainerHidden:"docSidebarContainerHidden_DPk8",sidebarViewport:"sidebarViewport_aRkj"};function re(e){let{children:t}=e;const n=(0,r.t)();return(0,b.jsx)(a.Fragment,{children:t},n?.name??"noSidebar")}function ce(e){let{sidebar:t,hiddenSidebarContainer:n,setHiddenSidebarContainer:i}=e;const{pathname:l}=(0,x.zy)(),[r,c]=(0,a.useState)(!1),d=(0,a.useCallback)((()=>{r&&c(!1),!r&&(0,p.O)()&&c(!0),i((e=>!e))}),[i,r]);return(0,b.jsx)("aside",{className:(0,o.A)(s.G.docs.docSidebarContainer,le.docSidebarContainer,n&&le.docSidebarContainerHidden),onTransitionEnd:e=>{e.currentTarget.classList.contains(le.docSidebarContainer)&&n&&c(!0)},children:(0,b.jsx)(re,{children:(0,b.jsxs)("div",{className:(0,o.A)(le.sidebarViewport,r&&le.sidebarViewportHidden),children:[(0,b.jsx)(oe,{sidebar:t,path:l,onCollapse:d,isHidden:r}),r&&(0,b.jsx)(se,{toggleSidebar:d})]})})})}const de={docMainContainer:"docMainContainer_TBSr",docMainContainerEnhanced:"docMainContainerEnhanced_lQrH",docItemWrapperEnhanced:"docItemWrapperEnhanced_JWYK"};function ue(e){let{hiddenSidebarContainer:t,children:n}=e;const a=(0,r.t)();return(0,b.jsx)("main",{className:(0,o.A)(de.docMainContainer,(t||!a)&&de.docMainContainerEnhanced),children:(0,b.jsx)("div",{className:(0,o.A)("container padding-top--md padding-bottom--lg",de.docItemWrapper,t&&de.docItemWrapperEnhanced),children:n})})}const me={docRoot:"docRoot_UBD9",docsWrapper:"docsWrapper_hBAB"};function be(e){let{children:t}=e;const n=(0,r.t)(),[o,i]=(0,a.useState)(!1);return(0,b.jsxs)("div",{className:me.docsWrapper,children:[(0,b.jsx)(h,{}),(0,b.jsxs)("div",{className:me.docRoot,children:[n&&(0,b.jsx)(ce,{sidebar:n.items,hiddenSidebarContainer:o,setHiddenSidebarContainer:i}),(0,b.jsx)(ue,{hiddenSidebarContainer:o,children:t})]})]})}var he=n(3510);function pe(e){const t=(0,l.B5)(e);if(!t)return(0,b.jsx)(he.A,{});const{docElement:n,sidebarName:a,sidebarItems:c}=t;return(0,b.jsx)(i.e3,{className:(0,o.A)(s.G.page.docsDocPage),children:(0,b.jsx)(r.V,{name:a,items:c,children:(0,b.jsx)(be,{children:n})})})}},3510:(e,t,n)=>{n.d(t,{A:()=>l});n(6540);var a=n(4164),o=n(3230),i=n(5225),s=n(4848);function l(e){let{className:t}=e;return(0,s.jsx)("main",{className:(0,a.A)("container margin-vert--xl",t),children:(0,s.jsx)("div",{className:"row",children:(0,s.jsxs)("div",{className:"col col--6 col--offset-3",children:[(0,s.jsx)(i.A,{as:"h1",className:"hero__title",children:(0,s.jsx)(o.A,{id:"theme.NotFound.title",description:"The title of the 404 page",children:"Page Not Found"})}),(0,s.jsx)("p",{children:(0,s.jsx)(o.A,{id:"theme.NotFound.p1",description:"The first paragraph of the 404 page",children:"We could not find what you were looking for."})}),(0,s.jsx)("p",{children:(0,s.jsx)(o.A,{id:"theme.NotFound.p2",description:"The 2nd paragraph of the 404 page",children:"Please contact the owner of the site that linked you to the original URL and let them know their link is broken."})})]})})})}}}]); \ No newline at end of file diff --git a/assets/js/ab324915.7830ce66.js b/assets/js/ab324915.01adaa12.js similarity index 99% rename from assets/js/ab324915.7830ce66.js rename to assets/js/ab324915.01adaa12.js index ab5ff615..5177b0e9 100644 --- a/assets/js/ab324915.7830ce66.js +++ b/assets/js/ab324915.01adaa12.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[6722],{9158:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>r,contentTitle:()=>s,default:()=>d,frontMatter:()=>l,metadata:()=>n,toc:()=>h});var n=o(5958),a=o(4848),i=o(8453);const l={title:"Welcome to Stylable v5",description:"Launching Stylable Version 5",slug:"welcome-to-stylable-v5",authors:[{name:"Barak Igal",title:"Co-creator of Stylable",url:"https://github.com/barak007",image_url:"https://github.com/barak007.png"},{name:"Ido Rosenthal",title:"Co-creator of Stylable",url:"https://twitter.com/idoros",image_url:"https://github.com/idoros.png"},{name:"Tom Raviv",title:"Co-creator of Stylable",url:"https://twitter.com/RavivTom",image_url:"https://github.com/tomrav.png"}],tags:["intro","release"],image:"/img/synthwave-space-logo.png",hide_table_of_contents:!1},s=void 0,r={authorsImageUrls:[void 0,void 0,void 0]},h=[{value:"First time hearing about Stylable?",id:"first-time-hearing-about-stylable",level:2},{value:"What went on behind the scenes?",id:"what-went-on-behind-the-scenes",level:2},{value:"What have we been up to recently?",id:"what-have-we-been-up-to-recently",level:2},{value:"Additional highlights",id:"additional-highlights",level:3},{value:"What's next for Stylable?",id:"whats-next-for-stylable",level:2}];function c(e){const t={a:"a",admonition:"admonition",em:"em",h2:"h2",h3:"h3",li:"li",p:"p",ul:"ul",...(0,i.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.h2,{id:"first-time-hearing-about-stylable",children:"First time hearing about Stylable?"}),"\n",(0,a.jsx)(t.p,{children:"No worries! Stylable is a tool that empowers you to create safe, reusable style APIs for your components. It's a superset of CSS that adds a type system to it, providing type safety, and powerful language capabilities."}),"\n",(0,a.jsxs)(t.p,{children:["Want to learn more? We recently started writing a ",(0,a.jsx)(t.a,{href:"/docs/guides/handbook/intro",children:"new handbook"})," to help get you up to speed, and more content is on its way over the coming weeks."]}),"\n",(0,a.jsx)(t.h2,{id:"what-went-on-behind-the-scenes",children:"What went on behind the scenes?"}),"\n",(0,a.jsx)(t.p,{children:"Over the last couple of years, we focused on developing Stylable internally in Wix, building it into an entire tooling ecosystem."}),"\n",(0,a.jsx)(t.p,{children:"We integrated Stylable across Wix.com, both for internal tools and user-facing components. We stress-tested the project, making sure it meets our requirements. Today, Stylable helps power over 50 million user websites, and is the de facto styling solution for new projects and new user-facing components."}),"\n",(0,a.jsx)(t.h2,{id:"what-have-we-been-up-to-recently",children:"What have we been up to recently?"}),"\n",(0,a.jsxs)(t.p,{children:["We recently released ",(0,a.jsx)(t.a,{href:"https://github.com/wix/stylable/releases/tag/v5.0.0",children:"Stylable v5"}),", and we're excited to share it with the community."]}),"\n",(0,a.jsx)(t.p,{children:"Version 5 includes considerable refactoring and clean up of the Stylable core package to make it more robust, and its programmatic API more accessible."}),"\n",(0,a.jsxs)(t.p,{children:["If you encounter any bugs or issues, please open an issue on our ",(0,a.jsx)(t.a,{href:"https://github.com/wix/stylable/issues",children:"GitHub repository"}),"."]}),"\n",(0,a.jsx)(t.h3,{id:"additional-highlights",children:"Additional highlights"}),"\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsxs)(t.li,{children:["We added a ",(0,a.jsx)(t.a,{href:"https://stylable.io/playground",children:"new playground"})," to help developers learn and experiment with Stylable."]}),"\n",(0,a.jsx)(t.li,{children:"With monorepo projects becoming more and more common, we've made (and continue to make) improvements to how Stylable and our CLI handle them."}),"\n",(0,a.jsx)(t.li,{children:"Lastly, we've been focused on refining and expanding our documentation, adding new guides, refactoring our API reference to a standard format, and improving the overall reading experience."}),"\n"]}),"\n",(0,a.jsx)(t.h2,{id:"whats-next-for-stylable",children:"What's next for Stylable?"}),"\n",(0,a.jsx)(t.p,{children:"Many new features are planned for Stylable, including the expansion of the type system to cover even more of CSS, and to create new integrations for emerging tools and technologies."}),"\n",(0,a.jsx)(t.p,{children:"CSS as a language has been rapidly progressing recently, with functionality increasing as the language expands. We're following the language closely as its specs progress, and we'll focus our efforts so that Stylable continues to offer the best possible experience over CSS at any time."}),"\n",(0,a.jsx)(t.p,{children:"Although it's always been open-source, we feel like this is the time for us to introduce Stylable back to the web development community, and to hopefully show people how Stylable can make their development experience better. In the coming weeks, we'll be expanding our guides, examples, and documentation to make it even easier to onboard new users."}),"\n",(0,a.jsx)(t.admonition,{title:"join the community",type:"tip",children:(0,a.jsxs)(t.p,{children:["Want to be a part of the discussion? See our ongoing development on ",(0,a.jsx)(t.a,{href:"https://github.com/wix/stylable",children:"GitHub"}),", follow us on ",(0,a.jsx)(t.a,{href:"https://twitter.com/stylableio",children:"Twitter"}),", and join the ",(0,a.jsx)(t.a,{href:"https://discord.gg/C5ZhENSbV7",children:"Discord"})," where we're always up for a chat about styling."]})}),"\n",(0,a.jsx)(t.p,{children:"We hope you'll join us on this journey, and we're looking forward to hearing your feedback."}),"\n",(0,a.jsxs)(t.p,{children:["- ",(0,a.jsx)(t.em,{children:"The Stylable team"})]})]})}function d(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,a.jsx)(t,{...e,children:(0,a.jsx)(c,{...e})}):c(e)}},8453:(e,t,o)=>{o.d(t,{R:()=>l,x:()=>s});var n=o(6540);const a={},i=n.createContext(a);function l(e){const t=n.useContext(i);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:l(e.components),n.createElement(i.Provider,{value:t},e.children)}},5958:e=>{e.exports=JSON.parse('{"permalink":"/blog/welcome-to-stylable-v5","editUrl":"https://github.com/wixplosives/stylable.io/edit/master/blog/2022-08-04-welcome-to-stylable-v5.md","source":"@site/blog/2022-08-04-welcome-to-stylable-v5.md","title":"Welcome to Stylable v5","description":"Launching Stylable Version 5","date":"2022-08-04T00:00:00.000Z","tags":[{"inline":true,"label":"intro","permalink":"/blog/tags/intro"},{"inline":true,"label":"release","permalink":"/blog/tags/release"}],"readingTime":2.355,"hasTruncateMarker":true,"authors":[{"name":"Barak Igal","title":"Co-creator of Stylable","url":"https://github.com/barak007","image_url":"https://github.com/barak007.png","imageURL":"https://github.com/barak007.png","socials":{},"key":null,"page":null},{"name":"Ido Rosenthal","title":"Co-creator of Stylable","url":"https://twitter.com/idoros","image_url":"https://github.com/idoros.png","imageURL":"https://github.com/idoros.png","socials":{},"key":null,"page":null},{"name":"Tom Raviv","title":"Co-creator of Stylable","url":"https://twitter.com/RavivTom","image_url":"https://github.com/tomrav.png","imageURL":"https://github.com/tomrav.png","socials":{},"key":null,"page":null}],"frontMatter":{"title":"Welcome to Stylable v5","description":"Launching Stylable Version 5","slug":"welcome-to-stylable-v5","authors":[{"name":"Barak Igal","title":"Co-creator of Stylable","url":"https://github.com/barak007","image_url":"https://github.com/barak007.png","imageURL":"https://github.com/barak007.png"},{"name":"Ido Rosenthal","title":"Co-creator of Stylable","url":"https://twitter.com/idoros","image_url":"https://github.com/idoros.png","imageURL":"https://github.com/idoros.png"},{"name":"Tom Raviv","title":"Co-creator of Stylable","url":"https://twitter.com/RavivTom","image_url":"https://github.com/tomrav.png","imageURL":"https://github.com/tomrav.png"}],"tags":["intro","release"],"image":"/img/synthwave-space-logo.png","hide_table_of_contents":false},"unlisted":false}')}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[6722],{4454:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>r,contentTitle:()=>s,default:()=>d,frontMatter:()=>l,metadata:()=>n,toc:()=>h});var n=o(5958),a=o(4848),i=o(8453);const l={title:"Welcome to Stylable v5",description:"Launching Stylable Version 5",slug:"welcome-to-stylable-v5",authors:[{name:"Barak Igal",title:"Co-creator of Stylable",url:"https://github.com/barak007",image_url:"https://github.com/barak007.png"},{name:"Ido Rosenthal",title:"Co-creator of Stylable",url:"https://twitter.com/idoros",image_url:"https://github.com/idoros.png"},{name:"Tom Raviv",title:"Co-creator of Stylable",url:"https://twitter.com/RavivTom",image_url:"https://github.com/tomrav.png"}],tags:["intro","release"],image:"/img/synthwave-space-logo.png",hide_table_of_contents:!1},s=void 0,r={authorsImageUrls:[void 0,void 0,void 0]},h=[{value:"First time hearing about Stylable?",id:"first-time-hearing-about-stylable",level:2},{value:"What went on behind the scenes?",id:"what-went-on-behind-the-scenes",level:2},{value:"What have we been up to recently?",id:"what-have-we-been-up-to-recently",level:2},{value:"Additional highlights",id:"additional-highlights",level:3},{value:"What's next for Stylable?",id:"whats-next-for-stylable",level:2}];function c(e){const t={a:"a",admonition:"admonition",em:"em",h2:"h2",h3:"h3",li:"li",p:"p",ul:"ul",...(0,i.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.h2,{id:"first-time-hearing-about-stylable",children:"First time hearing about Stylable?"}),"\n",(0,a.jsx)(t.p,{children:"No worries! Stylable is a tool that empowers you to create safe, reusable style APIs for your components. It's a superset of CSS that adds a type system to it, providing type safety, and powerful language capabilities."}),"\n",(0,a.jsxs)(t.p,{children:["Want to learn more? We recently started writing a ",(0,a.jsx)(t.a,{href:"/docs/guides/handbook/intro",children:"new handbook"})," to help get you up to speed, and more content is on its way over the coming weeks."]}),"\n",(0,a.jsx)(t.h2,{id:"what-went-on-behind-the-scenes",children:"What went on behind the scenes?"}),"\n",(0,a.jsx)(t.p,{children:"Over the last couple of years, we focused on developing Stylable internally in Wix, building it into an entire tooling ecosystem."}),"\n",(0,a.jsx)(t.p,{children:"We integrated Stylable across Wix.com, both for internal tools and user-facing components. We stress-tested the project, making sure it meets our requirements. Today, Stylable helps power over 50 million user websites, and is the de facto styling solution for new projects and new user-facing components."}),"\n",(0,a.jsx)(t.h2,{id:"what-have-we-been-up-to-recently",children:"What have we been up to recently?"}),"\n",(0,a.jsxs)(t.p,{children:["We recently released ",(0,a.jsx)(t.a,{href:"https://github.com/wix/stylable/releases/tag/v5.0.0",children:"Stylable v5"}),", and we're excited to share it with the community."]}),"\n",(0,a.jsx)(t.p,{children:"Version 5 includes considerable refactoring and clean up of the Stylable core package to make it more robust, and its programmatic API more accessible."}),"\n",(0,a.jsxs)(t.p,{children:["If you encounter any bugs or issues, please open an issue on our ",(0,a.jsx)(t.a,{href:"https://github.com/wix/stylable/issues",children:"GitHub repository"}),"."]}),"\n",(0,a.jsx)(t.h3,{id:"additional-highlights",children:"Additional highlights"}),"\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsxs)(t.li,{children:["We added a ",(0,a.jsx)(t.a,{href:"https://stylable.io/playground",children:"new playground"})," to help developers learn and experiment with Stylable."]}),"\n",(0,a.jsx)(t.li,{children:"With monorepo projects becoming more and more common, we've made (and continue to make) improvements to how Stylable and our CLI handle them."}),"\n",(0,a.jsx)(t.li,{children:"Lastly, we've been focused on refining and expanding our documentation, adding new guides, refactoring our API reference to a standard format, and improving the overall reading experience."}),"\n"]}),"\n",(0,a.jsx)(t.h2,{id:"whats-next-for-stylable",children:"What's next for Stylable?"}),"\n",(0,a.jsx)(t.p,{children:"Many new features are planned for Stylable, including the expansion of the type system to cover even more of CSS, and to create new integrations for emerging tools and technologies."}),"\n",(0,a.jsx)(t.p,{children:"CSS as a language has been rapidly progressing recently, with functionality increasing as the language expands. We're following the language closely as its specs progress, and we'll focus our efforts so that Stylable continues to offer the best possible experience over CSS at any time."}),"\n",(0,a.jsx)(t.p,{children:"Although it's always been open-source, we feel like this is the time for us to introduce Stylable back to the web development community, and to hopefully show people how Stylable can make their development experience better. In the coming weeks, we'll be expanding our guides, examples, and documentation to make it even easier to onboard new users."}),"\n",(0,a.jsx)(t.admonition,{title:"join the community",type:"tip",children:(0,a.jsxs)(t.p,{children:["Want to be a part of the discussion? See our ongoing development on ",(0,a.jsx)(t.a,{href:"https://github.com/wix/stylable",children:"GitHub"}),", follow us on ",(0,a.jsx)(t.a,{href:"https://twitter.com/stylableio",children:"Twitter"}),", and join the ",(0,a.jsx)(t.a,{href:"https://discord.gg/C5ZhENSbV7",children:"Discord"})," where we're always up for a chat about styling."]})}),"\n",(0,a.jsx)(t.p,{children:"We hope you'll join us on this journey, and we're looking forward to hearing your feedback."}),"\n",(0,a.jsxs)(t.p,{children:["- ",(0,a.jsx)(t.em,{children:"The Stylable team"})]})]})}function d(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,a.jsx)(t,{...e,children:(0,a.jsx)(c,{...e})}):c(e)}},8453:(e,t,o)=>{o.d(t,{R:()=>l,x:()=>s});var n=o(6540);const a={},i=n.createContext(a);function l(e){const t=n.useContext(i);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:l(e.components),n.createElement(i.Provider,{value:t},e.children)}},5958:e=>{e.exports=JSON.parse('{"permalink":"/blog/welcome-to-stylable-v5","editUrl":"https://github.com/wixplosives/stylable.io/edit/master/blog/2022-08-04-welcome-to-stylable-v5.md","source":"@site/blog/2022-08-04-welcome-to-stylable-v5.md","title":"Welcome to Stylable v5","description":"Launching Stylable Version 5","date":"2022-08-04T00:00:00.000Z","tags":[{"inline":true,"label":"intro","permalink":"/blog/tags/intro"},{"inline":true,"label":"release","permalink":"/blog/tags/release"}],"readingTime":2.355,"hasTruncateMarker":true,"authors":[{"name":"Barak Igal","title":"Co-creator of Stylable","url":"https://github.com/barak007","image_url":"https://github.com/barak007.png","imageURL":"https://github.com/barak007.png","socials":{},"key":null,"page":null},{"name":"Ido Rosenthal","title":"Co-creator of Stylable","url":"https://twitter.com/idoros","image_url":"https://github.com/idoros.png","imageURL":"https://github.com/idoros.png","socials":{},"key":null,"page":null},{"name":"Tom Raviv","title":"Co-creator of Stylable","url":"https://twitter.com/RavivTom","image_url":"https://github.com/tomrav.png","imageURL":"https://github.com/tomrav.png","socials":{},"key":null,"page":null}],"frontMatter":{"title":"Welcome to Stylable v5","description":"Launching Stylable Version 5","slug":"welcome-to-stylable-v5","authors":[{"name":"Barak Igal","title":"Co-creator of Stylable","url":"https://github.com/barak007","image_url":"https://github.com/barak007.png","imageURL":"https://github.com/barak007.png"},{"name":"Ido Rosenthal","title":"Co-creator of Stylable","url":"https://twitter.com/idoros","image_url":"https://github.com/idoros.png","imageURL":"https://github.com/idoros.png"},{"name":"Tom Raviv","title":"Co-creator of Stylable","url":"https://twitter.com/RavivTom","image_url":"https://github.com/tomrav.png","imageURL":"https://github.com/tomrav.png"}],"tags":["intro","release"],"image":"/img/synthwave-space-logo.png","hide_table_of_contents":false},"unlisted":false}')}}]); \ No newline at end of file diff --git a/assets/js/acfb8e34.3ef422bc.js b/assets/js/acfb8e34.2406a350.js similarity index 77% rename from assets/js/acfb8e34.3ef422bc.js rename to assets/js/acfb8e34.2406a350.js index ca92e80d..8b0de1e6 100644 --- a/assets/js/acfb8e34.3ef422bc.js +++ b/assets/js/acfb8e34.2406a350.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[6223],{6543:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>a,contentTitle:()=>o,default:()=>u,frontMatter:()=>c,metadata:()=>r,toc:()=>h});const r=JSON.parse('{"id":"getting-started/tooling/cli","title":"CLI","description":"@stylable/cli is a low-level utility used for working with Stylable projects directly.","source":"@site/docs/getting-started/tooling/cli.mdx","sourceDirName":"getting-started/tooling","slug":"/getting-started/tooling/cli","permalink":"/docs/getting-started/tooling/cli","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/getting-started/tooling/cli.mdx","tags":[],"version":"current","frontMatter":{"id":"cli","title":"CLI"},"sidebar":"Discover","previous":{"title":"VSCode Extension","permalink":"/docs/getting-started/tooling/stylable-intelligence"},"next":{"title":"Integrations","permalink":"/docs/getting-started/integrations"}}');var n=s(4848),l=s(8453),d=s(9489),i=s(7227);const c={id:"cli",title:"CLI"},o=void 0,a={},h=[{value:"Installation",id:"installation",level:2},{value:"Using the CLI",id:"using-the-cli",level:2},{value:"CLI Arguments",id:"cli-arguments",level:3},{value:"Generating an index file",id:"generating-an-index-file",level:2},{value:"Control exposed API",id:"control-exposed-api",level:3}];function x(e){const t={a:"a",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,l.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(t.p,{children:[(0,n.jsx)(t.code,{children:"@stylable/cli"})," is a low-level utility used for working with Stylable projects directly."]}),"\n",(0,n.jsx)(t.p,{children:"It lets you:"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsx)(t.li,{children:"Build and transform stylesheets into JavaScript modules"}),"\n",(0,n.jsx)(t.li,{children:"Generate an entry index file to help consume a published project"}),"\n"]}),"\n",(0,n.jsx)(t.h2,{id:"installation",children:"Installation"}),"\n","\n",(0,n.jsxs)(d.A,{groupId:"packageManager",children:[(0,n.jsx)(i.A,{value:"npm",label:"NPM",default:!0,children:(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-bash",children:"npm install @stylable/cli --save-dev\n"})})}),(0,n.jsx)(i.A,{value:"yarn",label:"Yarn",children:(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-bash",children:"yarn add @stylable/cli -D\n"})})})]}),"\n","\n",(0,n.jsx)(t.h2,{id:"using-the-cli",children:"Using the CLI"}),"\n",(0,n.jsxs)(t.p,{children:["After installing ",(0,n.jsx)(t.code,{children:"@stylable/cli"}),", the ",(0,n.jsx)(t.code,{children:"stc"})," command will be available, running ",(0,n.jsx)(t.code,{children:"stc --help"})," will provide a brief description for the options available."]}),"\n",(0,n.jsxs)(t.p,{children:[(0,n.jsx)(t.code,{children:"stc"})," accepts CLI arguments or a ",(0,n.jsx)(t.a,{href:"../stylable-config",children:"Stylable configuration file"}),"."]}),"\n",(0,n.jsx)(t.h3,{id:"cli-arguments",children:"CLI Arguments"}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{children:"Option"}),(0,n.jsx)(t.th,{children:"Alias"}),(0,n.jsx)(t.th,{children:"Description"}),(0,n.jsx)(t.th,{children:"Default Value"})]})}),(0,n.jsxs)(t.tbody,{children:[(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--version"})}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"v"})}),(0,n.jsx)(t.td,{children:"show CLI version number"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"boolean"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--rootDir"})}),(0,n.jsx)(t.td,{}),(0,n.jsx)(t.td,{children:"root directory of project"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"cwd"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--srcDir"})}),(0,n.jsx)(t.td,{}),(0,n.jsx)(t.td,{children:"source directory relative to root"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"./"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--outDir"})}),(0,n.jsx)(t.td,{}),(0,n.jsx)(t.td,{children:"target directory relative to root"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"./"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--indexFile"})}),(0,n.jsx)(t.td,{}),(0,n.jsx)(t.td,{children:"filename of the generated index"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"false"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--cjs"})}),(0,n.jsx)(t.td,{}),(0,n.jsxs)(t.td,{children:["output commonjs modules (",(0,n.jsx)(t.code,{children:".js"}),")"]}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"false"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--esm"})}),(0,n.jsx)(t.td,{}),(0,n.jsxs)(t.td,{children:["output esm modules (",(0,n.jsx)(t.code,{children:".mjs"}),")"]}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"false"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--css"})}),(0,n.jsx)(t.td,{}),(0,n.jsxs)(t.td,{children:["output transpiled css files (",(0,n.jsx)(t.code,{children:".css"}),")"]}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"false"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--stcss"})}),(0,n.jsx)(t.td,{}),(0,n.jsxs)(t.td,{children:["output stylable source files (",(0,n.jsx)(t.code,{children:".st.css"}),")"]}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"false"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--dts"})}),(0,n.jsx)(t.td,{}),(0,n.jsxs)(t.td,{children:["output definition files for the stylable source files (",(0,n.jsx)(t.code,{children:".st.css.d.ts"}),")"]}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"false"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--dtsSourceMap"})}),(0,n.jsx)(t.td,{}),(0,n.jsxs)(t.td,{children:["output source-maps for the definitions of stylable source files (",(0,n.jsx)(t.code,{children:".st.css.d.ts.map"}),")"]}),(0,n.jsxs)(t.td,{children:[(0,n.jsx)(t.code,{children:"true"})," if ",(0,n.jsx)(t.code,{children:"--dts"})," is true, otherwise ",(0,n.jsx)(t.code,{children:"false"})]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--watch"})}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"w"})}),(0,n.jsx)(t.td,{children:"enable watch mode"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"false"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--config"})}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"c"})}),(0,n.jsx)(t.td,{children:"The path to a config file specifying how to build and output Stylable stylesheets"}),(0,n.jsx)(t.td,{children:'The directory containing the config file is assumed to be the "rootDir" for the project named "stylable.config.js"'})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--useNamespaceReference"})}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"unsr"})}),(0,n.jsx)(t.td,{children:"mark output stylable source files with relative path for namespacing purposes (*)"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"false"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--customGenerator"})}),(0,n.jsx)(t.td,{}),(0,n.jsx)(t.td,{children:"path of a custom index file generator"}),(0,n.jsx)(t.td,{children:"-"})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--ext"})}),(0,n.jsx)(t.td,{}),(0,n.jsx)(t.td,{children:"extension of stylable css files"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:".st.css"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--cssInJs"})}),(0,n.jsx)(t.td,{}),(0,n.jsx)(t.td,{children:"output transpiled css into the js module"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"false"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--cssFilename"})}),(0,n.jsx)(t.td,{}),(0,n.jsx)(t.td,{children:"pattern of the generated css file"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"[filename].css"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--injectCSSRequest"})}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"icr"})}),(0,n.jsx)(t.td,{children:"add a static import for the generated css in the js module output"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"false"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--namespaceResolver"})}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"nsr"})}),(0,n.jsx)(t.td,{children:"node request to a module that exports a stylable resolveNamespace function"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"@stylable/node"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--require"})}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"r"})}),(0,n.jsx)(t.td,{children:"require hook to execute before running"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"-"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--optimize"})}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"o"})}),(0,n.jsx)(t.td,{children:"removes: empty nodes, stylable directives, comments"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"false"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--minify"})}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"m"})}),(0,n.jsx)(t.td,{children:"minify generated css"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"false"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--log"})}),(0,n.jsx)(t.td,{}),(0,n.jsx)(t.td,{children:"verbose log"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"false"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--diagnostics"})}),(0,n.jsx)(t.td,{}),(0,n.jsx)(t.td,{children:"print verbose diagnostics"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"true"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--diagnosticsMode"})}),(0,n.jsx)(t.td,{}),(0,n.jsx)(t.td,{children:"determine the diagnostics mode. if strict process will exit on any exception, loose will attempt to finish the process regardless of exceptions"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"false"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--help"})}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"h"})}),(0,n.jsx)(t.td,{children:"Show help"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"boolean"})})]})]})]}),"\n",(0,n.jsx)(t.h2,{id:"generating-an-index-file",children:"Generating an index file"}),"\n",(0,n.jsxs)(t.p,{children:["To automatically generate an index file that acts as an export entry for stylable API from your project, use the ",(0,n.jsx)(t.code,{children:"--inedexFile"})," flag:"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-bash",children:'stc --srcDir="./src" --outDir="./dist" --indexFile="index.st.css"\n'})}),"\n",(0,n.jsx)(t.h3,{id:"control-exposed-api",children:"Control exposed API"}),"\n",(0,n.jsxs)(t.p,{children:["Exporting a ",(0,n.jsx)(t.code,{children:"Generator"})," named export class from a JavaScript file will allow it to be used as a customGenerator."]}),"\n",(0,n.jsx)(t.p,{children:"Usually this generator will inherit from our base generator class and override the generateReExports and generateIndexSource methods."}),"\n",(0,n.jsx)(t.p,{children:"This example demonstrates the default generator behavior (only exports stylesheet roots):"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-js",children:"import { Generator as Base, ReExports } from '@stylable/cli';\n\nexport class Generator extends Base {\n public generateReExports(filePath): ReExports {\n return {\n root: this.filename2varname(filePath),\n parts: {},\n keyframes: {},\n stVars: {},\n vars: {},\n };\n }\n protected generateIndexSource(indexFileTargetPath: string) {\n const source = super.generateIndexSource(indexFileTargetPath);\n return '@st-namespace \"INDEX\";\\n' + source;\n }\n}\n"})})]})}function u(e={}){const{wrapper:t}={...(0,l.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(x,{...e})}):x(e)}},7227:(e,t,s)=>{s.d(t,{A:()=>d});s(6540);var r=s(4164);const n={tabItem:"tabItem_Ymn6"};var l=s(4848);function d(e){let{children:t,hidden:s,className:d}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,r.A)(n.tabItem,d),hidden:s,children:t})}},9489:(e,t,s)=>{s.d(t,{A:()=>w});var r=s(6540),n=s(4164),l=s(4245),d=s(6347),i=s(6494),c=s(2814),o=s(5167),a=s(9900);function h(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function x(e){const{values:t,children:s}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return h(e).map((e=>{let{props:{value:t,label:s,attributes:r,default:n}}=e;return{value:t,label:s,attributes:r,default:n}}))}(s);return function(e){const t=(0,o.XI)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,s])}function u(e){let{value:t,tabValues:s}=e;return s.some((e=>e.value===t))}function j(e){let{queryString:t=!1,groupId:s}=e;const n=(0,d.W6)(),l=function(e){let{queryString:t=!1,groupId:s}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:t,groupId:s});return[(0,c.aZ)(l),(0,r.useCallback)((e=>{if(!l)return;const t=new URLSearchParams(n.location.search);t.set(l,e),n.replace({...n.location,search:t.toString()})}),[l,n])]}function p(e){const{defaultValue:t,queryString:s=!1,groupId:n}=e,l=x(e),[d,c]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!u({value:t,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=s.find((e=>e.default))??s[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:l}))),[o,h]=j({queryString:s,groupId:n}),[p,f]=function(e){let{groupId:t}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(t),[n,l]=(0,a.Dv)(s);return[n,(0,r.useCallback)((e=>{s&&l.set(e)}),[s,l])]}({groupId:n}),m=(()=>{const e=o??p;return u({value:e,tabValues:l})?e:null})();(0,i.A)((()=>{m&&c(m)}),[m]);return{selectedValue:d,selectValue:(0,r.useCallback)((e=>{if(!u({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);c(e),h(e),f(e)}),[h,f,l]),tabValues:l}}var f=s(1062);const m={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var g=s(4848);function b(e){let{className:t,block:s,selectedValue:r,selectValue:d,tabValues:i}=e;const c=[],{blockElementScrollPositionUntilNextRender:o}=(0,l.a_)(),a=e=>{const t=e.currentTarget,s=c.indexOf(t),n=i[s].value;n!==r&&(o(t),d(n))},h=e=>{let t=null;switch(e.key){case"Enter":a(e);break;case"ArrowRight":{const s=c.indexOf(e.currentTarget)+1;t=c[s]??c[0];break}case"ArrowLeft":{const s=c.indexOf(e.currentTarget)-1;t=c[s]??c[c.length-1];break}}t?.focus()};return(0,g.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,n.A)("tabs",{"tabs--block":s},t),children:i.map((e=>{let{value:t,label:s,attributes:l}=e;return(0,g.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>c.push(e),onKeyDown:h,onClick:a,...l,className:(0,n.A)("tabs__item",m.tabItem,l?.className,{"tabs__item--active":r===t}),children:s??t},t)}))})}function v(e){let{lazy:t,children:s,selectedValue:l}=e;const d=(Array.isArray(s)?s:[s]).filter(Boolean);if(t){const e=d.find((e=>e.props.value===l));return e?(0,r.cloneElement)(e,{className:(0,n.A)("margin-top--md",e.props.className)}):null}return(0,g.jsx)("div",{className:"margin-top--md",children:d.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==l})))})}function y(e){const t=p(e);return(0,g.jsxs)("div",{className:(0,n.A)("tabs-container",m.tabList),children:[(0,g.jsx)(b,{...t,...e}),(0,g.jsx)(v,{...t,...e})]})}function w(e){const t=(0,f.A)();return(0,g.jsx)(y,{...e,children:h(e.children)},String(t))}},8453:(e,t,s)=>{s.d(t,{R:()=>d,x:()=>i});var r=s(6540);const n={},l=r.createContext(n);function d(e){const t=r.useContext(l);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function i(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:d(e.components),r.createElement(l.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[6223],{5140:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>a,contentTitle:()=>o,default:()=>u,frontMatter:()=>c,metadata:()=>r,toc:()=>h});const r=JSON.parse('{"id":"getting-started/tooling/cli","title":"CLI","description":"@stylable/cli is a low-level utility used for working with Stylable projects directly.","source":"@site/docs/getting-started/tooling/cli.mdx","sourceDirName":"getting-started/tooling","slug":"/getting-started/tooling/cli","permalink":"/docs/getting-started/tooling/cli","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/getting-started/tooling/cli.mdx","tags":[],"version":"current","frontMatter":{"id":"cli","title":"CLI"},"sidebar":"Discover","previous":{"title":"VSCode Extension","permalink":"/docs/getting-started/tooling/stylable-intelligence"},"next":{"title":"Integrations","permalink":"/docs/getting-started/integrations"}}');var n=s(4848),l=s(8453),d=s(1470),i=s(9365);const c={id:"cli",title:"CLI"},o=void 0,a={},h=[{value:"Installation",id:"installation",level:2},{value:"Using the CLI",id:"using-the-cli",level:2},{value:"CLI Arguments",id:"cli-arguments",level:3},{value:"Generating an index file",id:"generating-an-index-file",level:2},{value:"Control exposed API",id:"control-exposed-api",level:3}];function x(e){const t={a:"a",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,l.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(t.p,{children:[(0,n.jsx)(t.code,{children:"@stylable/cli"})," is a low-level utility used for working with Stylable projects directly."]}),"\n",(0,n.jsx)(t.p,{children:"It lets you:"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsx)(t.li,{children:"Build and transform stylesheets into JavaScript modules"}),"\n",(0,n.jsx)(t.li,{children:"Generate an entry index file to help consume a published project"}),"\n"]}),"\n",(0,n.jsx)(t.h2,{id:"installation",children:"Installation"}),"\n","\n",(0,n.jsxs)(d.A,{groupId:"packageManager",children:[(0,n.jsx)(i.A,{value:"npm",label:"NPM",default:!0,children:(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-bash",children:"npm install @stylable/cli --save-dev\n"})})}),(0,n.jsx)(i.A,{value:"yarn",label:"Yarn",children:(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-bash",children:"yarn add @stylable/cli -D\n"})})})]}),"\n","\n",(0,n.jsx)(t.h2,{id:"using-the-cli",children:"Using the CLI"}),"\n",(0,n.jsxs)(t.p,{children:["After installing ",(0,n.jsx)(t.code,{children:"@stylable/cli"}),", the ",(0,n.jsx)(t.code,{children:"stc"})," command will be available, running ",(0,n.jsx)(t.code,{children:"stc --help"})," will provide a brief description for the options available."]}),"\n",(0,n.jsxs)(t.p,{children:[(0,n.jsx)(t.code,{children:"stc"})," accepts CLI arguments or a ",(0,n.jsx)(t.a,{href:"../stylable-config",children:"Stylable configuration file"}),"."]}),"\n",(0,n.jsx)(t.h3,{id:"cli-arguments",children:"CLI Arguments"}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{children:"Option"}),(0,n.jsx)(t.th,{children:"Alias"}),(0,n.jsx)(t.th,{children:"Description"}),(0,n.jsx)(t.th,{children:"Default Value"})]})}),(0,n.jsxs)(t.tbody,{children:[(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--version"})}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"v"})}),(0,n.jsx)(t.td,{children:"show CLI version number"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"boolean"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--rootDir"})}),(0,n.jsx)(t.td,{}),(0,n.jsx)(t.td,{children:"root directory of project"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"cwd"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--srcDir"})}),(0,n.jsx)(t.td,{}),(0,n.jsx)(t.td,{children:"source directory relative to root"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"./"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--outDir"})}),(0,n.jsx)(t.td,{}),(0,n.jsx)(t.td,{children:"target directory relative to root"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"./"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--indexFile"})}),(0,n.jsx)(t.td,{}),(0,n.jsx)(t.td,{children:"filename of the generated index"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"false"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--cjs"})}),(0,n.jsx)(t.td,{}),(0,n.jsxs)(t.td,{children:["output commonjs modules (",(0,n.jsx)(t.code,{children:".js"}),")"]}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"false"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--esm"})}),(0,n.jsx)(t.td,{}),(0,n.jsxs)(t.td,{children:["output esm modules (",(0,n.jsx)(t.code,{children:".mjs"}),")"]}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"false"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--css"})}),(0,n.jsx)(t.td,{}),(0,n.jsxs)(t.td,{children:["output transpiled css files (",(0,n.jsx)(t.code,{children:".css"}),")"]}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"false"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--stcss"})}),(0,n.jsx)(t.td,{}),(0,n.jsxs)(t.td,{children:["output stylable source files (",(0,n.jsx)(t.code,{children:".st.css"}),")"]}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"false"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--dts"})}),(0,n.jsx)(t.td,{}),(0,n.jsxs)(t.td,{children:["output definition files for the stylable source files (",(0,n.jsx)(t.code,{children:".st.css.d.ts"}),")"]}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"false"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--dtsSourceMap"})}),(0,n.jsx)(t.td,{}),(0,n.jsxs)(t.td,{children:["output source-maps for the definitions of stylable source files (",(0,n.jsx)(t.code,{children:".st.css.d.ts.map"}),")"]}),(0,n.jsxs)(t.td,{children:[(0,n.jsx)(t.code,{children:"true"})," if ",(0,n.jsx)(t.code,{children:"--dts"})," is true, otherwise ",(0,n.jsx)(t.code,{children:"false"})]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--watch"})}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"w"})}),(0,n.jsx)(t.td,{children:"enable watch mode"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"false"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--config"})}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"c"})}),(0,n.jsx)(t.td,{children:"The path to a config file specifying how to build and output Stylable stylesheets"}),(0,n.jsx)(t.td,{children:'The directory containing the config file is assumed to be the "rootDir" for the project named "stylable.config.js"'})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--useNamespaceReference"})}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"unsr"})}),(0,n.jsx)(t.td,{children:"mark output stylable source files with relative path for namespacing purposes (*)"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"false"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--customGenerator"})}),(0,n.jsx)(t.td,{}),(0,n.jsx)(t.td,{children:"path of a custom index file generator"}),(0,n.jsx)(t.td,{children:"-"})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--ext"})}),(0,n.jsx)(t.td,{}),(0,n.jsx)(t.td,{children:"extension of stylable css files"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:".st.css"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--cssInJs"})}),(0,n.jsx)(t.td,{}),(0,n.jsx)(t.td,{children:"output transpiled css into the js module"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"false"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--cssFilename"})}),(0,n.jsx)(t.td,{}),(0,n.jsx)(t.td,{children:"pattern of the generated css file"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"[filename].css"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--injectCSSRequest"})}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"icr"})}),(0,n.jsx)(t.td,{children:"add a static import for the generated css in the js module output"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"false"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--namespaceResolver"})}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"nsr"})}),(0,n.jsx)(t.td,{children:"node request to a module that exports a stylable resolveNamespace function"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"@stylable/node"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--require"})}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"r"})}),(0,n.jsx)(t.td,{children:"require hook to execute before running"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"-"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--optimize"})}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"o"})}),(0,n.jsx)(t.td,{children:"removes: empty nodes, stylable directives, comments"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"false"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--minify"})}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"m"})}),(0,n.jsx)(t.td,{children:"minify generated css"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"false"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--log"})}),(0,n.jsx)(t.td,{}),(0,n.jsx)(t.td,{children:"verbose log"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"false"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--diagnostics"})}),(0,n.jsx)(t.td,{}),(0,n.jsx)(t.td,{children:"print verbose diagnostics"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"true"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--diagnosticsMode"})}),(0,n.jsx)(t.td,{}),(0,n.jsx)(t.td,{children:"determine the diagnostics mode. if strict process will exit on any exception, loose will attempt to finish the process regardless of exceptions"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"false"})})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"--help"})}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"h"})}),(0,n.jsx)(t.td,{children:"Show help"}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.code,{children:"boolean"})})]})]})]}),"\n",(0,n.jsx)(t.h2,{id:"generating-an-index-file",children:"Generating an index file"}),"\n",(0,n.jsxs)(t.p,{children:["To automatically generate an index file that acts as an export entry for stylable API from your project, use the ",(0,n.jsx)(t.code,{children:"--inedexFile"})," flag:"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-bash",children:'stc --srcDir="./src" --outDir="./dist" --indexFile="index.st.css"\n'})}),"\n",(0,n.jsx)(t.h3,{id:"control-exposed-api",children:"Control exposed API"}),"\n",(0,n.jsxs)(t.p,{children:["Exporting a ",(0,n.jsx)(t.code,{children:"Generator"})," named export class from a JavaScript file will allow it to be used as a customGenerator."]}),"\n",(0,n.jsx)(t.p,{children:"Usually this generator will inherit from our base generator class and override the generateReExports and generateIndexSource methods."}),"\n",(0,n.jsx)(t.p,{children:"This example demonstrates the default generator behavior (only exports stylesheet roots):"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-js",children:"import { Generator as Base, ReExports } from '@stylable/cli';\n\nexport class Generator extends Base {\n public generateReExports(filePath): ReExports {\n return {\n root: this.filename2varname(filePath),\n parts: {},\n keyframes: {},\n stVars: {},\n vars: {},\n };\n }\n protected generateIndexSource(indexFileTargetPath: string) {\n const source = super.generateIndexSource(indexFileTargetPath);\n return '@st-namespace \"INDEX\";\\n' + source;\n }\n}\n"})})]})}function u(e={}){const{wrapper:t}={...(0,l.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(x,{...e})}):x(e)}},9365:(e,t,s)=>{s.d(t,{A:()=>d});s(6540);var r=s(4164);const n={tabItem:"tabItem_Ymn6"};var l=s(4848);function d(e){let{children:t,hidden:s,className:d}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,r.A)(n.tabItem,d),hidden:s,children:t})}},1470:(e,t,s)=>{s.d(t,{A:()=>w});var r=s(6540),n=s(4164),l=s(3104),d=s(6347),i=s(205),c=s(7485),o=s(1682),a=s(679);function h(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function x(e){const{values:t,children:s}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return h(e).map((e=>{let{props:{value:t,label:s,attributes:r,default:n}}=e;return{value:t,label:s,attributes:r,default:n}}))}(s);return function(e){const t=(0,o.XI)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,s])}function u(e){let{value:t,tabValues:s}=e;return s.some((e=>e.value===t))}function j(e){let{queryString:t=!1,groupId:s}=e;const n=(0,d.W6)(),l=function(e){let{queryString:t=!1,groupId:s}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!s)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:t,groupId:s});return[(0,c.aZ)(l),(0,r.useCallback)((e=>{if(!l)return;const t=new URLSearchParams(n.location.search);t.set(l,e),n.replace({...n.location,search:t.toString()})}),[l,n])]}function p(e){const{defaultValue:t,queryString:s=!1,groupId:n}=e,l=x(e),[d,c]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:s}=e;if(0===s.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!u({value:t,tabValues:s}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${s.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=s.find((e=>e.default))??s[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:l}))),[o,h]=j({queryString:s,groupId:n}),[p,f]=function(e){let{groupId:t}=e;const s=function(e){return e?`docusaurus.tab.${e}`:null}(t),[n,l]=(0,a.Dv)(s);return[n,(0,r.useCallback)((e=>{s&&l.set(e)}),[s,l])]}({groupId:n}),m=(()=>{const e=o??p;return u({value:e,tabValues:l})?e:null})();(0,i.A)((()=>{m&&c(m)}),[m]);return{selectedValue:d,selectValue:(0,r.useCallback)((e=>{if(!u({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);c(e),h(e),f(e)}),[h,f,l]),tabValues:l}}var f=s(2303);const m={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var g=s(4848);function b(e){let{className:t,block:s,selectedValue:r,selectValue:d,tabValues:i}=e;const c=[],{blockElementScrollPositionUntilNextRender:o}=(0,l.a_)(),a=e=>{const t=e.currentTarget,s=c.indexOf(t),n=i[s].value;n!==r&&(o(t),d(n))},h=e=>{let t=null;switch(e.key){case"Enter":a(e);break;case"ArrowRight":{const s=c.indexOf(e.currentTarget)+1;t=c[s]??c[0];break}case"ArrowLeft":{const s=c.indexOf(e.currentTarget)-1;t=c[s]??c[c.length-1];break}}t?.focus()};return(0,g.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,n.A)("tabs",{"tabs--block":s},t),children:i.map((e=>{let{value:t,label:s,attributes:l}=e;return(0,g.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>{c.push(e)},onKeyDown:h,onClick:a,...l,className:(0,n.A)("tabs__item",m.tabItem,l?.className,{"tabs__item--active":r===t}),children:s??t},t)}))})}function v(e){let{lazy:t,children:s,selectedValue:l}=e;const d=(Array.isArray(s)?s:[s]).filter(Boolean);if(t){const e=d.find((e=>e.props.value===l));return e?(0,r.cloneElement)(e,{className:(0,n.A)("margin-top--md",e.props.className)}):null}return(0,g.jsx)("div",{className:"margin-top--md",children:d.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==l})))})}function y(e){const t=p(e);return(0,g.jsxs)("div",{className:(0,n.A)("tabs-container",m.tabList),children:[(0,g.jsx)(b,{...t,...e}),(0,g.jsx)(v,{...t,...e})]})}function w(e){const t=(0,f.A)();return(0,g.jsx)(y,{...e,children:h(e.children)},String(t))}},8453:(e,t,s)=>{s.d(t,{R:()=>d,x:()=>i});var r=s(6540);const n={},l=r.createContext(n);function d(e){const t=r.useContext(l);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function i(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:d(e.components),r.createElement(l.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/b10d9af9.80dcd13f.js b/assets/js/b10d9af9.c04616ab.js similarity index 99% rename from assets/js/b10d9af9.80dcd13f.js rename to assets/js/b10d9af9.c04616ab.js index 1e659fde..874951c0 100644 --- a/assets/js/b10d9af9.80dcd13f.js +++ b/assets/js/b10d9af9.c04616ab.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[9849],{9928:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>d,contentTitle:()=>r,default:()=>h,frontMatter:()=>o,metadata:()=>n,toc:()=>c});const n=JSON.parse('{"id":"guides/handbook/custom-state","title":"Custom State","description":"In CSS, we have the ability to target native states of various elements using the pseudo-class syntax (for instance,active).","source":"@site/docs/guides/handbook/state.md","sourceDirName":"guides/handbook","slug":"/guides/handbook/custom-state","permalink":"/docs/guides/handbook/custom-state","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/guides/handbook/state.md","tags":[],"version":"current","frontMatter":{"id":"custom-state","title":"Custom State"},"sidebar":"Guides","previous":{"title":"Namespacing","permalink":"/docs/guides/handbook/namespacing"},"next":{"title":"Runtime","permalink":"/docs/guides/handbook/runtime"}}');var a=s(4848),i=s(8453);const o={id:"custom-state",title:"Custom State"},r=void 0,d={},c=[{value:"Define and target",id:"define-and-target",level:2},{value:"Runtime toggle",id:"runtime-toggle",level:2}];function l(e){const t={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",p:"p",pre:"pre",strong:"strong",...(0,i.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(t.p,{children:["In CSS, we have the ability to target native states of various elements using the ",(0,a.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes",children:(0,a.jsx)(t.code,{children:"pseudo-class"})})," syntax (for instance, ",(0,a.jsx)(t.code,{children:":hover"})," or ",(0,a.jsx)(t.code,{children:":active"}),")."]}),"\n",(0,a.jsxs)(t.p,{children:["While this is very handy, as of today, CSS does not provide a way for us to define a custom state on every element. For example, we might want a ",(0,a.jsx)(t.code,{children:"registered"})," custom state to represent a player element that has signed up for our game."]}),"\n",(0,a.jsxs)(t.p,{children:["We could choose to implement such a state manually by using a class selector (e.g. using a ",(0,a.jsx)(t.a,{href:"http://getbem.com/naming/#modifier:~:text=block__elem%20%7B%20color%3A%20%23042%3B%20%7D-,Modifier,-Flags%20on%20blocks",children:"BEM modifier"}),": ",(0,a.jsx)(t.code,{children:".NAMESPACE--registered"}),") or attribute selector (e.g. ",(0,a.jsx)(t.code,{children:"[data-NAMESPACE-registered]"}),")."]}),"\n",(0,a.jsx)(t.p,{children:"This is a bit of a pain for several reasons. Unlike native pseudo-classes, a class or an attribute selector is not semantic, and so we lose the original intent. If a convention like BEM is used, then the semantics are conserved, but it increases the verbosity of our code."}),"\n",(0,a.jsx)(t.p,{children:"By defining our states through Stylable, we gain the benefit of validations, completions, and a consistent syntax for states."}),"\n",(0,a.jsx)(t.h2,{id:"define-and-target",children:"Define and target"}),"\n",(0,a.jsxs)(t.p,{children:["To define a registered state for our ",(0,a.jsx)(t.code,{children:"player"})," class, we will use the ",(0,a.jsx)(t.code,{children:"-st-states"})," declaration, and pass it a single state name of ",(0,a.jsx)(t.code,{children:"registered"}),"."]}),"\n",(0,a.jsxs)(t.p,{children:["We can then target this state using our newly-defined ",(0,a.jsx)(t.code,{children:":registered"})," pseudo-class, knowing it will be transformed to a valid, safe selector at build time."]}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-css",metastring:'title="game.st.css"',children:".player {\n -st-states: registered; /* definition */\n}\n.player:registered {} /* usage */\n\n/* OUTPUT - namespace class and state */\n.game__player {}\n.game__player.game--registered {}\n"})}),"\n",(0,a.jsxs)(t.p,{children:["In the example above, we defined a ",(0,a.jsx)(t.code,{children:"registered"})," boolean state that can either be targeted, or not. Let's imagine, though, that in addition to the ",(0,a.jsx)(t.code,{children:"registered"})," state, we now want to highlight ",(0,a.jsx)(t.code,{children:"first"}),", ",(0,a.jsx)(t.code,{children:"second"}),", and ",(0,a.jsx)(t.code,{children:"third"})," ranking players."]}),"\n",(0,a.jsxs)(t.p,{children:["We can define such a state by passing the ",(0,a.jsx)(t.code,{children:"enum"})," parameter type to the ",(0,a.jsx)(t.code,{children:"ranking"})," state definition, and in it, list our possible options."]}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-css",metastring:'title="game.st.css"',children:".player {\n -st-states: registered, \n ranking(enum(first, second, third)); \n}\n\n.player:ranking(first) {} \n.player:ranking(second) {} \n.player:ranking(third) {} \n"})}),"\n",(0,a.jsxs)(t.p,{children:["There are additional parameter types, as well as validators, default values, and mapping capabilities to Stylable custom states. ",(0,a.jsx)(t.a,{href:"/docs/references/pseudo-classes",children:"Read more in the API reference"}),"."]}),"\n",(0,a.jsxs)(t.admonition,{title:"Conflicts with native",type:"caution",children:[(0,a.jsxs)(t.p,{children:['At this point, you may have noticed that we can define states that would conflict with native CSS ones. For example, we can define a "custom" state called ',(0,a.jsx)(t.code,{children:":hover"})," that would conflict with the native ",(0,a.jsx)(t.code,{children:":hover"})," pseudo-class."]}),(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-css",children:".player {\n -st-states: hover;\n}\n.player:hover {} /* custom state, not the native one */\n"})}),(0,a.jsxs)(t.p,{children:["Due to this potentially confusing behavior, we ",(0,a.jsx)(t.strong,{children:"strongly recommend"})," against naming states that would conflict with native ones."]})]}),"\n",(0,a.jsx)(t.h2,{id:"runtime-toggle",children:"Runtime toggle"}),"\n",(0,a.jsx)(t.p,{children:"Now that we have defined our states, we want to be able to toggle them at runtime in our component."}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-js",metastring:'title="game.jsx"',children:'import { cssStates, classes } from "./game.st.css";\n\n// create a registered first ranking player\n \n;\n'})}),"\n",(0,a.jsxs)(t.p,{children:["Looking at the example above, we import the ",(0,a.jsx)(t.code,{children:"cssStates"})," function and the ",(0,a.jsx)(t.code,{children:"classes"})," mapping from our ",(0,a.jsx)(t.code,{children:"game.st.css"})," stylesheet. We then create a ",(0,a.jsx)(t.code,{children:"div"})," element to represent a ",(0,a.jsx)(t.em,{children:"registered"})," and ",(0,a.jsx)(t.em,{children:"first rank"})," player."]}),"\n",(0,a.jsx)(t.p,{children:"This example, where we manually concatenate the class and states, is quite verbose and potentially confusing. In the next chapter, we will explore Stylable's runtime feature set and see a cleaner way of working with states at runtime."})]})}function h(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,a.jsx)(t,{...e,children:(0,a.jsx)(l,{...e})}):l(e)}},8453:(e,t,s)=>{s.d(t,{R:()=>o,x:()=>r});var n=s(6540);const a={},i=n.createContext(a);function o(e){const t=n.useContext(i);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:o(e.components),n.createElement(i.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[9849],{8101:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>d,contentTitle:()=>r,default:()=>h,frontMatter:()=>o,metadata:()=>n,toc:()=>c});const n=JSON.parse('{"id":"guides/handbook/custom-state","title":"Custom State","description":"In CSS, we have the ability to target native states of various elements using the pseudo-class syntax (for instance,active).","source":"@site/docs/guides/handbook/state.md","sourceDirName":"guides/handbook","slug":"/guides/handbook/custom-state","permalink":"/docs/guides/handbook/custom-state","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/guides/handbook/state.md","tags":[],"version":"current","frontMatter":{"id":"custom-state","title":"Custom State"},"sidebar":"Guides","previous":{"title":"Namespacing","permalink":"/docs/guides/handbook/namespacing"},"next":{"title":"Runtime","permalink":"/docs/guides/handbook/runtime"}}');var a=s(4848),i=s(8453);const o={id:"custom-state",title:"Custom State"},r=void 0,d={},c=[{value:"Define and target",id:"define-and-target",level:2},{value:"Runtime toggle",id:"runtime-toggle",level:2}];function l(e){const t={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",p:"p",pre:"pre",strong:"strong",...(0,i.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(t.p,{children:["In CSS, we have the ability to target native states of various elements using the ",(0,a.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes",children:(0,a.jsx)(t.code,{children:"pseudo-class"})})," syntax (for instance, ",(0,a.jsx)(t.code,{children:":hover"})," or ",(0,a.jsx)(t.code,{children:":active"}),")."]}),"\n",(0,a.jsxs)(t.p,{children:["While this is very handy, as of today, CSS does not provide a way for us to define a custom state on every element. For example, we might want a ",(0,a.jsx)(t.code,{children:"registered"})," custom state to represent a player element that has signed up for our game."]}),"\n",(0,a.jsxs)(t.p,{children:["We could choose to implement such a state manually by using a class selector (e.g. using a ",(0,a.jsx)(t.a,{href:"http://getbem.com/naming/#modifier:~:text=block__elem%20%7B%20color%3A%20%23042%3B%20%7D-,Modifier,-Flags%20on%20blocks",children:"BEM modifier"}),": ",(0,a.jsx)(t.code,{children:".NAMESPACE--registered"}),") or attribute selector (e.g. ",(0,a.jsx)(t.code,{children:"[data-NAMESPACE-registered]"}),")."]}),"\n",(0,a.jsx)(t.p,{children:"This is a bit of a pain for several reasons. Unlike native pseudo-classes, a class or an attribute selector is not semantic, and so we lose the original intent. If a convention like BEM is used, then the semantics are conserved, but it increases the verbosity of our code."}),"\n",(0,a.jsx)(t.p,{children:"By defining our states through Stylable, we gain the benefit of validations, completions, and a consistent syntax for states."}),"\n",(0,a.jsx)(t.h2,{id:"define-and-target",children:"Define and target"}),"\n",(0,a.jsxs)(t.p,{children:["To define a registered state for our ",(0,a.jsx)(t.code,{children:"player"})," class, we will use the ",(0,a.jsx)(t.code,{children:"-st-states"})," declaration, and pass it a single state name of ",(0,a.jsx)(t.code,{children:"registered"}),"."]}),"\n",(0,a.jsxs)(t.p,{children:["We can then target this state using our newly-defined ",(0,a.jsx)(t.code,{children:":registered"})," pseudo-class, knowing it will be transformed to a valid, safe selector at build time."]}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-css",metastring:'title="game.st.css"',children:".player {\n -st-states: registered; /* definition */\n}\n.player:registered {} /* usage */\n\n/* OUTPUT - namespace class and state */\n.game__player {}\n.game__player.game--registered {}\n"})}),"\n",(0,a.jsxs)(t.p,{children:["In the example above, we defined a ",(0,a.jsx)(t.code,{children:"registered"})," boolean state that can either be targeted, or not. Let's imagine, though, that in addition to the ",(0,a.jsx)(t.code,{children:"registered"})," state, we now want to highlight ",(0,a.jsx)(t.code,{children:"first"}),", ",(0,a.jsx)(t.code,{children:"second"}),", and ",(0,a.jsx)(t.code,{children:"third"})," ranking players."]}),"\n",(0,a.jsxs)(t.p,{children:["We can define such a state by passing the ",(0,a.jsx)(t.code,{children:"enum"})," parameter type to the ",(0,a.jsx)(t.code,{children:"ranking"})," state definition, and in it, list our possible options."]}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-css",metastring:'title="game.st.css"',children:".player {\n -st-states: registered, \n ranking(enum(first, second, third)); \n}\n\n.player:ranking(first) {} \n.player:ranking(second) {} \n.player:ranking(third) {} \n"})}),"\n",(0,a.jsxs)(t.p,{children:["There are additional parameter types, as well as validators, default values, and mapping capabilities to Stylable custom states. ",(0,a.jsx)(t.a,{href:"/docs/references/pseudo-classes",children:"Read more in the API reference"}),"."]}),"\n",(0,a.jsxs)(t.admonition,{title:"Conflicts with native",type:"caution",children:[(0,a.jsxs)(t.p,{children:['At this point, you may have noticed that we can define states that would conflict with native CSS ones. For example, we can define a "custom" state called ',(0,a.jsx)(t.code,{children:":hover"})," that would conflict with the native ",(0,a.jsx)(t.code,{children:":hover"})," pseudo-class."]}),(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-css",children:".player {\n -st-states: hover;\n}\n.player:hover {} /* custom state, not the native one */\n"})}),(0,a.jsxs)(t.p,{children:["Due to this potentially confusing behavior, we ",(0,a.jsx)(t.strong,{children:"strongly recommend"})," against naming states that would conflict with native ones."]})]}),"\n",(0,a.jsx)(t.h2,{id:"runtime-toggle",children:"Runtime toggle"}),"\n",(0,a.jsx)(t.p,{children:"Now that we have defined our states, we want to be able to toggle them at runtime in our component."}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-js",metastring:'title="game.jsx"',children:'import { cssStates, classes } from "./game.st.css";\n\n// create a registered first ranking player\n\n;\n'})}),"\n",(0,a.jsxs)(t.p,{children:["Looking at the example above, we import the ",(0,a.jsx)(t.code,{children:"cssStates"})," function and the ",(0,a.jsx)(t.code,{children:"classes"})," mapping from our ",(0,a.jsx)(t.code,{children:"game.st.css"})," stylesheet. We then create a ",(0,a.jsx)(t.code,{children:"div"})," element to represent a ",(0,a.jsx)(t.em,{children:"registered"})," and ",(0,a.jsx)(t.em,{children:"first rank"})," player."]}),"\n",(0,a.jsx)(t.p,{children:"This example, where we manually concatenate the class and states, is quite verbose and potentially confusing. In the next chapter, we will explore Stylable's runtime feature set and see a cleaner way of working with states at runtime."})]})}function h(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,a.jsx)(t,{...e,children:(0,a.jsx)(l,{...e})}):l(e)}},8453:(e,t,s)=>{s.d(t,{R:()=>o,x:()=>r});var n=s(6540);const a={},i=n.createContext(a);function o(e){const t=n.useContext(i);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:o(e.components),n.createElement(i.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/b1a4f681.b1ff7e29.js b/assets/js/b1a4f681.c21d0944.js similarity index 98% rename from assets/js/b1a4f681.b1ff7e29.js rename to assets/js/b1a4f681.c21d0944.js index 78c802da..3c4a56e6 100644 --- a/assets/js/b1a4f681.b1ff7e29.js +++ b/assets/js/b1a4f681.c21d0944.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[7514],{2705:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>c,contentTitle:()=>o,default:()=>p,frontMatter:()=>i,metadata:()=>n,toc:()=>d});const n=JSON.parse('{"id":"guides/handbook/extend","title":"Extend","description":"In the Import Class chapter, we saw how we can import CSS classes and target them by composing a selector to target our desired parts.","source":"@site/docs/guides/handbook/extend.mdx","sourceDirName":"guides/handbook","slug":"/guides/handbook/extend","permalink":"/docs/guides/handbook/extend","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/guides/handbook/extend.mdx","tags":[],"version":"current","frontMatter":{"id":"extend","title":"Extend","pagination_next":null},"sidebar":"Guides","previous":{"title":"Import Class","permalink":"/docs/guides/handbook/import-class"}}');var a=t(4848),r=t(8453),l=t(2250);const i={id:"extend",title:"Extend",pagination_next:null},o=void 0,c={},d=[{value:"Extend a stylesheet",id:"extend-a-stylesheet",level:2},{value:"Apply the extending class",id:"apply-the-extending-class",level:3},{value:"Access inner parts",id:"access-inner-parts",level:3},{value:"Access a state",id:"access-a-state",level:3},{value:"Extend multiple levels",id:"extend-multiple-levels",level:2}];function h(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",hr:"hr",p:"p",pre:"pre",strong:"strong",...(0,r.R)(),...e.components},{Details:t}=s;return t||function(e,s){throw new Error("Expected "+(s?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(s.p,{children:["In the ",(0,a.jsx)(s.a,{href:"/docs/guides/handbook/import-class",children:"Import Class chapter"}),", we saw how we can import CSS classes and target them by composing a selector to target our desired parts."]}),"\n",(0,a.jsx)(s.p,{children:"In this chapter, we'll see how to extend a stylesheet to target inner parts and states."}),"\n",(0,a.jsx)(s.p,{children:(0,a.jsx)(s.strong,{children:"Current status:"})}),"\n","\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="player.st.css"',children:".root {\n -st-states: registered,\n ranking(enum(first, second, third));\n}\n.avatar {}\n.username {}\n"})}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="game.st.css"',children:'@st-import Player, [avatar, username] from "./player.st.css";\n\nPlayer {\n background: blue;\n}\nPlayer .avatar {\n border-radius: 50%;\n}\nPlayer .username {\n text-transform: uppercase;\n}\n'})}),"\n","\n",(0,a.jsxs)(s.p,{children:["Previously, we manually customized the ",(0,a.jsx)(s.code,{children:"Player"})," component by creating a selector that includes a ",(0,a.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/Descendant_combinator",children:"descendant combinator"})," between the ",(0,a.jsx)(s.code,{children:"Player"})," and our targeted parts. This selector is based on knowledge we have about the ",(0,a.jsx)(s.code,{children:"Player"})," component structure, but this structure might change in the future, and break our assumptions."]}),"\n",(0,a.jsx)(s.h2,{id:"extend-a-stylesheet",children:"Extend a stylesheet"}),"\n",(0,a.jsxs)(s.p,{children:["To help us abstract our selector, we'll extend the ",(0,a.jsx)(s.code,{children:"Player"})," stylesheet to gain access to the stylesheet API, letting us target inner parts using ",(0,a.jsx)(s.a,{href:"/docs/references/pseudo-elements",children:"custom pseudo-elements"}),"."]}),"\n",(0,a.jsxs)(s.p,{children:["We'll first set the ",(0,a.jsx)(s.code,{children:"-st-extends"})," property with the value of the imported ",(0,a.jsx)(s.code,{children:"Player"})," stylesheet on the local ",(0,a.jsx)(s.code,{children:"player"})," class."]}),"\n","\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="game.st.css"',children:'@st-import Player from "./player.st.css";\n\n.player {\n -st-extends: Player;\n}\n'})}),"\n",(0,a.jsxs)(t,{children:[(0,a.jsx)("summary",{children:"Namespacing output"}),(0,a.jsx)(l.A,{title:"game.st.css",language:"css",children:'@st-import Player from "./player.st.css";\n\n/* customizing class, local namespace */\n.game__player {\n -st-extends: Player;\n}'})]}),"\n","\n",(0,a.jsxs)(s.p,{children:["We ",(0,a.jsx)(s.a,{href:"/docs/guides/handbook/import-class#stylesheet-root-selector",children:"previously saw"})," that we can't simply target an imported stylesheet, as that would affect all instances of it."]}),"\n",(0,a.jsxs)(s.p,{children:["Here, by using the ",(0,a.jsx)(s.code,{children:"-st-extends"})," property on a local class, we are scoping these customizations to the subtree of our component stylesheet."]}),"\n",(0,a.jsx)(s.h3,{id:"apply-the-extending-class",children:"Apply the extending class"}),"\n",(0,a.jsxs)(s.p,{children:["To customize a ",(0,a.jsx)(s.code,{children:"Player"})," component instance using our local stylesheet, we will need to apply the extending local class to the instance of the component."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-jsx",children:"import Player from './player.jsx';\nimport { st, classes } from './game.st.css';\n\nconst Game = ({ className }) => (\n\n\n);\n"})}),"\n",(0,a.jsx)(s.h3,{id:"access-inner-parts",children:"Access inner parts"}),"\n",(0,a.jsxs)(s.p,{children:["We can now use the custom pseudo-element syntax to safely target the ",(0,a.jsx)(s.code,{children:"avatar"})," and ",(0,a.jsx)(s.code,{children:"username"})," parts of the ",(0,a.jsx)(s.code,{children:"Player"})," component."]}),"\n","\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="game.st.css"',children:'@st-import Player from "./player.st.css";\n\n.player {\n -st-extends: Player;\n}\n.player::avatar {\n border-radius: 50%;\n}\n.player::username {\n text-transform: uppercase;\n}\n'})}),"\n",(0,a.jsxs)(t,{children:[(0,a.jsx)("summary",{children:"Namespacing output"}),(0,a.jsx)(l.A,{title:"game.st.css",language:"css",children:'@st-import Player from "./player.st.css";\n\n.game__player {\n-st-extends: Player;\n}\n.game__player .player__avatar {\nborder-radius: 50%;\n}\n.game__player .player__username {\ntext-transform: uppercase;\n}'})]}),"\n","\n",(0,a.jsx)(s.h3,{id:"access-a-state",children:"Access a state"}),"\n",(0,a.jsx)(s.p,{children:"Similar to how we used custom pseudo-elements to access inner parts of a component externally, we can now target custom pseudo-classes (states) of our extended parts as well."}),"\n","\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="game.st.css"',children:'@st-import Player from "./player.st.css";\n\n.player {\n -st-extends: Player;\n}\n.player:ranking(first) {\n background: gold;\n}\n/* ... */\n'})}),"\n","\n",(0,a.jsx)(s.h2,{id:"extend-multiple-levels",children:"Extend multiple levels"}),"\n",(0,a.jsxs)(s.p,{children:["Let's say that we want to turn our current ",(0,a.jsx)(s.code,{children:"avatar"})," part, into a component to support a more complex design with separate elements for the ",(0,a.jsx)(s.code,{children:"frame"})," and the ",(0,a.jsx)(s.code,{children:"image"}),"."]}),"\n",(0,a.jsxs)(s.p,{children:["To do this, we'll create a new ",(0,a.jsx)(s.code,{children:"avatar.st.css"})," stylesheet, import it to ",(0,a.jsx)(s.code,{children:"player.st.css"}),", and extend our ",(0,a.jsx)(s.code,{children:"avatar"})," class with it."]}),"\n","\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="avatar.st.css"',children:".root {}\n.frame {}\n.image {}\n"})}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="player.st.css"',children:'@st-import Avatar from "./avatar.st.css";\n\n.root {\n -st-states: registered, \n ranking(enum(first, second, third));\n}\n.avatar {\n -st-extends: Avatar;\n}\n.username {}\n'})}),"\n",(0,a.jsx)(s.p,{children:"By extending a stylesheet, which in turn has a part that extends a stylesheet, we can target inner parts through multiple levels with code completion and validations."}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="game.st.css"',children:'@st-import Player from "./player.st.css";\n\n.player {\n -st-extends: Player;\n}\n\n/* all player instances have an avatar with a green frame*/\n.player::avatar::frame {\n background: green;\n}\n\n/* the player in the first ranking, has an avatar with a golden frame */\n.player:ranking(first)::avatar::frame {\n background: gold;\n}\n'})}),"\n","\n",(0,a.jsxs)(s.admonition,{title:"Catch breaking changes",type:"tip",children:[(0,a.jsxs)(s.p,{children:["Let's imagine a case, where the ",(0,a.jsx)(s.code,{children:"Avatar"})," component has undergone refactoring which changed the part name ",(0,a.jsx)(s.code,{children:"frame"})," to ",(0,a.jsx)(s.code,{children:"box"}),". If we were using native CSS, and were aware of this change, we could try and manually locate all instances of ",(0,a.jsx)(s.code,{children:"frame"})," and replace them with ",(0,a.jsx)(s.code,{children:"box"}),". But if we were to miss an instance, CSS would provide no indication of the problem."]}),(0,a.jsx)(s.p,{children:"Because we used Stylable to declare that a class extends a stylesheet, and then accessed its inner parts, we are assured that the interface exists and is valid, and if this interface were to change, an error would be reported at build-time and in the IDE."})]}),"\n",(0,a.jsx)(s.hr,{}),"\n",(0,a.jsx)(s.p,{children:"In this chapter we saw how once we extend a stylesheet, we can target inner parts and states using native-like syntax, while benefiting from language service features and diagnostics."}),"\n",(0,a.jsx)(s.p,{children:"Next we'll start talking about features that have to do with style templating, beginning with variables, both native custom properties, and Stylable's build-time variables."}),"\n",(0,a.jsx)(s.admonition,{title:"You've reached the end of the handbook, so far",type:"info",children:(0,a.jsxs)(s.p,{children:["This handbook is a work in progress and is not yet complete. You can track the plan and progress for it in ",(0,a.jsx)(s.a,{href:"https://github.com/wixplosives/stylable.io/issues/39",children:"this issue"})]})})]})}function p(e={}){const{wrapper:s}={...(0,r.R)(),...e.components};return s?(0,a.jsx)(s,{...e,children:(0,a.jsx)(h,{...e})}):h(e)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[7514],{4670:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>c,contentTitle:()=>o,default:()=>p,frontMatter:()=>i,metadata:()=>n,toc:()=>d});const n=JSON.parse('{"id":"guides/handbook/extend","title":"Extend","description":"In the Import Class chapter, we saw how we can import CSS classes and target them by composing a selector to target our desired parts.","source":"@site/docs/guides/handbook/extend.mdx","sourceDirName":"guides/handbook","slug":"/guides/handbook/extend","permalink":"/docs/guides/handbook/extend","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/guides/handbook/extend.mdx","tags":[],"version":"current","frontMatter":{"id":"extend","title":"Extend","pagination_next":null},"sidebar":"Guides","previous":{"title":"Import Class","permalink":"/docs/guides/handbook/import-class"}}');var a=t(4848),r=t(8453),l=t(1432);const i={id:"extend",title:"Extend",pagination_next:null},o=void 0,c={},d=[{value:"Extend a stylesheet",id:"extend-a-stylesheet",level:2},{value:"Apply the extending class",id:"apply-the-extending-class",level:3},{value:"Access inner parts",id:"access-inner-parts",level:3},{value:"Access a state",id:"access-a-state",level:3},{value:"Extend multiple levels",id:"extend-multiple-levels",level:2}];function h(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",hr:"hr",p:"p",pre:"pre",strong:"strong",...(0,r.R)(),...e.components},{Details:t}=s;return t||function(e,s){throw new Error("Expected "+(s?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(s.p,{children:["In the ",(0,a.jsx)(s.a,{href:"/docs/guides/handbook/import-class",children:"Import Class chapter"}),", we saw how we can import CSS classes and target them by composing a selector to target our desired parts."]}),"\n",(0,a.jsx)(s.p,{children:"In this chapter, we'll see how to extend a stylesheet to target inner parts and states."}),"\n",(0,a.jsx)(s.p,{children:(0,a.jsx)(s.strong,{children:"Current status:"})}),"\n","\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="player.st.css"',children:".root {\n -st-states: registered,\n ranking(enum(first, second, third));\n}\n.avatar {}\n.username {}\n"})}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="game.st.css"',children:'@st-import Player, [avatar, username] from "./player.st.css";\n\nPlayer {\n background: blue;\n}\nPlayer .avatar {\n border-radius: 50%;\n}\nPlayer .username {\n text-transform: uppercase;\n}\n'})}),"\n","\n",(0,a.jsxs)(s.p,{children:["Previously, we manually customized the ",(0,a.jsx)(s.code,{children:"Player"})," component by creating a selector that includes a ",(0,a.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/Descendant_combinator",children:"descendant combinator"})," between the ",(0,a.jsx)(s.code,{children:"Player"})," and our targeted parts. This selector is based on knowledge we have about the ",(0,a.jsx)(s.code,{children:"Player"})," component structure, but this structure might change in the future, and break our assumptions."]}),"\n",(0,a.jsx)(s.h2,{id:"extend-a-stylesheet",children:"Extend a stylesheet"}),"\n",(0,a.jsxs)(s.p,{children:["To help us abstract our selector, we'll extend the ",(0,a.jsx)(s.code,{children:"Player"})," stylesheet to gain access to the stylesheet API, letting us target inner parts using ",(0,a.jsx)(s.a,{href:"/docs/references/pseudo-elements",children:"custom pseudo-elements"}),"."]}),"\n",(0,a.jsxs)(s.p,{children:["We'll first set the ",(0,a.jsx)(s.code,{children:"-st-extends"})," property with the value of the imported ",(0,a.jsx)(s.code,{children:"Player"})," stylesheet on the local ",(0,a.jsx)(s.code,{children:"player"})," class."]}),"\n","\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="game.st.css"',children:'@st-import Player from "./player.st.css";\n\n.player {\n -st-extends: Player;\n}\n'})}),"\n",(0,a.jsxs)(t,{children:[(0,a.jsx)("summary",{children:"Namespacing output"}),(0,a.jsx)(l.A,{title:"game.st.css",language:"css",children:'@st-import Player from "./player.st.css";\n\n/* customizing class, local namespace */\n.game__player {\n -st-extends: Player;\n}'})]}),"\n","\n",(0,a.jsxs)(s.p,{children:["We ",(0,a.jsx)(s.a,{href:"/docs/guides/handbook/import-class#stylesheet-root-selector",children:"previously saw"})," that we can't simply target an imported stylesheet, as that would affect all instances of it."]}),"\n",(0,a.jsxs)(s.p,{children:["Here, by using the ",(0,a.jsx)(s.code,{children:"-st-extends"})," property on a local class, we are scoping these customizations to the subtree of our component stylesheet."]}),"\n",(0,a.jsx)(s.h3,{id:"apply-the-extending-class",children:"Apply the extending class"}),"\n",(0,a.jsxs)(s.p,{children:["To customize a ",(0,a.jsx)(s.code,{children:"Player"})," component instance using our local stylesheet, we will need to apply the extending local class to the instance of the component."]}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-jsx",children:"import Player from './player.jsx';\nimport { st, classes } from './game.st.css';\n\nconst Game = ({ className }) => (\n\n \n\n);\n"})}),"\n",(0,a.jsx)(s.h3,{id:"access-inner-parts",children:"Access inner parts"}),"\n",(0,a.jsxs)(s.p,{children:["We can now use the custom pseudo-element syntax to safely target the ",(0,a.jsx)(s.code,{children:"avatar"})," and ",(0,a.jsx)(s.code,{children:"username"})," parts of the ",(0,a.jsx)(s.code,{children:"Player"})," component."]}),"\n","\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="game.st.css"',children:'@st-import Player from "./player.st.css";\n\n.player {\n -st-extends: Player;\n}\n.player::avatar {\n border-radius: 50%;\n}\n.player::username {\n text-transform: uppercase;\n}\n'})}),"\n",(0,a.jsxs)(t,{children:[(0,a.jsx)("summary",{children:"Namespacing output"}),(0,a.jsx)(l.A,{title:"game.st.css",language:"css",children:'@st-import Player from "./player.st.css";\n\n.game__player {\n-st-extends: Player;\n}\n.game__player .player__avatar {\nborder-radius: 50%;\n}\n.game__player .player__username {\ntext-transform: uppercase;\n}'})]}),"\n","\n",(0,a.jsx)(s.h3,{id:"access-a-state",children:"Access a state"}),"\n",(0,a.jsx)(s.p,{children:"Similar to how we used custom pseudo-elements to access inner parts of a component externally, we can now target custom pseudo-classes (states) of our extended parts as well."}),"\n","\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="game.st.css"',children:'@st-import Player from "./player.st.css";\n\n.player {\n -st-extends: Player;\n}\n.player:ranking(first) {\n background: gold;\n}\n/* ... */\n'})}),"\n","\n",(0,a.jsx)(s.h2,{id:"extend-multiple-levels",children:"Extend multiple levels"}),"\n",(0,a.jsxs)(s.p,{children:["Let's say that we want to turn our current ",(0,a.jsx)(s.code,{children:"avatar"})," part, into a component to support a more complex design with separate elements for the ",(0,a.jsx)(s.code,{children:"frame"})," and the ",(0,a.jsx)(s.code,{children:"image"}),"."]}),"\n",(0,a.jsxs)(s.p,{children:["To do this, we'll create a new ",(0,a.jsx)(s.code,{children:"avatar.st.css"})," stylesheet, import it to ",(0,a.jsx)(s.code,{children:"player.st.css"}),", and extend our ",(0,a.jsx)(s.code,{children:"avatar"})," class with it."]}),"\n","\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="avatar.st.css"',children:".root {}\n.frame {}\n.image {}\n"})}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="player.st.css"',children:'@st-import Avatar from "./avatar.st.css";\n\n.root {\n -st-states: registered, \n ranking(enum(first, second, third));\n}\n.avatar {\n -st-extends: Avatar;\n}\n.username {}\n'})}),"\n",(0,a.jsx)(s.p,{children:"By extending a stylesheet, which in turn has a part that extends a stylesheet, we can target inner parts through multiple levels with code completion and validations."}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="game.st.css"',children:'@st-import Player from "./player.st.css";\n\n.player {\n -st-extends: Player;\n}\n\n/* all player instances have an avatar with a green frame*/\n.player::avatar::frame {\n background: green;\n}\n\n/* the player in the first ranking, has an avatar with a golden frame */\n.player:ranking(first)::avatar::frame {\n background: gold;\n}\n'})}),"\n","\n",(0,a.jsxs)(s.admonition,{title:"Catch breaking changes",type:"tip",children:[(0,a.jsxs)(s.p,{children:["Let's imagine a case, where the ",(0,a.jsx)(s.code,{children:"Avatar"})," component has undergone refactoring which changed the part name ",(0,a.jsx)(s.code,{children:"frame"})," to ",(0,a.jsx)(s.code,{children:"box"}),". If we were using native CSS, and were aware of this change, we could try and manually locate all instances of ",(0,a.jsx)(s.code,{children:"frame"})," and replace them with ",(0,a.jsx)(s.code,{children:"box"}),". But if we were to miss an instance, CSS would provide no indication of the problem."]}),(0,a.jsx)(s.p,{children:"Because we used Stylable to declare that a class extends a stylesheet, and then accessed its inner parts, we are assured that the interface exists and is valid, and if this interface were to change, an error would be reported at build-time and in the IDE."})]}),"\n",(0,a.jsx)(s.hr,{}),"\n",(0,a.jsx)(s.p,{children:"In this chapter we saw how once we extend a stylesheet, we can target inner parts and states using native-like syntax, while benefiting from language service features and diagnostics."}),"\n",(0,a.jsx)(s.p,{children:"Next we'll start talking about features that have to do with style templating, beginning with variables, both native custom properties, and Stylable's build-time variables."}),"\n",(0,a.jsx)(s.admonition,{title:"You've reached the end of the handbook, so far",type:"info",children:(0,a.jsxs)(s.p,{children:["This handbook is a work in progress and is not yet complete. You can track the plan and progress for it in ",(0,a.jsx)(s.a,{href:"https://github.com/wixplosives/stylable.io/issues/39",children:"this issue"})]})})]})}function p(e={}){const{wrapper:s}={...(0,r.R)(),...e.components};return s?(0,a.jsx)(s,{...e,children:(0,a.jsx)(h,{...e})}):h(e)}}}]); \ No newline at end of file diff --git a/assets/js/baf0d4a2.840f3cfb.js b/assets/js/baf0d4a2.7ab90aee.js similarity index 99% rename from assets/js/baf0d4a2.840f3cfb.js rename to assets/js/baf0d4a2.7ab90aee.js index 51d6a7c4..c8e26afb 100644 --- a/assets/js/baf0d4a2.840f3cfb.js +++ b/assets/js/baf0d4a2.7ab90aee.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[6827],{8814:(e,i,s)=>{s.r(i),s.d(i,{assets:()=>l,contentTitle:()=>g,default:()=>j,frontMatter:()=>I,metadata:()=>n,toc:()=>c});const n=JSON.parse('{"id":"style-guide","title":"Style Guide","description":"You can write content using GitHub-flavored Markdown syntax.","source":"@site/docs/style-guide.md","sourceDirName":".","slug":"/style-guide","permalink":"/docs/style-guide","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/style-guide.md","tags":[],"version":"current","frontMatter":{"id":"style-guide","title":"Style Guide","sidebar_label":"Style Guide"}}');var t=s(4848),M=s(8453);const I={id:"style-guide",title:"Style Guide",sidebar_label:"Style Guide"},g=void 0,l={},c=[{value:"Markdown Syntax",id:"markdown-syntax",level:2},{value:"Headers",id:"headers",level:2},{value:"H2 - Create the best documentation",id:"h2---create-the-best-documentation",level:2},{value:"H3 - Create the best documentation",id:"h3---create-the-best-documentation",level:3},{value:"H4 - Create the best documentation",id:"h4---create-the-best-documentation",level:4},{value:"H5 - Create the best documentation",id:"h5---create-the-best-documentation",level:5},{value:"H6 - Create the best documentation",id:"h6---create-the-best-documentation",level:6},{value:"Emphasis",id:"emphasis",level:2},{value:"Lists",id:"lists",level:2},{value:"Links",id:"links",level:2},{value:"Images",id:"images",level:2},{value:"Code",id:"code",level:2},{value:"Tables",id:"tables",level:2},{value:"Blockquotes",id:"blockquotes",level:2},{value:"Inline HTML",id:"inline-html",level:2},{value:"Line Breaks",id:"line-breaks",level:2},{value:"Admonitions",id:"admonitions",level:2}];function A(e){const i={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",del:"del",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",hr:"hr",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,M.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(i.p,{children:["You can write content using ",(0,t.jsx)(i.a,{href:"https://github.github.com/gfm/",children:"GitHub-flavored Markdown syntax"}),"."]}),"\n",(0,t.jsx)(i.h2,{id:"markdown-syntax",children:"Markdown Syntax"}),"\n",(0,t.jsx)(i.p,{children:"To serve as an example page when styling markdown based Docusaurus sites."}),"\n",(0,t.jsx)(i.h2,{id:"headers",children:"Headers"}),"\n",(0,t.jsx)(i.h1,{id:"h1---create-the-best-documentation",children:"H1 - Create the best documentation"}),"\n",(0,t.jsx)(i.h2,{id:"h2---create-the-best-documentation",children:"H2 - Create the best documentation"}),"\n",(0,t.jsx)(i.h3,{id:"h3---create-the-best-documentation",children:"H3 - Create the best documentation"}),"\n",(0,t.jsx)(i.h4,{id:"h4---create-the-best-documentation",children:"H4 - Create the best documentation"}),"\n",(0,t.jsx)(i.h5,{id:"h5---create-the-best-documentation",children:"H5 - Create the best documentation"}),"\n",(0,t.jsx)(i.h6,{id:"h6---create-the-best-documentation",children:"H6 - Create the best documentation"}),"\n",(0,t.jsx)(i.hr,{}),"\n",(0,t.jsx)(i.h2,{id:"emphasis",children:"Emphasis"}),"\n",(0,t.jsxs)(i.p,{children:["Emphasis, aka italics, with ",(0,t.jsx)(i.em,{children:"asterisks"})," or ",(0,t.jsx)(i.em,{children:"underscores"}),"."]}),"\n",(0,t.jsxs)(i.p,{children:["Strong emphasis, aka bold, with ",(0,t.jsx)(i.strong,{children:"asterisks"})," or ",(0,t.jsx)(i.strong,{children:"underscores"}),"."]}),"\n",(0,t.jsxs)(i.p,{children:["Combined emphasis with ",(0,t.jsxs)(i.strong,{children:["asterisks and ",(0,t.jsx)(i.em,{children:"underscores"})]}),"."]}),"\n",(0,t.jsxs)(i.p,{children:["Strikethrough uses two tildes. ",(0,t.jsx)(i.del,{children:"Scratch this."})]}),"\n",(0,t.jsx)(i.hr,{}),"\n",(0,t.jsx)(i.h2,{id:"lists",children:"Lists"}),"\n",(0,t.jsxs)(i.ol,{children:["\n",(0,t.jsx)(i.li,{children:"First ordered list item"}),"\n",(0,t.jsxs)(i.li,{children:["Another item","\n",(0,t.jsxs)(i.ul,{children:["\n",(0,t.jsx)(i.li,{children:"Unordered sub-list."}),"\n"]}),"\n"]}),"\n",(0,t.jsxs)(i.li,{children:["Actual numbers don't matter, just that it's a number","\n",(0,t.jsxs)(i.ol,{children:["\n",(0,t.jsx)(i.li,{children:"Ordered sub-list"}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(i.li,{children:"And another item."}),"\n"]}),"\n",(0,t.jsxs)(i.ul,{children:["\n",(0,t.jsx)(i.li,{children:"Unordered list can use asterisks"}),"\n"]}),"\n",(0,t.jsxs)(i.ul,{children:["\n",(0,t.jsx)(i.li,{children:"Or minuses"}),"\n"]}),"\n",(0,t.jsxs)(i.ul,{children:["\n",(0,t.jsx)(i.li,{children:"Or pluses"}),"\n"]}),"\n",(0,t.jsx)(i.hr,{}),"\n",(0,t.jsx)(i.h2,{id:"links",children:"Links"}),"\n",(0,t.jsx)(i.p,{children:(0,t.jsx)(i.a,{href:"https://www.google.com/",children:"I'm an inline-style link"})}),"\n",(0,t.jsx)(i.p,{children:(0,t.jsx)(i.a,{href:"https://www.google.com/",title:"Google's Homepage",children:"I'm an inline-style link with title"})}),"\n",(0,t.jsx)(i.p,{children:(0,t.jsx)(i.a,{href:"https://www.mozilla.org/",children:"I'm a reference-style link"})}),"\n",(0,t.jsx)(i.p,{children:(0,t.jsx)(i.a,{href:"http://slashdot.org/",children:"You can use numbers for reference-style link definitions"})}),"\n",(0,t.jsxs)(i.p,{children:["Or leave it empty and use the ",(0,t.jsx)(i.a,{href:"http://www.reddit.com/",children:"link text itself"}),"."]}),"\n",(0,t.jsxs)(i.p,{children:["URLs will automatically get turned into links. ",(0,t.jsx)(i.a,{href:"http://www.example.com/",children:"http://www.example.com/"})," and sometimes example.com (but not on GitHub, for example)."]}),"\n",(0,t.jsx)(i.p,{children:"Some text to show that the reference links can follow later."}),"\n",(0,t.jsx)(i.hr,{}),"\n",(0,t.jsx)(i.h2,{id:"images",children:"Images"}),"\n",(0,t.jsx)(i.p,{children:"Here's our logo (hover to see the title text):"}),"\n",(0,t.jsxs)(i.p,{children:["Inline-style: ",(0,t.jsx)(i.img,{alt:"alt text",src:s(9795).A+"",title:"Logo Title Text 1",width:"85",height:"96"})]}),"\n",(0,t.jsxs)(i.p,{children:["Reference-style: ",(0,t.jsx)(i.img,{src:"/img/branding/logo/PNG/96-logo-OnlySymbol.png",alt:"alt text",title:"Logo Title Text 2"})]}),"\n",(0,t.jsx)(i.p,{children:"Images from any folder can be used by providing path to file. Path should be relative to markdown file."}),"\n",(0,t.jsx)(i.p,{children:(0,t.jsx)(i.img,{alt:"img",src:s(1197).A+"",width:"85",height:"96"})}),"\n",(0,t.jsx)(i.hr,{}),"\n",(0,t.jsx)(i.h2,{id:"code",children:"Code"}),"\n",(0,t.jsx)(i.pre,{children:(0,t.jsx)(i.code,{className:"language-javascript",children:"var s = 'JavaScript syntax highlighting';\nalert(s);\n"})}),"\n",(0,t.jsx)(i.pre,{children:(0,t.jsx)(i.code,{className:"language-python",children:'s = "Python syntax highlighting"\nprint(s)\n'})}),"\n",(0,t.jsx)(i.pre,{children:(0,t.jsx)(i.code,{children:"No language indicated, so no syntax highlighting.\nBut let's throw in a tag.\n"})}),"\n",(0,t.jsx)(i.pre,{children:(0,t.jsx)(i.code,{className:"language-js",metastring:"{2}",children:"function highlightMe() {\n console.log('This line can be highlighted!');\n}\n"})}),"\n",(0,t.jsx)(i.hr,{}),"\n",(0,t.jsx)(i.h2,{id:"tables",children:"Tables"}),"\n",(0,t.jsx)(i.p,{children:"Colons can be used to align columns."}),"\n",(0,t.jsxs)(i.table,{children:[(0,t.jsx)(i.thead,{children:(0,t.jsxs)(i.tr,{children:[(0,t.jsx)(i.th,{children:"Tables"}),(0,t.jsx)(i.th,{style:{textAlign:"center"},children:"Are"}),(0,t.jsx)(i.th,{style:{textAlign:"right"},children:"Cool"})]})}),(0,t.jsxs)(i.tbody,{children:[(0,t.jsxs)(i.tr,{children:[(0,t.jsx)(i.td,{children:"col 3 is"}),(0,t.jsx)(i.td,{style:{textAlign:"center"},children:"right-aligned"}),(0,t.jsx)(i.td,{style:{textAlign:"right"},children:"$1600"})]}),(0,t.jsxs)(i.tr,{children:[(0,t.jsx)(i.td,{children:"col 2 is"}),(0,t.jsx)(i.td,{style:{textAlign:"center"},children:"centered"}),(0,t.jsx)(i.td,{style:{textAlign:"right"},children:"$12"})]}),(0,t.jsxs)(i.tr,{children:[(0,t.jsx)(i.td,{children:"zebra stripes"}),(0,t.jsx)(i.td,{style:{textAlign:"center"},children:"are neat"}),(0,t.jsx)(i.td,{style:{textAlign:"right"},children:"$1"})]})]})]}),"\n",(0,t.jsx)(i.p,{children:"There must be at least 3 dashes separating each header cell. The outer pipes (|) are optional, and you don't need to make the raw Markdown line up prettily. You can also use inline Markdown."}),"\n",(0,t.jsxs)(i.table,{children:[(0,t.jsx)(i.thead,{children:(0,t.jsxs)(i.tr,{children:[(0,t.jsx)(i.th,{children:"Markdown"}),(0,t.jsx)(i.th,{children:"Less"}),(0,t.jsx)(i.th,{children:"Pretty"})]})}),(0,t.jsxs)(i.tbody,{children:[(0,t.jsxs)(i.tr,{children:[(0,t.jsx)(i.td,{children:(0,t.jsx)(i.em,{children:"Still"})}),(0,t.jsx)(i.td,{children:(0,t.jsx)(i.code,{children:"renders"})}),(0,t.jsx)(i.td,{children:(0,t.jsx)(i.strong,{children:"nicely"})})]}),(0,t.jsxs)(i.tr,{children:[(0,t.jsx)(i.td,{children:"1"}),(0,t.jsx)(i.td,{children:"2"}),(0,t.jsx)(i.td,{children:"3"})]})]})]}),"\n",(0,t.jsx)(i.hr,{}),"\n",(0,t.jsx)(i.h2,{id:"blockquotes",children:"Blockquotes"}),"\n",(0,t.jsxs)(i.blockquote,{children:["\n",(0,t.jsx)(i.p,{children:"Blockquotes are very handy in email to emulate reply text. This line is part of the same quote."}),"\n"]}),"\n",(0,t.jsx)(i.p,{children:"Quote break."}),"\n",(0,t.jsxs)(i.blockquote,{children:["\n",(0,t.jsxs)(i.p,{children:["This is a very long line that will still be quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can ",(0,t.jsx)(i.em,{children:"put"})," ",(0,t.jsx)(i.strong,{children:"Markdown"})," into a blockquote."]}),"\n"]}),"\n",(0,t.jsx)(i.hr,{}),"\n",(0,t.jsx)(i.h2,{id:"inline-html",children:"Inline HTML"}),"\n",(0,t.jsxs)("dl",{children:[(0,t.jsx)("dt",{children:"Definition list"}),(0,t.jsx)("dd",{children:"Is something people use sometimes."}),(0,t.jsx)("dt",{children:"Markdown in HTML"}),(0,t.jsxs)("dd",{children:["Does ",(0,t.jsx)(i.em,{children:"not"})," work ",(0,t.jsx)(i.strong,{children:"very"})," well. Use HTML ",(0,t.jsx)("em",{children:"tags"}),"."]})]}),"\n",(0,t.jsx)(i.hr,{}),"\n",(0,t.jsx)(i.h2,{id:"line-breaks",children:"Line Breaks"}),"\n",(0,t.jsx)(i.p,{children:"Here's a line for us to start with."}),"\n",(0,t.jsxs)(i.p,{children:["This line is separated from the one above by two newlines, so it will be a ",(0,t.jsx)(i.em,{children:"separate paragraph"}),"."]}),"\n",(0,t.jsxs)(i.p,{children:["This line is also a separate paragraph, but... This line is only separated by a single newline, so it's a separate line in the ",(0,t.jsx)(i.em,{children:"same paragraph"}),"."]}),"\n",(0,t.jsx)(i.hr,{}),"\n",(0,t.jsx)(i.h2,{id:"admonitions",children:"Admonitions"}),"\n",(0,t.jsx)(i.admonition,{type:"note",children:(0,t.jsx)(i.p,{children:"This is a note"})}),"\n",(0,t.jsx)(i.admonition,{type:"tip",children:(0,t.jsx)(i.p,{children:"This is a tip"})}),"\n",(0,t.jsx)(i.admonition,{type:"important",children:(0,t.jsx)(i.p,{children:"This is important"})}),"\n",(0,t.jsx)(i.admonition,{type:"caution",children:(0,t.jsx)(i.p,{children:"This is a caution"})}),"\n",(0,t.jsx)(i.admonition,{type:"warning",children:(0,t.jsx)(i.p,{children:"This is a warning"})})]})}function j(e={}){const{wrapper:i}={...(0,M.R)(),...e.components};return i?(0,t.jsx)(i,{...e,children:(0,t.jsx)(A,{...e})}):A(e)}},9795:(e,i,s)=>{s.d(i,{A:()=>n});const n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFUAAABgCAYAAABsQj5EAAAAAXNSR0IArs4c6QAAHzBJREFUeAHVnQt0XFW5x/c5M5m8Ju+GtrxKaYECBWl5sxCLXCgoUgoWQQTrgvaKgogo4INlrniXaC9cBBWQK3aJCK6CoiIIKBREoNK3tIC00NLS0meezSSTmTn3//++vc+cSZM0CSkr2c3Mfn379Tv/vc8+j6Se+ZDdt9dcfEA6HZxrjHcKmj7GM2Z0LvCqTRA0er7ZGBjzTDwWe/TWwx589UPu2pA1hzHtfXf7hutK32/d8tlskLvSBOakwhY98ARKzzOuMxr1flcUS1x/6+Hz1xXaD/+YG8de6em9wdyif69quxrQbkQDowmOAD34gIsffMERp4QkTfi69EaYTr9t8shS7V6Dev3qz56Wy3n3BLngcEIUNQpBAiVC+GxduWpcIgTsEqV7LbF4fPrtR8x/hcVHgpNeD2VHG1Y1JJpza74PYtfngpyvdXdrxipy93Yd5by9xb++pLjoqB9Nur919zLDL8UOemg6dv3qK8Y1Zt9+KZsz38DHDwIq1MfHM1CtwQlJw/CNQTo/TIPv8qJhphmUhz8u1ZH9wdD0cu/XkpfEB2zrKys+fwam7W9BqC46rfMT2U1rNqn6C9dX27asCgw7EwS4FHDNRVIqGSvd79aj72605sPWGxKlXrPy85dCTU/mcqYuRxBQGFXGj1NillNeVGeQHlGoVXBoL+qNKJe2qDMbeKXNuc5Zw5ZkpGPxSHhQwS8vn/01TPX/8QLP49SlCHP4yBkeNcoJCnAZZ7rKULUaShL5zomN7KkIk+VhxQDKezlvirMbzv6goQKW9+UVV8zL5YLrOUABINNUASFdQBgCw0+QUxu3E1ArTm86jUlQvqhk6lOhEih2ETALxuVthm9oUFAbggb/S8uunI9xXkYgCkoHqZAYJkk7cPgMcmVUJTLCpYGpULfQU1tXxOPJy5YSM61vl1oN7+9BQd28dOPd0JEA5fBURYRUwEdGTpACjxBpSwXiejQExXyQdgombGaqTklboprseeskYZh/DRjq3CVzfggGc62IZHg8GUmcMadAgcNk/vN1XUS2wAJdAhbgLAPH5UFUS4+qtE7hIx9txIz3lEsfzv6AoF65eO5NOMPfoEA4UAxNIoSgqVQdweHEBZ8hTm9Oe+bTabrzmSzKlRzUInDFUL+Er9S3Zr/j91kYyRm2wX5DnbP4qi9mc7kfuGmq09OCEoAcI7Vnp7kMmWdw2BAUprwcBVEyrXgYrCJhwppsbVKSdYljHj5ezLu5wWvI2Mxh7dme993HOUuunp7NZp8AIN3nuCkuxbpXwbjiceJ0B0IXRgCCCfNolS/tlJ1XcmjhmQd+deJPL++7l8Mnd49Knbv42gPT2cyDmJY+pymdnpg07IYiamIePjLlbQbjApfrrnVYQgQsLZlP53YCGne2WIu94AV/n1Fz1WpkfMf66iZvjmzvbP0LThITdVoDAuFQagQioPK+THGbLjAFmtrqtT6hM07BaznnuzpdvWLneQ9XjzIX/nzCjzr76udwy+tTqW+37bgDl5bHU06hoojTqo7qEhXKfFZFyslJ4g4+r7BY2sF1YbVnxW45CBvx0UJgbnngpDsasHS4pocbu177w5H26C5/5drP4dbdA+QRDlosWSQPJlo4HL0LuILisxT1B4XaQhourAum7VDy7N+ccvuCaN0jKdwj1Nkvf/UgnGZfA9Ry5WfN3PjhOzCFg4WdOwo2w4lUDoWUVxtXFRVM2PR9z2yM+cGMX598x9LCekdWrMfp35kLfo5BlnPN1DM3BmXpFMDhWC1EuVICGMrahbWIQpTLU5iLOsFQ6g2Ls1bv1eIi/7z5J8x7H5ER7TiaAnfJy9d9Psia+U5J9Asdi2iuwOPUtk4guoj4qkKCpNutTpdgzBJTGj9jwXE/bBbDEf6VJ4KBfGlVQ3JHY8saBEcXAsrDIUgRJL7IRL/goyabRRmKWiUxRElj2mBdlQPBpjHxc/4qP1F22oJTGnaKwSC+zjKmvMyY+iPK66tf27Vt81RjtjXoJccgavvgRQqm//amXTcGOW+0CEhw5+EQhE5h0pOfwtbtjkBshK7d08oxQBkWk6PAgB6kwMQb0zFz3p8HAfQaY4o/UnfIN9qy6QsyQe6QuBcDV+N/vLo8h7U5taCo/K0TK8b++YDiqoe81Y+uKuzs3o1hhOoueeVbo9PprreRwM6p0qgoAURffihCC4ecFE6oSEITFUaKEWqkjIvgTn+wq6l41l9nfu9R7UH/v39Rf9hFrZmO27Hm79e9FJoK5wauVszU8npzQsWYVUWxovtMeckvvUUPtnQvM9Tx8LIo3Zm5Bp0so9LkMQg36KIofbTBNG7ao49C3CMSbpQkXfIZJmz7SCQsww2/1knbTe+UPT4YoD+uPui7zV2pB3GsAZRHkc75DGmY31kYLW7ban67/d9HNqVTd5i29nXB5Au+FUybXSLF9tKXQL1sxbxyPA25ikD1OZKCETi83MdzJIUE4LjEFDhII2QBasPOXn2tiweGZfjsiul8qrppXXnzju3V8sRgIOP6cfW4m3Hj+mbMEF222AULUXyJR2tUxNu7OszD2980mzvbanCJ/d/B1ubXgskzz4xaDmVYoLY27bw4m/Vq5XGyVZOEAZRqdA/zXL7AISDkK0AFp8rGAeCBEIUqSKdQprc0Fpn31hb//e0brn1rIAO5uXLM8RmTuwnHBrdVu5V0cV20kUmd8hNmmI5c1vxuxxqzJc2HB8EEwH0qOPLCnwQnzypFwpA6gQolXkLFcfB4iKeKEmhoHiB02ltAkh5Vrg2LagGZquaBgO+AO8BdGc8se746G6ss+epAR5H04j/zPb9MuDleUZ8VOobO7wa3C4X/sHOtac2mmePlguyXg5auRcExFx4y0P70Ze/Peq5hDMCdLhDc1BZACkunL0FFVadroypS00OI9uAQpBwM+G7JeP2lJM9T72644Str++pU97wvJpKT455/NBmKAi00jVtrpvUGOYQbmFQuY55sXIfx0BjLQ2COCtLZxVgO8Cbi0Di/3WSnYYr7hCCQCI9qo9Kc2ggG6cxXQBakS4NPmeRtGKZa0W3WhfIbViXM+lWlpjSZ/dNAuz6xvPYyHIyEsESAK6Xud7UmXTmlC3mwNEb7uzIZs6Oj0zSn06aLHUL6ZiwBy3dt1cKIY52uRH2PBUfOnKOJH+wbJL1T8ipUME5heiJSoALMqtDBdvkCOwI4PEA8GCiTTvvmjWfLjYnhpQjfv3+gXcY9iENZRuGpPvUyV/CG1RG0A9zRlTXr2trMhrZdZltHh9ncnjJvt7Sare0dhGgWtW0R1apiUXcQxPCq58+zk89vCCscZMDHwTsuuvYpIBw9Kg2geHDpC2iJq/J0WbA2sBWVC3Q9MFKWoKHUFX8qM11Z38QTQXbrLdevGGhfcWaq7V7GwZN0dE/i8Ak71ZUx6wGzI5stKMbDsbOz07zbyryMWRJRqx4qGATBd7NHzrwvmDWrz3vNBRV3i/i4TByryoKKBKAFxDM4ociyoKBCcDZdoRcCl6XDlmHZtqaY2f4mdkBFnokXBx3d2u9XFNcJe37bz1JJ4yy/oa09VGxPDRA2FbyqbbvJYI1VpxVwqQ2C7JXZ1ekFwbSGgivOnurqKc3HU5L6EB5h4ENYbknQsFsCFLhToU5/C1zK6kFw6qbdysdxgcb+YurH48GgXobwTWx9T50vSOOxhWvsSMv01ljv3ymA3ZhqN2s6mzFWe0RYh60HoZm57cvmIy+f0nt1BTmA6mEJcEqELycWp1BVK+EIQJ6odgOuZcILB6hd1A3I777cado22vZQhbxuVdB8/yLvpVv/yOJ7ss6gE02d6T2Zhfk8gS1v3S5XzgoTiwgBc7hcnwNzaW7yjJ+GBfoZINCtAR7oKSy7DbKQBRQVCJBZBx4tOsjh5l/eOLF1hEr3zdrHt6Mb7KG6bMbD2Wrgbseunc+ngyx/yaJPl8pk90h+l8mYZtNlnOWq1kbsChiLqJWtSLcl9arskTMG9G4s7jl4W0SdVoUC14KUpYAwpQW7xspa6w6CVaVVN8u6g7N5ZafJtaXyEKDgrpQ3qKuX+QbnlcDcIwKyNfYEWLZM+RYLQl0YxWrTZlbis9rsMktNi9lsOkXZm+Qqi+JkrVatDIlaCTa4CWD5ewv9cjz7L5c1NQTC9VShKWAXV4DuiktsqEqnaqdkQsdBWPtn3B71IydQdDDbZWK1X7uz22+n9KufZnPze7d1Bbl/0ZpDz+s/X76nNLUPzOsA2QyVOpdBLetMymzAZ0XrDk12FcB3ywB3E+qCH2Qmf6pfFwiAGn/FXaLSV7WxUsKJwLWgdb2EHddOC9CtoW7ble4ITNf76Kh9T0A6xZsIcF4sGNQG+y5jOrenWmdiE7eNwxT9yLcLY4Phy1W3tBP92obpvgsTvie30XSY19oINap9hC1L1w72tkz5VXD0rPE91RNN82Oe94KA5HZKprGDaeME14OK5UAwPapUKe+Ztx7HA1HI0mCtCh2idG2N5gINDfx7XmfzWly/n4mBbnKlOVJ9XBOY4njPUJsAtTeHYZvXuQMQA4Up4QhUBxyTrSaT7Xx0T7cO/Wc/ccNavM2zFFsrVBxRJuOAFsKTsE0LVczmInZW6Tv/ZV/Lx42L0HWx+5Bbm1ddc+OPLw7TBxi4qem9FZXpzqllsbhcRDglsZo4bvmXxSNLjq2bm6y+3JYs3tUARMLktCdPt77mp7+rIZiS3b7zJy7Wky+HNoc3Qdy66lQp6nWg0UwIXML2hIS7cLJzYBp3ELBPtSKtpUnbIlQqlo4etxNwqUbvLtOAIzNIN2fX1i1btr8zdb+Sst+gEq3U1jWqtHi3WovRr75cu4UeLp8RlSpcNqL/WA8um6/IHDXjC73VKa35sfivcYZPi1q5PWIn6KMVPVkxrB9nk/ctUCoZ9hv+gaOeibylg6kVOqy1dB0tZlRV2119Hu2wTC+BBozt4s1vXjqpvOarRZ4fzu8SKLWupBBslen7woh3AyBNjFW0ao8SwqSMH6aGwBGjeoNc7s7g2FkH9tQ9gfr3s6/bbHz/Qbdf5RYqC7Ci1hCmBYwKmU/bLHwHPUc7lGl+s9sVZcvmfLvt+WnYstn7Yvm1d03PZw4udM7GlXeOL684N+H54bOnurKEqS4uCiusNwlTjlnVm2OvcDOlAJzaAidBW7DqQ7EKP5npTN3dU53hvMjGErcBDGa/VaWAw1QmXIbph4BdmsJlOm2o3kwjTlJRl27DfHfLATJ2KdgAv8PT2RL8seqWeydEzQcT/tSG156eVFI9rdiPKVhw2Ke0xFQkFCxPZIfgeWZvWKnjGHYOAosAAY3qFGfjAjeSjolJu09kJp/7GWfq/BDqq2dfzce4DzlADqZTpYJ1alVVhnlsAWA7dsHv6AaVLTXinrRbWwk1o13OpEyifV16RdXX7xvvOjRY/8xNK5btX1p2VtzzcBThMLIxZcWmOKYoS4H0MOgVPdzNcc0lRpnWxMnh4KOKhDkL2Y8uA1atnLWed2twzjUF600IlS0VlcS+BaNObCZDVcqSQJWyYadUQIQdGlIly1KAtKb1qCQXOeOzUroM0ra9gV5ii0WezQBrpdC1KyhPNXWsqm245wix/QBf529cvWh8SfJz2ARgb6+QxiTzD06rTJEZZ3a/qCvHuOgi+tQwhijdtAoVBSNcAD3IHZTZ8PbV0W4XQH3pjKvXY0P/vzqVOeU5pfVDJRKsU2dUyS4txZ3Ubi/t2+a4DOAxhjgqtYmAlWy6LShtWd+1vO6/7sbm/oO58zat/kN9PHG71AIoCRCuKU6ElY7B+lqGcUTd6BjziVT7E82TPlI/TOQXxOQsqSst4X0zOPZT8r4EzQprR0JJTf33oLw1hOaU6QAyXqBYC1zsYJ9uQRO81OrN4Rm86bC7gTRsW/K2mVRQtPOtzKO1DT+b11vx/qZfunXtTVXxxEoOmQOvLS1SKKiA6+uB3dR6cHFS4JCZAiMq+2GixBhnIO/rQZASdV3p4Atq0APUl0+5KIXH6nN40hJlYlorTCgW9UmY0x+dCzj9uSTYA4DH69iB51XhGinw2+11NhO5xWrLgw0ygbfzjczXk9/42TIz76lB3dFiteAQlBt/NsYvW60Y1OpOWsyvwTJQEtHTUWU1SAUcFORBcE7whXHG8HFx5zMVDQVB7rqgoUFEuptSWeHyc+YsxHopy4ADGgXoTma6NOiSwLAc3PjuaxbrDB2XgajjicveF3DJbRsyxyTWvvV+5c2/PN6lDdS/ZNuaZVVFxfjlDw7amGSi8NxfC7B0ZHNa7RilKXBYgkNRlQswGZgkh3nMpxNfAU/IPLb4NKb1CJUZdSUTbgTQFxUqwWFmw5wnKK61DrJbTwUqb2gk9iAwe1JgG6Fr1w6GcQTSTblk27ttL1V8+54Z0fSBhCs88x3YS9dKu12+uguCfbwiU50oFbV1V2G+VwhZzQjsSCf0vgMTkJMN5PK7V6gLTz89U+IVX4QT1/syxeVMT6AEa9UZWRoI2ePGIlmPQ5XfeEfa12BP0DvzS0DUPtcZxNvWd/2u8pv3nhhN72/44i1rXyvxY3K70McSkIjcxSq1evpISaUAlZMOJU141qfERYloMExDioOvuc6Gy2NwIex6kk2+y0vOvmxzEPM/gzN/hofbwRSlolOqYq6vCjmWxDHiPdSq/fKVREPsecXYaIqGIzezumdinfU7mrJPDvZeQaWfeMrVWRxRa5GFOqPugFCFtKM6o4AZloQI7DxgzdJyLBmMMlPPP7xXpdKQ7vXps1+AOm8StRJkBGaYxpMVPkWVAJpAlQSX3EcrcN/sXe1EnMjy+0aXJX7PYpWsdGOmpsLc9/0C+35GWkz7YzJc2McJyDr8hpapwliOqxmtKhQF0gDKE6VyVtqw+HmAolSrYrFFPstxiF3ZzMl7hMo+vHH25behyP2hWiPTXrZYVDHSYmWAWmx7XjsB7zYfhnecsRxU4EQw5iiER7G6nl1kwD0ZdDVl5/SUvqe0fba+908MOEW76G08AjuupEqKh1dSAoeGkhx+EZyoF/kMK3QLmbbWnnVih3RMv6Cy9kunXzYHU3sBpz6XAVlbEeadKafeRB3W0hK0gPVLXGktznhQZ814XK71cQLD42vXMS24+3fH1kxd1eMPcu8zIHcR9ha4ES9bDq6rznWh13P3PRRRouCorDIRVmenDovg42yknzJmpFDRcA6yRrOj+w21wfNyVXWHXQqIT4ZAZSmIyd0qmf712GRTqcl856XVPX2V9cMeU8HfGHxyT1X1lI9fdcOtMwdLLY5IVpqDklVhqkCjHCOOaa4cwxpnktYVKhzFmGKL1/cbKttactxxXaMrii6EYl/gUkCQoc+dM86uJWOw+S9FtW4ZYMG+HNVD+364IJWltAbs0C2h5ZTFyIVjD7LIgENyyUrV6fC55YLxECBbd/asQfgyAVYK2/0xLlr2z/GKK1FWcq7x44tkjeX6ak9e9Msm2kvgKoDCqz57dJWw64cZ68n5+ZvRe6w3YgBUFVLeKmxCssKMKcVFCuJUl05fwlU4rj9MJzNns/sSwUzizC8VeEVpW/8kEukgg2+eOqO1Kqg8I+fFnqBanWIJuWQcbrIlcYeSPanBiauUHe3BMbkazfdX0TCPFcfe6aGmPpMacNJPZ7ICtQtnEQ74ov0OlDJOka4ChWshE6ftulUgUoiYHzjkFcSRxDiWmvcGBZV1rpw+fdfEoroZ2MP+Qu7+y1KA6gAzOTlJE+0Ut1mEx7dL2UlEBXQdwBf3v3mvOB5UHTb2cVY7EHfg6HGn4QQl9zs7sds+oW6UGVWcv4JSbopHFInK6Qs0KlsN1Jd0W8LdjbP5AhTGKPsqRjZ4x6sulL5y32d+vxHv0H+XNfI4lh6eNO1rU6Zrm31WRXgFt3EH3ma8NrFz3emn20cI/S+Pjd55vK9CPkls/j+97zgtHIGhCcDCztNxHAKURhY4fZuvay3ykMAHpbQhdVrmihIv9V8qKNab23TmzAbPj12BmzCdbjmoPBXbqcgWprey/U0vGl18b39to3atma4zGQ+ynrnyoInSJcUUsbKARZUiDEBCmuASuI6m8FbgBAlbASo+7b03Spf86d0hgcrubTpzxv0miJ2KdXU9wcZqi03FR/vY7EfGtKdgrDrR3n7i/t/dk133/IfGHnxcZ5CdxBPMWfVjzdjSMqsposj/Y7k8aISsJCVNgKtyHWQypI2zC8v75iGGhwwqK9t81icXl5T4U1DtQzxpFU+sMOUn1jFr8A6/qx7fv+xio0vNgOppzWQboCf/pMp6c2i53jiRCgSUFRoS8kBt9TY/n05VWjubR5WKQJlu11fcU/oNa3Amtrah8+r/9uQsrLN34B2kfTtW4wp8EV6rtC9T9LsV3w+KD62c19lw+Y39LmMNH9534tQNHalXJieri06tlj8ybHOEAkDKdMW3DWmy2BCKy3dgqfYCpwbOEOr0nyxd+fQnaDOkSo02uu2McxaY0spJge/fWjK5pi35yf2NVzaA8yIUWnx07aCAsh87Mun5k8ori07FDRMdOb7dlAUfQcQvyg0/MpUlkWn4wDmgGtN4mNbNFvXMc3Yuy8X3ir/for/WtbcFc7KprjkdS3ccnH4DJ/E+VOtXF6cTB1Re1fHtS+4fTId+NXrCLZWJou98vGYM+GCI4SgRAFi5OqLSIk7TkOfSZOFkxElSq5EY8qLrKVT6StnKZ04Oi7rAh+VXP//MlM4NqdnpZTtmZbe2j5ZfW7GNe5WJVHxs+aNd06ZeZU4/Um6CDLRfj4ydOL2+tOyxKcnaEt36RGrI80Gi4uO3S+b5SdZJ5BGaWGiCVkKD7uWQj+n+0dIVf31RjZyFi33Y/tx7i0yHN95Ux0eZxs415oGr8Lh18O7VA486uKq0dOGYkrIDqFA3VTXcw2AdI+s7O1IWlvAly5Fn1xxkZiAXB+735Sv+dgFjzunhcrER7LeectY+QVvn89iITuoOhcOKQtb8nofu7OjT6TRHDFERqqSSrVi0+8WxyaX/fPodmyzeXjtRRRvZ2+HUMdMOwm+kPQcOk9xaRz9UGTrAmFsO6DOuFprn+hiWt/lSxvIXkSKsgKXG73QHynpGPNSWY6ediovQf2KveARHK+O3EARbKC/EbNjBdHAdUPFtWYZprrZalmFmsx40taj80Jo7pUy3r0gV3XJGQLRl6se+gHcG7sEIEzJ4WefyU1WUhXEQjgAkDGJRMlZyTnn5AdNGAXbDI9Jnca8x5iWmli7/y7p8qXxoRCqVb4K0TPnYbbi4uB/3MxJOgZRP+NdvESQDBcoBi7oEVpgombShZcSFLIk2kqfpeBrvXd4bUNYSFo9UOayDfBGsJdf8EMaKu0+qPA47OhAHUhWHTAeN0BGWddImh+VsntakNTp1R4FAhbcmVyz8ZjSte3hEKTU466zylmzTs1CWAJXBCJWImpAYTnunMtogUUzh09qui8JQSrsjIbmwxI9c00shaQm3jr3nyw+t51svfboRBbV5a/svoc4TOeAQnFMhYLh/HDHD6hBSappm7Z0K1QrfAtGWwh/CjC4JTEV7m714cLG3YEEfr35oiyMGavOUj12GLs8SuQGMDNqpiEAsQoEVxizc6F8LlTLERJCMqK/ldd21VYWgYdeE+8VnJ19d+H6Y10dgREANjp1bhN/B/y+nJvGJQ1TncFi/hzRdW7vZCXhNE/QsJwcnf8CYi1vDKS/unZtc+reVfXAsyBrAbaOCch9qpNm8cTqeUo4XDm7eA4CIDj0Jp2qYgESGAcpNc3ZY1MmA5DGgLq9amyD1oCze4okFsU+XL37uH862P/6IgIrfWZoug5HB5iHmHw/pSUjgUHCwI2gHVBQniajF5rG+ELImM0nS7CmNvz03u3z5c09IxgC+RsT0x95znAzYTW3CtYCFIKKhWgsGT8L5BIVOxBFn8xWw5iEJbzZ5/5lc/oLcyY9Y9ys4MpQa8I86WuXRxz9CEF8UibGqPK0SGYWNHATNU+USvjNleRsnKmuPOtP4K/GXVixd+AiTB+NGBFQ8t1/H/zVI1US8CpQDJkt1SEVYovjir0Rqnk5m5glkB08MaS8ZrpJWtHU+gD7rEgbjjwiowIG/Uc2pCQAWRqjCyKgVn4Ue0raHIlpcOOpUd/UhaRveAD+nYulzSyJVDio4ItbUoKLoEdwnxa8SAhAUWADUQuboLb4CEEwTfJGDIb/YS+j6w3cBVnle7JTqIQDKxkcE1JqFC5sw/v/jfCYbFSFR4SPE5IvjcQjFJ047+SVPvgiSlWhBBh6prIqfVLV04RpGhsJJ9UNR0d6uI5g2LdnY3LkSlMa7k41IjRFxpIUAo87XjIJvQhbYntfuBf711cv+fk+BwRBERoRSOU5v4cK2WNz7DEJNVJouAXZyM85/XBrwj058wrVO1anpvu8vjPlm6t4AyuYizbrmh7ffdOxJU/E26NN4MQyvvlhZWulyMBrU7ZTCxyAlAN/3/o2/GdVQtfhFeT1nb410xCjVAahe8srSwE9MAbaHNQ1grTREvQi713CYD558vf8J/FbozOqD9z1ibwOVNrVjI/O78YRTP5LLZi/Ai8z/AXj7Aa78l/bYk76Pp/Hchv3DL409Wf3ii/Yv5Xw44/x/RtzikIene+sAAAAASUVORK5CYII="},1197:(e,i,s)=>{s.d(i,{A:()=>n});const n="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iODVweCIgaGVpZ2h0PSI5NnB4IiB2aWV3Qm94PSIwIDAgODUgOTYiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDQ2LjIgKDQ0NDk2KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT45Ni1sb2dvLU9ubHlTeW1ib2w8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZGVmcz4KICAgICAgICA8bGluZWFyR3JhZGllbnQgeDE9IjY2LjU0ODI1MzUlIiB5MT0iLTQuNjkyMTExNTglIiB4Mj0iODAuMjcxODE2NCUiIHkyPSIxMTEuMTg2NDIxJSIgaWQ9ImxpbmVhckdyYWRpZW50LTEiPgogICAgICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSIjN0FEODUyIiBvZmZzZXQ9IjAlIj48L3N0b3A+CiAgICAgICAgICAgIDxzdG9wIHN0b3AtY29sb3I9IiMzQUIzOEIiIG9mZnNldD0iNTMuNTg0Mjg1NyUiPjwvc3RvcD4KICAgICAgICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iIzAwQkZDOSIgb2Zmc2V0PSIxMDAlIj48L3N0b3A+CiAgICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgICAgICA8bGluZWFyR3JhZGllbnQgeDE9Ijc4LjA5MzczNTklIiB5MT0iMC43Mzc2MDQwNjUlIiB4Mj0iMjAuMzkzNjI1JSIgeTI9IjExOC42MjE4NjQlIiBpZD0ibGluZWFyR3JhZGllbnQtMiI+CiAgICAgICAgICAgIDxzdG9wIHN0b3AtY29sb3I9IiNGRjI5NTMiIG9mZnNldD0iMCUiPjwvc3RvcD4KICAgICAgICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iI0VBMzMzMyIgb2Zmc2V0PSIxMDAlIj48L3N0b3A+CiAgICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSJMb2dvLTIiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC02MDUuMDAwMDAwLCAtMTM3ODAuMDAwMDAwKSI+CiAgICAgICAgICAgIDxnIGlkPSJHcm91cC00IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg4MC4wMDAwMDAsIDEzMTkxLjAwMDAwMCkiPgogICAgICAgICAgICAgICAgPGcgaWQ9Ijk2LWxvZ28tT25seVN5bWJvbCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNTI1LjAwMDAwMCwgNTg5LjAwMDAwMCkiPgogICAgICAgICAgICAgICAgICAgIDxnIGlkPSJsb2dvLXN0LWNvcHktMiI+CiAgICAgICAgICAgICAgICAgICAgICAgIDxnIGlkPSJHcm91cCI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZyBpZD0iR3JvdXAtMy1Db3B5Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMjUuOTQ1OTUxNCwxLjgzMTgwNTk5IEMxOC4wNjc0NTY2LDUuMTgzODU2MjYgMC4wNjA4MjcwNzk1LDIyLjQ0MTA2MDQgMCwzNi4wMzk5NTQyIEMwLjEwNjA4MjIyMSw1MC4wOTgzNzkxIDE4LjA2NzQ1NjYsNjYuODk2NDk0IDI1Ljk0NTk1MTQsNzAuMjQ4NTQ0MiBDMjcuNzUyNDY1Niw3MS4wMTY2MjEyIDMwLjU1NTY2MjIsNzIuMDc5OTA4MyAzMy41MTYyNTI4LDcyLjA3OTkwODMgQzM2LjIxNjEzMjEsNzIuMDc5OTA4MyAzOC41MDIyMjI5LDcwLjc0NzYwNzIgNDAuODI4NDAxMyw2Ny45NDk3MzkgQzQ0LjczODE5MjIsNjMuMjQ2MjYyMiA0NC4yNjc3Mjc5LDU2LjQ4MzMzNjIgMzkuMDU3MDE4MSw1Mi42NDUxNjEzIEMzMi44MjE0ODg0LDQ4LjA1NDgxOSAyNy43MTgxNzMxLDQzLjkzNDYxODEgMjcuNjExNzc4MiwzNi4wMzk5NTQyIEMyNy43MTgxNzMxLDI4LjE0NTczMjEgMzIuODIxNDg4NCwyMi42MzU2NzgxIDM5LjA1NzAxODEsMTguMDQ0ODkzOSBDNDQuMjY3NzI3OSwxNC4yMDcxNjA5IDQ1LjI4MjU1NjEsOC4zODU2NDk4NCA0MS4zNzI3NjUyLDMuNjgyMTczMDkgQzM5LjA0NzAyNjUsMC44ODQzMDQ4OTIgMzYuMjE1NjkyNCwwIDMzLjUxNjI1MjgsMCBDMzAuNTU1MjIyNiwwIDI3Ljc1MjQ2NTYsMS4wNjMyODcxNCAyNS45NDU5NTE0LDEuODMxODA1OTkgWiIgaWQ9IkZpbGwtMSIgZmlsbD0idXJsKCNsaW5lYXJHcmFkaWVudC0xKSI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik00MC42OTY5Njk3LDY4LjEyOTAzMjMgQzQ0LjE1NDk3MjQsNjQuMTk1Nzg5NyA0NC41ODQyODE3LDU2LjM5MzE0MzQgMzkuMTU2NTUzMiw1Mi42NDUxNjEzIEMzMS41NDg1Mjg0LDQ3LjM5MTYzMDIgMjcuNjY0ODc2Myw0Mi4zODMzNDM2IDI3LjcxMDQyODYsMzUuOTY1MTYyMSBDMjcuNzYyMDg0LDI4LjY4NzA2MjIgMzIuMzkzNzk4MSwyNC4xMjk3NDk3IDMzLjU0ODEzMzUsMjIuNzA5Njc3NCBDMTYuMjcyNDI2Miw0Mi4xMDUxNTkyIDEzLjg3OTU1MzUsNjQuMDE5NDI2OSAzMC42MDQ2NDg4LDcxLjczOTUwMjUgQzM0LjQzMTQwNDQsNzMuMDcwMDI5NSAzNy43MDkxMTYsNzEuNTI3NTEyMiA0MC42OTY5Njk3LDY4LjEyOTAzMjMgWiIgaWQ9IkZpbGwtOSIgZmlsbD0iIzAwNTg5MiI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0zMi42MTg3OTg2LDYxLjE2NTkzMDUgQzM0LjgzODY0MjcsNTguNDM3ODY1NCAzNC42MjcyMjY2LDUzLjI2NTY3MjYgMzEuNjI5OTM3NCw1MC40MjY0NDM1IEMyNi44NjM5NjM1LDQ1LjkxMTggMjYuMDEzMDIzMiw0MS4wMDAzMzM2IDI2LjA0MjI2NTIsMzYuNTQ4NzM1MiBDMjYuMDc1NDI1MSwzMS41MDA3MDQyIDI5LjA0ODcyNjIsMjguMzM5Nzg5MyAyOS43ODk3NDQ5LDI3LjM1NDgzODcgQzE4LjY5OTcwOCw0MC44MDczODcyIDE1LjQwMzUxODksNTguMzE1NTQxNiAyNi4xNDAwOTM2LDYzLjY3MDEyMzMgQzI4LjU5NjY1NjUsNjQuNTkyOTY2IDMwLjcwMDc2MzgsNjMuNTIzMDg4NiAzMi42MTg3OTg2LDYxLjE2NTkzMDUgWiIgaWQ9IkZpbGwtOSIgZmlsbD0iIzAwNDE4RSI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0yNy45MTQ3NTI4LDU1Ljg5Nzc0NDcgQzI5LjMzMTMxMiw1NC4xNTY4NzIyIDI5LjE5NjQwMDEsNTAuODU2MzE3NCAyNy4yODM3MjY0LDQ5LjA0NDUwNzMgQzI0LjI0MjM5MzksNDYuMTYzNTU3NSAyMy42OTkzNzk1LDQzLjAyOTM4MTMgMjMuNzE4MDM5OSw0MC4xODg2NjI2IEMyMy43MzkyMDAzLDM2Ljk2NzMzOTggMjQuNzYwNDYxNCwzNC4xODY5NDkyIDIzLjA4MTczNzEsMzcuOTA4MDIyNyBDMjEuNDAzMDEyOCw0MS42MjkwOTYxIDE2LjkyOTA4ODcsNTQuMDc4ODEzMiAyMy43ODA0Njc2LDU3LjQ5NTc1NjYgQzI1LjM0ODA4NTEsNTguMDg0NjU0MyAyNi42OTA3ODg2LDU3LjQwMTkyODYgMjcuOTE0NzUyOCw1NS44OTc3NDQ3IFoiIGlkPSJGaWxsLTkiIGZpbGw9IiMwMDIzNTUiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxnIGlkPSJHcm91cC00LUNvcHkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDQxLjIxMjEyMSwgMjMuNzQxOTM1KSI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGcgaWQ9Ikdyb3VwLTUiPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTAuMjIwMTg1OCw3Mi4yMTc5NTYgQzcuNTMzNTY4MjcsNzIuMjE3OTU2IDQuNzE1NjgyODEsNzEuMzM0MTQzMiAyLjQwMDk5MTE4LDY4LjUzNzgzMTkgQy0xLjQ5MDIyODYxLDYzLjgzNjk3MjMgLTAuNDczNDkxNjQ2LDU4LjAxOTQ5MjMgNC43MTI0Njc3NSw1NC4xODM4OTQ4IEMxMC45MTgzNzkyLDQ5LjU5NTY2NTEgMTUuOTkwNzI1MSw0NC4wODc4ODU1IDE2LjA5NjYxNDYsMzYuMTk4MDU2MSBDMTUuOTkwNzI1MSwyOC4zMDc3ODUxIDEwLjkxMTk1MTMsMjMuMDY3NzEzNSA0LjcxMjQ2Nzc1LDE4LjQ1NjE5MTYgQzAuMTM1NDgwMTk1LDE1LjA1MTU3MjcgLTEuNDkwMjI4NjEsOC41NTg2OTgyMiAyLjQwMDk5MTE4LDMuODU3ODM4NyBDNC43MTYxMjAzNywxLjA2MTUyNzM1IDcuNTMzMTMwNzEsMC4xNzgxNTYyMTQgMTAuMjIwMTg1OCwwLjE3ODE1NjIxNCBDMTMuMTY2NzEzOCwwLjE3ODE1NjIxNCAxNS45NTY1OTU1LDEuMjQwODUxNyAxNy43NTQ1Mjg5LDIuMDA4NTAxMjIgQzI1LjU5NTYwMTUsNS4zNTg2ODYyNiA0My40MzY2Mjk4LDIyLjEwNTY4IDQzLjU3NDc5MjQsMzYuMTk4MDU2MSBDNDMuNTMwNjA3LDQ5LjQ4MDg2MjYgMjUuNTk1NjAxNSw2Ny4wMzY5ODQzIDE3Ljc1NDUyODksNzAuMzg3MTY5MyBDMTUuOTU2NTk1NSw3MS4xNTUyNjA1IDEzLjE2NzE1MTQsNzIuMjE3OTU2IDEwLjIyMDE4NTgsNzIuMjE3OTU2IFoiIGlkPSJGaWxsLTEtQ29weS02IiBmaWxsPSJ1cmwoI2xpbmVhckdyYWRpZW50LTIpIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0yMi41NTc0NTc2LDQ1LjY5MDc1MzYgQzI2LjAzMzA5NjYsNDEuNzU3NTExMSAyNS40NDM2MjA2LDM0LjY5ODUyMTMgMTkuOTg4MjEsMzAuOTUwNTM5MyBDMTIuMzQxMzgzNCwyNS42OTcwMDgxIDguNjk1Njc1NDYsMTkuNjczNjY2MiA4Ljc0MTQ2MDAzLDEzLjI1NTQ4NDcgQzguNzkzMzc4ODksNS45NzczODQ3NyAxMy40NDg3MTUzLDEuNDIwMDcyMzMgMTQuNjA4OTM4LC03LjEwNTQyNzM2ZS0xNSBDLTMuNDM2MTQ1NzgsMTMuMjU1NDg0NyAtNS4xNTk5NTQyMSw0MS4zMDk3NDk1IDExLjY1MDQ0MTEsNDkuMDI5ODI1MSBDMTUuNDk2NzEzNyw1MC4zNjAzNTIgMTkuNTU0MzY1NSw0OS4wODkyMzM2IDIyLjU1NzQ1NzYsNDUuNjkwNzUzNiBaIiBpZD0iRmlsbC05IiBmaWxsPSIjNDcwMDAwIiBvcGFjaXR5PSIwLjYwMDAwMDAyNCIgc3R5bGU9Im1peC1ibGVuZC1tb2RlOiBtdWx0aXBseTsiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEyLjM2MzYzNiwgMjQuNzc0MTk0KSByb3RhdGUoLTE4MC4wMDAwMDApIHRyYW5zbGF0ZSgtMTIuMzYzNjM2LCAtMjQuNzc0MTk0KSAiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTIzLjI4NTEwNzMsNDAuNjk1Nzg2NyBDMjUuNTA0OTUxNCwzNy45Njc3MjE3IDI1LjI5MzUzNTMsMzIuNzk1NTI4OCAyMi4yOTYyNDYxLDI5Ljk1NjI5OTcgQzE3LjUzMDI3MjIsMjUuNDQxNjU2MiAxNi42NzkzMzE4LDIwLjUzMDE4OTkgMTYuNzA4NTczOCwxNi4wNzg1OTE0IEMxNi43NDE3MzM3LDExLjAzMDU2MDQgMTcuNzUxNzE5Niw4LjcyNjg4NjExIDE4LjQ5MjczODMsNy43NDE5MzU0OCBDOS40NjY1MDI0NywxOC4zNTAyNjI4IDYuNTE2MTE2NiwzOC4wNzY5NTg2IDE2LjgwNjQwMjMsNDMuMTk5OTc5NSBDMTkuMjYyOTY1Miw0NC4xMjI4MjIyIDIxLjM2NzA3MjUsNDMuMDUyOTQ0OCAyMy4yODUxMDczLDQwLjY5NTc4NjcgWiIgaWQ9IkZpbGwtOS1Db3B5IiBmaWxsPSIjNjcwMDEwIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxNy41MzgwNDQsIDI1LjYzNTg5Nikgcm90YXRlKC0xODAuMDAwMDAwKSB0cmFuc2xhdGUoLTE3LjUzODA0NCwgLTI1LjYzNTg5NikgIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0yMy44ODkwNDU5LDMzLjk3MzI2MDggQzI1LjMwNTYwNSwzMi4yMzIzODgzIDI1LjE3MDY5MzEsMjguOTMxODMzNSAyMy4yNTgwMTk0LDI3LjEyMDAyMzQgQzIwLjIxNjY4NjksMjQuMjM5MDczNiAxOS4xOTg1MTcyLDIwLjU4MjE5NSAxOS4wODQ0MjE4LDE4LjU1NDczMzMgQzE4Ljk0MzY5NTYsMTYuMDU0MDQ2OCAxOC45NjAyNjU4LDE1LjY5OTAyMjcgMTkuMzk4NjY0MiwxMy45MzU0ODM5IEMxOC4wNjA1NzgzLDE2LjM0NDg4OTIgMTIuMjAwOTQzMSwzMi45NzE0MzY2IDE5Ljc1NDc2MDYsMzUuNTcxMjcyNyBDMjEuMzIyMzc4MiwzNi4xNjAxNzA1IDIyLjY2NTA4MTcsMzUuNDc3NDQ0OCAyMy44ODkwNDU5LDMzLjk3MzI2MDggWiIgaWQ9IkZpbGwtOS1Db3B5LTIiIGZpbGw9IiM3MzAwMDAiIHN0eWxlPSJtaXgtYmxlbmQtbW9kZTogbXVsdGlwbHk7IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgyMC40MDQxMjgsIDI0Ljg1ODYzMSkgcm90YXRlKC0xODAuMDAwMDAwKSB0cmFuc2xhdGUoLTIwLjQwNDEyOCwgLTI0Ljg1ODYzMSkgIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4="},8453:(e,i,s)=>{s.d(i,{R:()=>I,x:()=>g});var n=s(6540);const t={},M=n.createContext(t);function I(e){const i=n.useContext(M);return n.useMemo((function(){return"function"==typeof e?e(i):{...i,...e}}),[i,e])}function g(e){let i;return i=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:I(e.components),n.createElement(M.Provider,{value:i},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[6827],{5895:(e,i,s)=>{s.r(i),s.d(i,{assets:()=>l,contentTitle:()=>g,default:()=>j,frontMatter:()=>I,metadata:()=>n,toc:()=>c});const n=JSON.parse('{"id":"style-guide","title":"Style Guide","description":"You can write content using GitHub-flavored Markdown syntax.","source":"@site/docs/style-guide.md","sourceDirName":".","slug":"/style-guide","permalink":"/docs/style-guide","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/style-guide.md","tags":[],"version":"current","frontMatter":{"id":"style-guide","title":"Style Guide","sidebar_label":"Style Guide"}}');var t=s(4848),M=s(8453);const I={id:"style-guide",title:"Style Guide",sidebar_label:"Style Guide"},g=void 0,l={},c=[{value:"Markdown Syntax",id:"markdown-syntax",level:2},{value:"Headers",id:"headers",level:2},{value:"H2 - Create the best documentation",id:"h2---create-the-best-documentation",level:2},{value:"H3 - Create the best documentation",id:"h3---create-the-best-documentation",level:3},{value:"H4 - Create the best documentation",id:"h4---create-the-best-documentation",level:4},{value:"H5 - Create the best documentation",id:"h5---create-the-best-documentation",level:5},{value:"H6 - Create the best documentation",id:"h6---create-the-best-documentation",level:6},{value:"Emphasis",id:"emphasis",level:2},{value:"Lists",id:"lists",level:2},{value:"Links",id:"links",level:2},{value:"Images",id:"images",level:2},{value:"Code",id:"code",level:2},{value:"Tables",id:"tables",level:2},{value:"Blockquotes",id:"blockquotes",level:2},{value:"Inline HTML",id:"inline-html",level:2},{value:"Line Breaks",id:"line-breaks",level:2},{value:"Admonitions",id:"admonitions",level:2}];function A(e){const i={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",del:"del",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",hr:"hr",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,M.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(i.p,{children:["You can write content using ",(0,t.jsx)(i.a,{href:"https://github.github.com/gfm/",children:"GitHub-flavored Markdown syntax"}),"."]}),"\n",(0,t.jsx)(i.h2,{id:"markdown-syntax",children:"Markdown Syntax"}),"\n",(0,t.jsx)(i.p,{children:"To serve as an example page when styling markdown based Docusaurus sites."}),"\n",(0,t.jsx)(i.h2,{id:"headers",children:"Headers"}),"\n",(0,t.jsx)(i.h1,{id:"h1---create-the-best-documentation",children:"H1 - Create the best documentation"}),"\n",(0,t.jsx)(i.h2,{id:"h2---create-the-best-documentation",children:"H2 - Create the best documentation"}),"\n",(0,t.jsx)(i.h3,{id:"h3---create-the-best-documentation",children:"H3 - Create the best documentation"}),"\n",(0,t.jsx)(i.h4,{id:"h4---create-the-best-documentation",children:"H4 - Create the best documentation"}),"\n",(0,t.jsx)(i.h5,{id:"h5---create-the-best-documentation",children:"H5 - Create the best documentation"}),"\n",(0,t.jsx)(i.h6,{id:"h6---create-the-best-documentation",children:"H6 - Create the best documentation"}),"\n",(0,t.jsx)(i.hr,{}),"\n",(0,t.jsx)(i.h2,{id:"emphasis",children:"Emphasis"}),"\n",(0,t.jsxs)(i.p,{children:["Emphasis, aka italics, with ",(0,t.jsx)(i.em,{children:"asterisks"})," or ",(0,t.jsx)(i.em,{children:"underscores"}),"."]}),"\n",(0,t.jsxs)(i.p,{children:["Strong emphasis, aka bold, with ",(0,t.jsx)(i.strong,{children:"asterisks"})," or ",(0,t.jsx)(i.strong,{children:"underscores"}),"."]}),"\n",(0,t.jsxs)(i.p,{children:["Combined emphasis with ",(0,t.jsxs)(i.strong,{children:["asterisks and ",(0,t.jsx)(i.em,{children:"underscores"})]}),"."]}),"\n",(0,t.jsxs)(i.p,{children:["Strikethrough uses two tildes. ",(0,t.jsx)(i.del,{children:"Scratch this."})]}),"\n",(0,t.jsx)(i.hr,{}),"\n",(0,t.jsx)(i.h2,{id:"lists",children:"Lists"}),"\n",(0,t.jsxs)(i.ol,{children:["\n",(0,t.jsx)(i.li,{children:"First ordered list item"}),"\n",(0,t.jsxs)(i.li,{children:["Another item","\n",(0,t.jsxs)(i.ul,{children:["\n",(0,t.jsx)(i.li,{children:"Unordered sub-list."}),"\n"]}),"\n"]}),"\n",(0,t.jsxs)(i.li,{children:["Actual numbers don't matter, just that it's a number","\n",(0,t.jsxs)(i.ol,{children:["\n",(0,t.jsx)(i.li,{children:"Ordered sub-list"}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(i.li,{children:"And another item."}),"\n"]}),"\n",(0,t.jsxs)(i.ul,{children:["\n",(0,t.jsx)(i.li,{children:"Unordered list can use asterisks"}),"\n"]}),"\n",(0,t.jsxs)(i.ul,{children:["\n",(0,t.jsx)(i.li,{children:"Or minuses"}),"\n"]}),"\n",(0,t.jsxs)(i.ul,{children:["\n",(0,t.jsx)(i.li,{children:"Or pluses"}),"\n"]}),"\n",(0,t.jsx)(i.hr,{}),"\n",(0,t.jsx)(i.h2,{id:"links",children:"Links"}),"\n",(0,t.jsx)(i.p,{children:(0,t.jsx)(i.a,{href:"https://www.google.com/",children:"I'm an inline-style link"})}),"\n",(0,t.jsx)(i.p,{children:(0,t.jsx)(i.a,{href:"https://www.google.com/",title:"Google's Homepage",children:"I'm an inline-style link with title"})}),"\n",(0,t.jsx)(i.p,{children:(0,t.jsx)(i.a,{href:"https://www.mozilla.org/",children:"I'm a reference-style link"})}),"\n",(0,t.jsx)(i.p,{children:(0,t.jsx)(i.a,{href:"http://slashdot.org/",children:"You can use numbers for reference-style link definitions"})}),"\n",(0,t.jsxs)(i.p,{children:["Or leave it empty and use the ",(0,t.jsx)(i.a,{href:"http://www.reddit.com/",children:"link text itself"}),"."]}),"\n",(0,t.jsxs)(i.p,{children:["URLs will automatically get turned into links. ",(0,t.jsx)(i.a,{href:"http://www.example.com/",children:"http://www.example.com/"})," and sometimes example.com (but not on GitHub, for example)."]}),"\n",(0,t.jsx)(i.p,{children:"Some text to show that the reference links can follow later."}),"\n",(0,t.jsx)(i.hr,{}),"\n",(0,t.jsx)(i.h2,{id:"images",children:"Images"}),"\n",(0,t.jsx)(i.p,{children:"Here's our logo (hover to see the title text):"}),"\n",(0,t.jsxs)(i.p,{children:["Inline-style: ",(0,t.jsx)(i.img,{alt:"alt text",src:s(9795).A+"",title:"Logo Title Text 1",width:"85",height:"96"})]}),"\n",(0,t.jsxs)(i.p,{children:["Reference-style: ",(0,t.jsx)(i.img,{src:"/img/branding/logo/PNG/96-logo-OnlySymbol.png",alt:"alt text",title:"Logo Title Text 2"})]}),"\n",(0,t.jsx)(i.p,{children:"Images from any folder can be used by providing path to file. Path should be relative to markdown file."}),"\n",(0,t.jsx)(i.p,{children:(0,t.jsx)(i.img,{alt:"img",src:s(1197).A+"",width:"85",height:"96"})}),"\n",(0,t.jsx)(i.hr,{}),"\n",(0,t.jsx)(i.h2,{id:"code",children:"Code"}),"\n",(0,t.jsx)(i.pre,{children:(0,t.jsx)(i.code,{className:"language-javascript",children:"var s = 'JavaScript syntax highlighting';\nalert(s);\n"})}),"\n",(0,t.jsx)(i.pre,{children:(0,t.jsx)(i.code,{className:"language-python",children:'s = "Python syntax highlighting"\nprint(s)\n'})}),"\n",(0,t.jsx)(i.pre,{children:(0,t.jsx)(i.code,{children:"No language indicated, so no syntax highlighting.\nBut let's throw in a tag.\n"})}),"\n",(0,t.jsx)(i.pre,{children:(0,t.jsx)(i.code,{className:"language-js",metastring:"{2}",children:"function highlightMe() {\n console.log('This line can be highlighted!');\n}\n"})}),"\n",(0,t.jsx)(i.hr,{}),"\n",(0,t.jsx)(i.h2,{id:"tables",children:"Tables"}),"\n",(0,t.jsx)(i.p,{children:"Colons can be used to align columns."}),"\n",(0,t.jsxs)(i.table,{children:[(0,t.jsx)(i.thead,{children:(0,t.jsxs)(i.tr,{children:[(0,t.jsx)(i.th,{children:"Tables"}),(0,t.jsx)(i.th,{style:{textAlign:"center"},children:"Are"}),(0,t.jsx)(i.th,{style:{textAlign:"right"},children:"Cool"})]})}),(0,t.jsxs)(i.tbody,{children:[(0,t.jsxs)(i.tr,{children:[(0,t.jsx)(i.td,{children:"col 3 is"}),(0,t.jsx)(i.td,{style:{textAlign:"center"},children:"right-aligned"}),(0,t.jsx)(i.td,{style:{textAlign:"right"},children:"$1600"})]}),(0,t.jsxs)(i.tr,{children:[(0,t.jsx)(i.td,{children:"col 2 is"}),(0,t.jsx)(i.td,{style:{textAlign:"center"},children:"centered"}),(0,t.jsx)(i.td,{style:{textAlign:"right"},children:"$12"})]}),(0,t.jsxs)(i.tr,{children:[(0,t.jsx)(i.td,{children:"zebra stripes"}),(0,t.jsx)(i.td,{style:{textAlign:"center"},children:"are neat"}),(0,t.jsx)(i.td,{style:{textAlign:"right"},children:"$1"})]})]})]}),"\n",(0,t.jsx)(i.p,{children:"There must be at least 3 dashes separating each header cell. The outer pipes (|) are optional, and you don't need to make the raw Markdown line up prettily. You can also use inline Markdown."}),"\n",(0,t.jsxs)(i.table,{children:[(0,t.jsx)(i.thead,{children:(0,t.jsxs)(i.tr,{children:[(0,t.jsx)(i.th,{children:"Markdown"}),(0,t.jsx)(i.th,{children:"Less"}),(0,t.jsx)(i.th,{children:"Pretty"})]})}),(0,t.jsxs)(i.tbody,{children:[(0,t.jsxs)(i.tr,{children:[(0,t.jsx)(i.td,{children:(0,t.jsx)(i.em,{children:"Still"})}),(0,t.jsx)(i.td,{children:(0,t.jsx)(i.code,{children:"renders"})}),(0,t.jsx)(i.td,{children:(0,t.jsx)(i.strong,{children:"nicely"})})]}),(0,t.jsxs)(i.tr,{children:[(0,t.jsx)(i.td,{children:"1"}),(0,t.jsx)(i.td,{children:"2"}),(0,t.jsx)(i.td,{children:"3"})]})]})]}),"\n",(0,t.jsx)(i.hr,{}),"\n",(0,t.jsx)(i.h2,{id:"blockquotes",children:"Blockquotes"}),"\n",(0,t.jsxs)(i.blockquote,{children:["\n",(0,t.jsx)(i.p,{children:"Blockquotes are very handy in email to emulate reply text. This line is part of the same quote."}),"\n"]}),"\n",(0,t.jsx)(i.p,{children:"Quote break."}),"\n",(0,t.jsxs)(i.blockquote,{children:["\n",(0,t.jsxs)(i.p,{children:["This is a very long line that will still be quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can ",(0,t.jsx)(i.em,{children:"put"})," ",(0,t.jsx)(i.strong,{children:"Markdown"})," into a blockquote."]}),"\n"]}),"\n",(0,t.jsx)(i.hr,{}),"\n",(0,t.jsx)(i.h2,{id:"inline-html",children:"Inline HTML"}),"\n",(0,t.jsxs)("dl",{children:[(0,t.jsx)("dt",{children:"Definition list"}),(0,t.jsx)("dd",{children:"Is something people use sometimes."}),(0,t.jsx)("dt",{children:"Markdown in HTML"}),(0,t.jsxs)("dd",{children:["Does ",(0,t.jsx)(i.em,{children:"not"})," work ",(0,t.jsx)(i.strong,{children:"very"})," well. Use HTML ",(0,t.jsx)("em",{children:"tags"}),"."]})]}),"\n",(0,t.jsx)(i.hr,{}),"\n",(0,t.jsx)(i.h2,{id:"line-breaks",children:"Line Breaks"}),"\n",(0,t.jsx)(i.p,{children:"Here's a line for us to start with."}),"\n",(0,t.jsxs)(i.p,{children:["This line is separated from the one above by two newlines, so it will be a ",(0,t.jsx)(i.em,{children:"separate paragraph"}),"."]}),"\n",(0,t.jsxs)(i.p,{children:["This line is also a separate paragraph, but... This line is only separated by a single newline, so it's a separate line in the ",(0,t.jsx)(i.em,{children:"same paragraph"}),"."]}),"\n",(0,t.jsx)(i.hr,{}),"\n",(0,t.jsx)(i.h2,{id:"admonitions",children:"Admonitions"}),"\n",(0,t.jsx)(i.admonition,{type:"note",children:(0,t.jsx)(i.p,{children:"This is a note"})}),"\n",(0,t.jsx)(i.admonition,{type:"tip",children:(0,t.jsx)(i.p,{children:"This is a tip"})}),"\n",(0,t.jsx)(i.admonition,{type:"important",children:(0,t.jsx)(i.p,{children:"This is important"})}),"\n",(0,t.jsx)(i.admonition,{type:"caution",children:(0,t.jsx)(i.p,{children:"This is a caution"})}),"\n",(0,t.jsx)(i.admonition,{type:"warning",children:(0,t.jsx)(i.p,{children:"This is a warning"})})]})}function j(e={}){const{wrapper:i}={...(0,M.R)(),...e.components};return i?(0,t.jsx)(i,{...e,children:(0,t.jsx)(A,{...e})}):A(e)}},9795:(e,i,s)=>{s.d(i,{A:()=>n});const n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFUAAABgCAYAAABsQj5EAAAAAXNSR0IArs4c6QAAHzBJREFUeAHVnQt0XFW5x/c5M5m8Ju+GtrxKaYECBWl5sxCLXCgoUgoWQQTrgvaKgogo4INlrniXaC9cBBWQK3aJCK6CoiIIKBREoNK3tIC00NLS0meezSSTmTn3//++vc+cSZM0CSkr2c3Mfn379Tv/vc8+j6Se+ZDdt9dcfEA6HZxrjHcKmj7GM2Z0LvCqTRA0er7ZGBjzTDwWe/TWwx589UPu2pA1hzHtfXf7hutK32/d8tlskLvSBOakwhY98ARKzzOuMxr1flcUS1x/6+Hz1xXaD/+YG8de6em9wdyif69quxrQbkQDowmOAD34gIsffMERp4QkTfi69EaYTr9t8shS7V6Dev3qz56Wy3n3BLngcEIUNQpBAiVC+GxduWpcIgTsEqV7LbF4fPrtR8x/hcVHgpNeD2VHG1Y1JJpza74PYtfngpyvdXdrxipy93Yd5by9xb++pLjoqB9Nur919zLDL8UOemg6dv3qK8Y1Zt9+KZsz38DHDwIq1MfHM1CtwQlJw/CNQTo/TIPv8qJhphmUhz8u1ZH9wdD0cu/XkpfEB2zrKys+fwam7W9BqC46rfMT2U1rNqn6C9dX27asCgw7EwS4FHDNRVIqGSvd79aj72605sPWGxKlXrPy85dCTU/mcqYuRxBQGFXGj1NillNeVGeQHlGoVXBoL+qNKJe2qDMbeKXNuc5Zw5ZkpGPxSHhQwS8vn/01TPX/8QLP49SlCHP4yBkeNcoJCnAZZ7rKULUaShL5zomN7KkIk+VhxQDKezlvirMbzv6goQKW9+UVV8zL5YLrOUABINNUASFdQBgCw0+QUxu3E1ArTm86jUlQvqhk6lOhEih2ETALxuVthm9oUFAbggb/S8uunI9xXkYgCkoHqZAYJkk7cPgMcmVUJTLCpYGpULfQU1tXxOPJy5YSM61vl1oN7+9BQd28dOPd0JEA5fBURYRUwEdGTpACjxBpSwXiejQExXyQdgombGaqTklboprseeskYZh/DRjq3CVzfggGc62IZHg8GUmcMadAgcNk/vN1XUS2wAJdAhbgLAPH5UFUS4+qtE7hIx9txIz3lEsfzv6AoF65eO5NOMPfoEA4UAxNIoSgqVQdweHEBZ8hTm9Oe+bTabrzmSzKlRzUInDFUL+Er9S3Zr/j91kYyRm2wX5DnbP4qi9mc7kfuGmq09OCEoAcI7Vnp7kMmWdw2BAUprwcBVEyrXgYrCJhwppsbVKSdYljHj5ezLu5wWvI2Mxh7dme993HOUuunp7NZp8AIN3nuCkuxbpXwbjiceJ0B0IXRgCCCfNolS/tlJ1XcmjhmQd+deJPL++7l8Mnd49Knbv42gPT2cyDmJY+pymdnpg07IYiamIePjLlbQbjApfrrnVYQgQsLZlP53YCGne2WIu94AV/n1Fz1WpkfMf66iZvjmzvbP0LThITdVoDAuFQagQioPK+THGbLjAFmtrqtT6hM07BaznnuzpdvWLneQ9XjzIX/nzCjzr76udwy+tTqW+37bgDl5bHU06hoojTqo7qEhXKfFZFyslJ4g4+r7BY2sF1YbVnxW45CBvx0UJgbnngpDsasHS4pocbu177w5H26C5/5drP4dbdA+QRDlosWSQPJlo4HL0LuILisxT1B4XaQhourAum7VDy7N+ccvuCaN0jKdwj1Nkvf/UgnGZfA9Ry5WfN3PjhOzCFg4WdOwo2w4lUDoWUVxtXFRVM2PR9z2yM+cGMX598x9LCekdWrMfp35kLfo5BlnPN1DM3BmXpFMDhWC1EuVICGMrahbWIQpTLU5iLOsFQ6g2Ls1bv1eIi/7z5J8x7H5ER7TiaAnfJy9d9Psia+U5J9Asdi2iuwOPUtk4guoj4qkKCpNutTpdgzBJTGj9jwXE/bBbDEf6VJ4KBfGlVQ3JHY8saBEcXAsrDIUgRJL7IRL/goyabRRmKWiUxRElj2mBdlQPBpjHxc/4qP1F22oJTGnaKwSC+zjKmvMyY+iPK66tf27Vt81RjtjXoJccgavvgRQqm//amXTcGOW+0CEhw5+EQhE5h0pOfwtbtjkBshK7d08oxQBkWk6PAgB6kwMQb0zFz3p8HAfQaY4o/UnfIN9qy6QsyQe6QuBcDV+N/vLo8h7U5taCo/K0TK8b++YDiqoe81Y+uKuzs3o1hhOoueeVbo9PprreRwM6p0qgoAURffihCC4ecFE6oSEITFUaKEWqkjIvgTn+wq6l41l9nfu9R7UH/v39Rf9hFrZmO27Hm79e9FJoK5wauVszU8npzQsWYVUWxovtMeckvvUUPtnQvM9Tx8LIo3Zm5Bp0so9LkMQg36KIofbTBNG7ao49C3CMSbpQkXfIZJmz7SCQsww2/1knbTe+UPT4YoD+uPui7zV2pB3GsAZRHkc75DGmY31kYLW7ban67/d9HNqVTd5i29nXB5Au+FUybXSLF9tKXQL1sxbxyPA25ikD1OZKCETi83MdzJIUE4LjEFDhII2QBasPOXn2tiweGZfjsiul8qrppXXnzju3V8sRgIOP6cfW4m3Hj+mbMEF222AULUXyJR2tUxNu7OszD2980mzvbanCJ/d/B1ubXgskzz4xaDmVYoLY27bw4m/Vq5XGyVZOEAZRqdA/zXL7AISDkK0AFp8rGAeCBEIUqSKdQprc0Fpn31hb//e0brn1rIAO5uXLM8RmTuwnHBrdVu5V0cV20kUmd8hNmmI5c1vxuxxqzJc2HB8EEwH0qOPLCnwQnzypFwpA6gQolXkLFcfB4iKeKEmhoHiB02ltAkh5Vrg2LagGZquaBgO+AO8BdGc8se746G6ss+epAR5H04j/zPb9MuDleUZ8VOobO7wa3C4X/sHOtac2mmePlguyXg5auRcExFx4y0P70Ze/Peq5hDMCdLhDc1BZACkunL0FFVadroypS00OI9uAQpBwM+G7JeP2lJM9T72644Str++pU97wvJpKT455/NBmKAi00jVtrpvUGOYQbmFQuY55sXIfx0BjLQ2COCtLZxVgO8Cbi0Di/3WSnYYr7hCCQCI9qo9Kc2ggG6cxXQBakS4NPmeRtGKZa0W3WhfIbViXM+lWlpjSZ/dNAuz6xvPYyHIyEsESAK6Xud7UmXTmlC3mwNEb7uzIZs6Oj0zSn06aLHUL6ZiwBy3dt1cKIY52uRH2PBUfOnKOJH+wbJL1T8ipUME5heiJSoALMqtDBdvkCOwI4PEA8GCiTTvvmjWfLjYnhpQjfv3+gXcY9iENZRuGpPvUyV/CG1RG0A9zRlTXr2trMhrZdZltHh9ncnjJvt7Sare0dhGgWtW0R1apiUXcQxPCq58+zk89vCCscZMDHwTsuuvYpIBw9Kg2geHDpC2iJq/J0WbA2sBWVC3Q9MFKWoKHUFX8qM11Z38QTQXbrLdevGGhfcWaq7V7GwZN0dE/i8Ak71ZUx6wGzI5stKMbDsbOz07zbyryMWRJRqx4qGATBd7NHzrwvmDWrz3vNBRV3i/i4TByryoKKBKAFxDM4ociyoKBCcDZdoRcCl6XDlmHZtqaY2f4mdkBFnokXBx3d2u9XFNcJe37bz1JJ4yy/oa09VGxPDRA2FbyqbbvJYI1VpxVwqQ2C7JXZ1ekFwbSGgivOnurqKc3HU5L6EB5h4ENYbknQsFsCFLhToU5/C1zK6kFw6qbdysdxgcb+YurH48GgXobwTWx9T50vSOOxhWvsSMv01ljv3ymA3ZhqN2s6mzFWe0RYh60HoZm57cvmIy+f0nt1BTmA6mEJcEqELycWp1BVK+EIQJ6odgOuZcILB6hd1A3I777cado22vZQhbxuVdB8/yLvpVv/yOJ7ss6gE02d6T2Zhfk8gS1v3S5XzgoTiwgBc7hcnwNzaW7yjJ+GBfoZINCtAR7oKSy7DbKQBRQVCJBZBx4tOsjh5l/eOLF1hEr3zdrHt6Mb7KG6bMbD2Wrgbseunc+ngyx/yaJPl8pk90h+l8mYZtNlnOWq1kbsChiLqJWtSLcl9arskTMG9G4s7jl4W0SdVoUC14KUpYAwpQW7xspa6w6CVaVVN8u6g7N5ZafJtaXyEKDgrpQ3qKuX+QbnlcDcIwKyNfYEWLZM+RYLQl0YxWrTZlbis9rsMktNi9lsOkXZm+Qqi+JkrVatDIlaCTa4CWD5ewv9cjz7L5c1NQTC9VShKWAXV4DuiktsqEqnaqdkQsdBWPtn3B71IydQdDDbZWK1X7uz22+n9KufZnPze7d1Bbl/0ZpDz+s/X76nNLUPzOsA2QyVOpdBLetMymzAZ0XrDk12FcB3ywB3E+qCH2Qmf6pfFwiAGn/FXaLSV7WxUsKJwLWgdb2EHddOC9CtoW7ble4ITNf76Kh9T0A6xZsIcF4sGNQG+y5jOrenWmdiE7eNwxT9yLcLY4Phy1W3tBP92obpvgsTvie30XSY19oINap9hC1L1w72tkz5VXD0rPE91RNN82Oe94KA5HZKprGDaeME14OK5UAwPapUKe+Ztx7HA1HI0mCtCh2idG2N5gINDfx7XmfzWly/n4mBbnKlOVJ9XBOY4njPUJsAtTeHYZvXuQMQA4Up4QhUBxyTrSaT7Xx0T7cO/Wc/ccNavM2zFFsrVBxRJuOAFsKTsE0LVczmInZW6Tv/ZV/Lx42L0HWx+5Bbm1ddc+OPLw7TBxi4qem9FZXpzqllsbhcRDglsZo4bvmXxSNLjq2bm6y+3JYs3tUARMLktCdPt77mp7+rIZiS3b7zJy7Wky+HNoc3Qdy66lQp6nWg0UwIXML2hIS7cLJzYBp3ELBPtSKtpUnbIlQqlo4etxNwqUbvLtOAIzNIN2fX1i1btr8zdb+Sst+gEq3U1jWqtHi3WovRr75cu4UeLp8RlSpcNqL/WA8um6/IHDXjC73VKa35sfivcYZPi1q5PWIn6KMVPVkxrB9nk/ctUCoZ9hv+gaOeibylg6kVOqy1dB0tZlRV2119Hu2wTC+BBozt4s1vXjqpvOarRZ4fzu8SKLWupBBslen7woh3AyBNjFW0ao8SwqSMH6aGwBGjeoNc7s7g2FkH9tQ9gfr3s6/bbHz/Qbdf5RYqC7Ci1hCmBYwKmU/bLHwHPUc7lGl+s9sVZcvmfLvt+WnYstn7Yvm1d03PZw4udM7GlXeOL684N+H54bOnurKEqS4uCiusNwlTjlnVm2OvcDOlAJzaAidBW7DqQ7EKP5npTN3dU53hvMjGErcBDGa/VaWAw1QmXIbph4BdmsJlOm2o3kwjTlJRl27DfHfLATJ2KdgAv8PT2RL8seqWeydEzQcT/tSG156eVFI9rdiPKVhw2Ke0xFQkFCxPZIfgeWZvWKnjGHYOAosAAY3qFGfjAjeSjolJu09kJp/7GWfq/BDqq2dfzce4DzlADqZTpYJ1alVVhnlsAWA7dsHv6AaVLTXinrRbWwk1o13OpEyifV16RdXX7xvvOjRY/8xNK5btX1p2VtzzcBThMLIxZcWmOKYoS4H0MOgVPdzNcc0lRpnWxMnh4KOKhDkL2Y8uA1atnLWed2twzjUF600IlS0VlcS+BaNObCZDVcqSQJWyYadUQIQdGlIly1KAtKb1qCQXOeOzUroM0ra9gV5ii0WezQBrpdC1KyhPNXWsqm245wix/QBf529cvWh8SfJz2ARgb6+QxiTzD06rTJEZZ3a/qCvHuOgi+tQwhijdtAoVBSNcAD3IHZTZ8PbV0W4XQH3pjKvXY0P/vzqVOeU5pfVDJRKsU2dUyS4txZ3Ubi/t2+a4DOAxhjgqtYmAlWy6LShtWd+1vO6/7sbm/oO58zat/kN9PHG71AIoCRCuKU6ElY7B+lqGcUTd6BjziVT7E82TPlI/TOQXxOQsqSst4X0zOPZT8r4EzQprR0JJTf33oLw1hOaU6QAyXqBYC1zsYJ9uQRO81OrN4Rm86bC7gTRsW/K2mVRQtPOtzKO1DT+b11vx/qZfunXtTVXxxEoOmQOvLS1SKKiA6+uB3dR6cHFS4JCZAiMq+2GixBhnIO/rQZASdV3p4Atq0APUl0+5KIXH6nN40hJlYlorTCgW9UmY0x+dCzj9uSTYA4DH69iB51XhGinw2+11NhO5xWrLgw0ygbfzjczXk9/42TIz76lB3dFiteAQlBt/NsYvW60Y1OpOWsyvwTJQEtHTUWU1SAUcFORBcE7whXHG8HFx5zMVDQVB7rqgoUFEuptSWeHyc+YsxHopy4ADGgXoTma6NOiSwLAc3PjuaxbrDB2XgajjicveF3DJbRsyxyTWvvV+5c2/PN6lDdS/ZNuaZVVFxfjlDw7amGSi8NxfC7B0ZHNa7RilKXBYgkNRlQswGZgkh3nMpxNfAU/IPLb4NKb1CJUZdSUTbgTQFxUqwWFmw5wnKK61DrJbTwUqb2gk9iAwe1JgG6Fr1w6GcQTSTblk27ttL1V8+54Z0fSBhCs88x3YS9dKu12+uguCfbwiU50oFbV1V2G+VwhZzQjsSCf0vgMTkJMN5PK7V6gLTz89U+IVX4QT1/syxeVMT6AEa9UZWRoI2ePGIlmPQ5XfeEfa12BP0DvzS0DUPtcZxNvWd/2u8pv3nhhN72/44i1rXyvxY3K70McSkIjcxSq1evpISaUAlZMOJU141qfERYloMExDioOvuc6Gy2NwIex6kk2+y0vOvmxzEPM/gzN/hofbwRSlolOqYq6vCjmWxDHiPdSq/fKVREPsecXYaIqGIzezumdinfU7mrJPDvZeQaWfeMrVWRxRa5GFOqPugFCFtKM6o4AZloQI7DxgzdJyLBmMMlPPP7xXpdKQ7vXps1+AOm8StRJkBGaYxpMVPkWVAJpAlQSX3EcrcN/sXe1EnMjy+0aXJX7PYpWsdGOmpsLc9/0C+35GWkz7YzJc2McJyDr8hpapwliOqxmtKhQF0gDKE6VyVtqw+HmAolSrYrFFPstxiF3ZzMl7hMo+vHH25behyP2hWiPTXrZYVDHSYmWAWmx7XjsB7zYfhnecsRxU4EQw5iiER7G6nl1kwD0ZdDVl5/SUvqe0fba+908MOEW76G08AjuupEqKh1dSAoeGkhx+EZyoF/kMK3QLmbbWnnVih3RMv6Cy9kunXzYHU3sBpz6XAVlbEeadKafeRB3W0hK0gPVLXGktznhQZ814XK71cQLD42vXMS24+3fH1kxd1eMPcu8zIHcR9ha4ES9bDq6rznWh13P3PRRRouCorDIRVmenDovg42yknzJmpFDRcA6yRrOj+w21wfNyVXWHXQqIT4ZAZSmIyd0qmf712GRTqcl856XVPX2V9cMeU8HfGHxyT1X1lI9fdcOtMwdLLY5IVpqDklVhqkCjHCOOaa4cwxpnktYVKhzFmGKL1/cbKttactxxXaMrii6EYl/gUkCQoc+dM86uJWOw+S9FtW4ZYMG+HNVD+364IJWltAbs0C2h5ZTFyIVjD7LIgENyyUrV6fC55YLxECBbd/asQfgyAVYK2/0xLlr2z/GKK1FWcq7x44tkjeX6ak9e9Msm2kvgKoDCqz57dJWw64cZ68n5+ZvRe6w3YgBUFVLeKmxCssKMKcVFCuJUl05fwlU4rj9MJzNns/sSwUzizC8VeEVpW/8kEukgg2+eOqO1Kqg8I+fFnqBanWIJuWQcbrIlcYeSPanBiauUHe3BMbkazfdX0TCPFcfe6aGmPpMacNJPZ7ICtQtnEQ74ov0OlDJOka4ChWshE6ftulUgUoiYHzjkFcSRxDiWmvcGBZV1rpw+fdfEoroZ2MP+Qu7+y1KA6gAzOTlJE+0Ut1mEx7dL2UlEBXQdwBf3v3mvOB5UHTb2cVY7EHfg6HGn4QQl9zs7sds+oW6UGVWcv4JSbopHFInK6Qs0KlsN1Jd0W8LdjbP5AhTGKPsqRjZ4x6sulL5y32d+vxHv0H+XNfI4lh6eNO1rU6Zrm31WRXgFt3EH3ma8NrFz3emn20cI/S+Pjd55vK9CPkls/j+97zgtHIGhCcDCztNxHAKURhY4fZuvay3ykMAHpbQhdVrmihIv9V8qKNab23TmzAbPj12BmzCdbjmoPBXbqcgWprey/U0vGl18b39to3atma4zGQ+ynrnyoInSJcUUsbKARZUiDEBCmuASuI6m8FbgBAlbASo+7b03Spf86d0hgcrubTpzxv0miJ2KdXU9wcZqi03FR/vY7EfGtKdgrDrR3n7i/t/dk133/IfGHnxcZ5CdxBPMWfVjzdjSMqsposj/Y7k8aISsJCVNgKtyHWQypI2zC8v75iGGhwwqK9t81icXl5T4U1DtQzxpFU+sMOUn1jFr8A6/qx7fv+xio0vNgOppzWQboCf/pMp6c2i53jiRCgSUFRoS8kBt9TY/n05VWjubR5WKQJlu11fcU/oNa3Amtrah8+r/9uQsrLN34B2kfTtW4wp8EV6rtC9T9LsV3w+KD62c19lw+Y39LmMNH9534tQNHalXJieri06tlj8ybHOEAkDKdMW3DWmy2BCKy3dgqfYCpwbOEOr0nyxd+fQnaDOkSo02uu2McxaY0spJge/fWjK5pi35yf2NVzaA8yIUWnx07aCAsh87Mun5k8ori07FDRMdOb7dlAUfQcQvyg0/MpUlkWn4wDmgGtN4mNbNFvXMc3Yuy8X3ir/for/WtbcFc7KprjkdS3ccnH4DJ/E+VOtXF6cTB1Re1fHtS+4fTId+NXrCLZWJou98vGYM+GCI4SgRAFi5OqLSIk7TkOfSZOFkxElSq5EY8qLrKVT6StnKZ04Oi7rAh+VXP//MlM4NqdnpZTtmZbe2j5ZfW7GNe5WJVHxs+aNd06ZeZU4/Um6CDLRfj4ydOL2+tOyxKcnaEt36RGrI80Gi4uO3S+b5SdZJ5BGaWGiCVkKD7uWQj+n+0dIVf31RjZyFi33Y/tx7i0yHN95Ux0eZxs415oGr8Lh18O7VA486uKq0dOGYkrIDqFA3VTXcw2AdI+s7O1IWlvAly5Fn1xxkZiAXB+735Sv+dgFjzunhcrER7LeectY+QVvn89iITuoOhcOKQtb8nofu7OjT6TRHDFERqqSSrVi0+8WxyaX/fPodmyzeXjtRRRvZ2+HUMdMOwm+kPQcOk9xaRz9UGTrAmFsO6DOuFprn+hiWt/lSxvIXkSKsgKXG73QHynpGPNSWY6ediovQf2KveARHK+O3EARbKC/EbNjBdHAdUPFtWYZprrZalmFmsx40taj80Jo7pUy3r0gV3XJGQLRl6se+gHcG7sEIEzJ4WefyU1WUhXEQjgAkDGJRMlZyTnn5AdNGAXbDI9Jnca8x5iWmli7/y7p8qXxoRCqVb4K0TPnYbbi4uB/3MxJOgZRP+NdvESQDBcoBi7oEVpgombShZcSFLIk2kqfpeBrvXd4bUNYSFo9UOayDfBGsJdf8EMaKu0+qPA47OhAHUhWHTAeN0BGWddImh+VsntakNTp1R4FAhbcmVyz8ZjSte3hEKTU466zylmzTs1CWAJXBCJWImpAYTnunMtogUUzh09qui8JQSrsjIbmwxI9c00shaQm3jr3nyw+t51svfboRBbV5a/svoc4TOeAQnFMhYLh/HDHD6hBSappm7Z0K1QrfAtGWwh/CjC4JTEV7m714cLG3YEEfr35oiyMGavOUj12GLs8SuQGMDNqpiEAsQoEVxizc6F8LlTLERJCMqK/ldd21VYWgYdeE+8VnJ19d+H6Y10dgREANjp1bhN/B/y+nJvGJQ1TncFi/hzRdW7vZCXhNE/QsJwcnf8CYi1vDKS/unZtc+reVfXAsyBrAbaOCch9qpNm8cTqeUo4XDm7eA4CIDj0Jp2qYgESGAcpNc3ZY1MmA5DGgLq9amyD1oCze4okFsU+XL37uH862P/6IgIrfWZoug5HB5iHmHw/pSUjgUHCwI2gHVBQniajF5rG+ELImM0nS7CmNvz03u3z5c09IxgC+RsT0x95znAzYTW3CtYCFIKKhWgsGT8L5BIVOxBFn8xWw5iEJbzZ5/5lc/oLcyY9Y9ys4MpQa8I86WuXRxz9CEF8UibGqPK0SGYWNHATNU+USvjNleRsnKmuPOtP4K/GXVixd+AiTB+NGBFQ8t1/H/zVI1US8CpQDJkt1SEVYovjir0Rqnk5m5glkB08MaS8ZrpJWtHU+gD7rEgbjjwiowIG/Uc2pCQAWRqjCyKgVn4Ue0raHIlpcOOpUd/UhaRveAD+nYulzSyJVDio4ItbUoKLoEdwnxa8SAhAUWADUQuboLb4CEEwTfJGDIb/YS+j6w3cBVnle7JTqIQDKxkcE1JqFC5sw/v/jfCYbFSFR4SPE5IvjcQjFJ047+SVPvgiSlWhBBh6prIqfVLV04RpGhsJJ9UNR0d6uI5g2LdnY3LkSlMa7k41IjRFxpIUAo87XjIJvQhbYntfuBf711cv+fk+BwRBERoRSOU5v4cK2WNz7DEJNVJouAXZyM85/XBrwj058wrVO1anpvu8vjPlm6t4AyuYizbrmh7ffdOxJU/E26NN4MQyvvlhZWulyMBrU7ZTCxyAlAN/3/o2/GdVQtfhFeT1nb410xCjVAahe8srSwE9MAbaHNQ1grTREvQi713CYD558vf8J/FbozOqD9z1ibwOVNrVjI/O78YRTP5LLZi/Ai8z/AXj7Aa78l/bYk76Pp/Hchv3DL409Wf3ii/Yv5Xw44/x/RtzikIene+sAAAAASUVORK5CYII="},1197:(e,i,s)=>{s.d(i,{A:()=>n});const n="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iODVweCIgaGVpZ2h0PSI5NnB4IiB2aWV3Qm94PSIwIDAgODUgOTYiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDQ2LjIgKDQ0NDk2KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT45Ni1sb2dvLU9ubHlTeW1ib2w8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZGVmcz4KICAgICAgICA8bGluZWFyR3JhZGllbnQgeDE9IjY2LjU0ODI1MzUlIiB5MT0iLTQuNjkyMTExNTglIiB4Mj0iODAuMjcxODE2NCUiIHkyPSIxMTEuMTg2NDIxJSIgaWQ9ImxpbmVhckdyYWRpZW50LTEiPgogICAgICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSIjN0FEODUyIiBvZmZzZXQ9IjAlIj48L3N0b3A+CiAgICAgICAgICAgIDxzdG9wIHN0b3AtY29sb3I9IiMzQUIzOEIiIG9mZnNldD0iNTMuNTg0Mjg1NyUiPjwvc3RvcD4KICAgICAgICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iIzAwQkZDOSIgb2Zmc2V0PSIxMDAlIj48L3N0b3A+CiAgICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgICAgICA8bGluZWFyR3JhZGllbnQgeDE9Ijc4LjA5MzczNTklIiB5MT0iMC43Mzc2MDQwNjUlIiB4Mj0iMjAuMzkzNjI1JSIgeTI9IjExOC42MjE4NjQlIiBpZD0ibGluZWFyR3JhZGllbnQtMiI+CiAgICAgICAgICAgIDxzdG9wIHN0b3AtY29sb3I9IiNGRjI5NTMiIG9mZnNldD0iMCUiPjwvc3RvcD4KICAgICAgICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iI0VBMzMzMyIgb2Zmc2V0PSIxMDAlIj48L3N0b3A+CiAgICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSJMb2dvLTIiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC02MDUuMDAwMDAwLCAtMTM3ODAuMDAwMDAwKSI+CiAgICAgICAgICAgIDxnIGlkPSJHcm91cC00IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg4MC4wMDAwMDAsIDEzMTkxLjAwMDAwMCkiPgogICAgICAgICAgICAgICAgPGcgaWQ9Ijk2LWxvZ28tT25seVN5bWJvbCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNTI1LjAwMDAwMCwgNTg5LjAwMDAwMCkiPgogICAgICAgICAgICAgICAgICAgIDxnIGlkPSJsb2dvLXN0LWNvcHktMiI+CiAgICAgICAgICAgICAgICAgICAgICAgIDxnIGlkPSJHcm91cCI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZyBpZD0iR3JvdXAtMy1Db3B5Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMjUuOTQ1OTUxNCwxLjgzMTgwNTk5IEMxOC4wNjc0NTY2LDUuMTgzODU2MjYgMC4wNjA4MjcwNzk1LDIyLjQ0MTA2MDQgMCwzNi4wMzk5NTQyIEMwLjEwNjA4MjIyMSw1MC4wOTgzNzkxIDE4LjA2NzQ1NjYsNjYuODk2NDk0IDI1Ljk0NTk1MTQsNzAuMjQ4NTQ0MiBDMjcuNzUyNDY1Niw3MS4wMTY2MjEyIDMwLjU1NTY2MjIsNzIuMDc5OTA4MyAzMy41MTYyNTI4LDcyLjA3OTkwODMgQzM2LjIxNjEzMjEsNzIuMDc5OTA4MyAzOC41MDIyMjI5LDcwLjc0NzYwNzIgNDAuODI4NDAxMyw2Ny45NDk3MzkgQzQ0LjczODE5MjIsNjMuMjQ2MjYyMiA0NC4yNjc3Mjc5LDU2LjQ4MzMzNjIgMzkuMDU3MDE4MSw1Mi42NDUxNjEzIEMzMi44MjE0ODg0LDQ4LjA1NDgxOSAyNy43MTgxNzMxLDQzLjkzNDYxODEgMjcuNjExNzc4MiwzNi4wMzk5NTQyIEMyNy43MTgxNzMxLDI4LjE0NTczMjEgMzIuODIxNDg4NCwyMi42MzU2NzgxIDM5LjA1NzAxODEsMTguMDQ0ODkzOSBDNDQuMjY3NzI3OSwxNC4yMDcxNjA5IDQ1LjI4MjU1NjEsOC4zODU2NDk4NCA0MS4zNzI3NjUyLDMuNjgyMTczMDkgQzM5LjA0NzAyNjUsMC44ODQzMDQ4OTIgMzYuMjE1NjkyNCwwIDMzLjUxNjI1MjgsMCBDMzAuNTU1MjIyNiwwIDI3Ljc1MjQ2NTYsMS4wNjMyODcxNCAyNS45NDU5NTE0LDEuODMxODA1OTkgWiIgaWQ9IkZpbGwtMSIgZmlsbD0idXJsKCNsaW5lYXJHcmFkaWVudC0xKSI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik00MC42OTY5Njk3LDY4LjEyOTAzMjMgQzQ0LjE1NDk3MjQsNjQuMTk1Nzg5NyA0NC41ODQyODE3LDU2LjM5MzE0MzQgMzkuMTU2NTUzMiw1Mi42NDUxNjEzIEMzMS41NDg1Mjg0LDQ3LjM5MTYzMDIgMjcuNjY0ODc2Myw0Mi4zODMzNDM2IDI3LjcxMDQyODYsMzUuOTY1MTYyMSBDMjcuNzYyMDg0LDI4LjY4NzA2MjIgMzIuMzkzNzk4MSwyNC4xMjk3NDk3IDMzLjU0ODEzMzUsMjIuNzA5Njc3NCBDMTYuMjcyNDI2Miw0Mi4xMDUxNTkyIDEzLjg3OTU1MzUsNjQuMDE5NDI2OSAzMC42MDQ2NDg4LDcxLjczOTUwMjUgQzM0LjQzMTQwNDQsNzMuMDcwMDI5NSAzNy43MDkxMTYsNzEuNTI3NTEyMiA0MC42OTY5Njk3LDY4LjEyOTAzMjMgWiIgaWQ9IkZpbGwtOSIgZmlsbD0iIzAwNTg5MiI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0zMi42MTg3OTg2LDYxLjE2NTkzMDUgQzM0LjgzODY0MjcsNTguNDM3ODY1NCAzNC42MjcyMjY2LDUzLjI2NTY3MjYgMzEuNjI5OTM3NCw1MC40MjY0NDM1IEMyNi44NjM5NjM1LDQ1LjkxMTggMjYuMDEzMDIzMiw0MS4wMDAzMzM2IDI2LjA0MjI2NTIsMzYuNTQ4NzM1MiBDMjYuMDc1NDI1MSwzMS41MDA3MDQyIDI5LjA0ODcyNjIsMjguMzM5Nzg5MyAyOS43ODk3NDQ5LDI3LjM1NDgzODcgQzE4LjY5OTcwOCw0MC44MDczODcyIDE1LjQwMzUxODksNTguMzE1NTQxNiAyNi4xNDAwOTM2LDYzLjY3MDEyMzMgQzI4LjU5NjY1NjUsNjQuNTkyOTY2IDMwLjcwMDc2MzgsNjMuNTIzMDg4NiAzMi42MTg3OTg2LDYxLjE2NTkzMDUgWiIgaWQ9IkZpbGwtOSIgZmlsbD0iIzAwNDE4RSI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0yNy45MTQ3NTI4LDU1Ljg5Nzc0NDcgQzI5LjMzMTMxMiw1NC4xNTY4NzIyIDI5LjE5NjQwMDEsNTAuODU2MzE3NCAyNy4yODM3MjY0LDQ5LjA0NDUwNzMgQzI0LjI0MjM5MzksNDYuMTYzNTU3NSAyMy42OTkzNzk1LDQzLjAyOTM4MTMgMjMuNzE4MDM5OSw0MC4xODg2NjI2IEMyMy43MzkyMDAzLDM2Ljk2NzMzOTggMjQuNzYwNDYxNCwzNC4xODY5NDkyIDIzLjA4MTczNzEsMzcuOTA4MDIyNyBDMjEuNDAzMDEyOCw0MS42MjkwOTYxIDE2LjkyOTA4ODcsNTQuMDc4ODEzMiAyMy43ODA0Njc2LDU3LjQ5NTc1NjYgQzI1LjM0ODA4NTEsNTguMDg0NjU0MyAyNi42OTA3ODg2LDU3LjQwMTkyODYgMjcuOTE0NzUyOCw1NS44OTc3NDQ3IFoiIGlkPSJGaWxsLTkiIGZpbGw9IiMwMDIzNTUiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxnIGlkPSJHcm91cC00LUNvcHkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDQxLjIxMjEyMSwgMjMuNzQxOTM1KSI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGcgaWQ9Ikdyb3VwLTUiPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTAuMjIwMTg1OCw3Mi4yMTc5NTYgQzcuNTMzNTY4MjcsNzIuMjE3OTU2IDQuNzE1NjgyODEsNzEuMzM0MTQzMiAyLjQwMDk5MTE4LDY4LjUzNzgzMTkgQy0xLjQ5MDIyODYxLDYzLjgzNjk3MjMgLTAuNDczNDkxNjQ2LDU4LjAxOTQ5MjMgNC43MTI0Njc3NSw1NC4xODM4OTQ4IEMxMC45MTgzNzkyLDQ5LjU5NTY2NTEgMTUuOTkwNzI1MSw0NC4wODc4ODU1IDE2LjA5NjYxNDYsMzYuMTk4MDU2MSBDMTUuOTkwNzI1MSwyOC4zMDc3ODUxIDEwLjkxMTk1MTMsMjMuMDY3NzEzNSA0LjcxMjQ2Nzc1LDE4LjQ1NjE5MTYgQzAuMTM1NDgwMTk1LDE1LjA1MTU3MjcgLTEuNDkwMjI4NjEsOC41NTg2OTgyMiAyLjQwMDk5MTE4LDMuODU3ODM4NyBDNC43MTYxMjAzNywxLjA2MTUyNzM1IDcuNTMzMTMwNzEsMC4xNzgxNTYyMTQgMTAuMjIwMTg1OCwwLjE3ODE1NjIxNCBDMTMuMTY2NzEzOCwwLjE3ODE1NjIxNCAxNS45NTY1OTU1LDEuMjQwODUxNyAxNy43NTQ1Mjg5LDIuMDA4NTAxMjIgQzI1LjU5NTYwMTUsNS4zNTg2ODYyNiA0My40MzY2Mjk4LDIyLjEwNTY4IDQzLjU3NDc5MjQsMzYuMTk4MDU2MSBDNDMuNTMwNjA3LDQ5LjQ4MDg2MjYgMjUuNTk1NjAxNSw2Ny4wMzY5ODQzIDE3Ljc1NDUyODksNzAuMzg3MTY5MyBDMTUuOTU2NTk1NSw3MS4xNTUyNjA1IDEzLjE2NzE1MTQsNzIuMjE3OTU2IDEwLjIyMDE4NTgsNzIuMjE3OTU2IFoiIGlkPSJGaWxsLTEtQ29weS02IiBmaWxsPSJ1cmwoI2xpbmVhckdyYWRpZW50LTIpIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0yMi41NTc0NTc2LDQ1LjY5MDc1MzYgQzI2LjAzMzA5NjYsNDEuNzU3NTExMSAyNS40NDM2MjA2LDM0LjY5ODUyMTMgMTkuOTg4MjEsMzAuOTUwNTM5MyBDMTIuMzQxMzgzNCwyNS42OTcwMDgxIDguNjk1Njc1NDYsMTkuNjczNjY2MiA4Ljc0MTQ2MDAzLDEzLjI1NTQ4NDcgQzguNzkzMzc4ODksNS45NzczODQ3NyAxMy40NDg3MTUzLDEuNDIwMDcyMzMgMTQuNjA4OTM4LC03LjEwNTQyNzM2ZS0xNSBDLTMuNDM2MTQ1NzgsMTMuMjU1NDg0NyAtNS4xNTk5NTQyMSw0MS4zMDk3NDk1IDExLjY1MDQ0MTEsNDkuMDI5ODI1MSBDMTUuNDk2NzEzNyw1MC4zNjAzNTIgMTkuNTU0MzY1NSw0OS4wODkyMzM2IDIyLjU1NzQ1NzYsNDUuNjkwNzUzNiBaIiBpZD0iRmlsbC05IiBmaWxsPSIjNDcwMDAwIiBvcGFjaXR5PSIwLjYwMDAwMDAyNCIgc3R5bGU9Im1peC1ibGVuZC1tb2RlOiBtdWx0aXBseTsiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEyLjM2MzYzNiwgMjQuNzc0MTk0KSByb3RhdGUoLTE4MC4wMDAwMDApIHRyYW5zbGF0ZSgtMTIuMzYzNjM2LCAtMjQuNzc0MTk0KSAiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTIzLjI4NTEwNzMsNDAuNjk1Nzg2NyBDMjUuNTA0OTUxNCwzNy45Njc3MjE3IDI1LjI5MzUzNTMsMzIuNzk1NTI4OCAyMi4yOTYyNDYxLDI5Ljk1NjI5OTcgQzE3LjUzMDI3MjIsMjUuNDQxNjU2MiAxNi42NzkzMzE4LDIwLjUzMDE4OTkgMTYuNzA4NTczOCwxNi4wNzg1OTE0IEMxNi43NDE3MzM3LDExLjAzMDU2MDQgMTcuNzUxNzE5Niw4LjcyNjg4NjExIDE4LjQ5MjczODMsNy43NDE5MzU0OCBDOS40NjY1MDI0NywxOC4zNTAyNjI4IDYuNTE2MTE2NiwzOC4wNzY5NTg2IDE2LjgwNjQwMjMsNDMuMTk5OTc5NSBDMTkuMjYyOTY1Miw0NC4xMjI4MjIyIDIxLjM2NzA3MjUsNDMuMDUyOTQ0OCAyMy4yODUxMDczLDQwLjY5NTc4NjcgWiIgaWQ9IkZpbGwtOS1Db3B5IiBmaWxsPSIjNjcwMDEwIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxNy41MzgwNDQsIDI1LjYzNTg5Nikgcm90YXRlKC0xODAuMDAwMDAwKSB0cmFuc2xhdGUoLTE3LjUzODA0NCwgLTI1LjYzNTg5NikgIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0yMy44ODkwNDU5LDMzLjk3MzI2MDggQzI1LjMwNTYwNSwzMi4yMzIzODgzIDI1LjE3MDY5MzEsMjguOTMxODMzNSAyMy4yNTgwMTk0LDI3LjEyMDAyMzQgQzIwLjIxNjY4NjksMjQuMjM5MDczNiAxOS4xOTg1MTcyLDIwLjU4MjE5NSAxOS4wODQ0MjE4LDE4LjU1NDczMzMgQzE4Ljk0MzY5NTYsMTYuMDU0MDQ2OCAxOC45NjAyNjU4LDE1LjY5OTAyMjcgMTkuMzk4NjY0MiwxMy45MzU0ODM5IEMxOC4wNjA1NzgzLDE2LjM0NDg4OTIgMTIuMjAwOTQzMSwzMi45NzE0MzY2IDE5Ljc1NDc2MDYsMzUuNTcxMjcyNyBDMjEuMzIyMzc4MiwzNi4xNjAxNzA1IDIyLjY2NTA4MTcsMzUuNDc3NDQ0OCAyMy44ODkwNDU5LDMzLjk3MzI2MDggWiIgaWQ9IkZpbGwtOS1Db3B5LTIiIGZpbGw9IiM3MzAwMDAiIHN0eWxlPSJtaXgtYmxlbmQtbW9kZTogbXVsdGlwbHk7IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgyMC40MDQxMjgsIDI0Ljg1ODYzMSkgcm90YXRlKC0xODAuMDAwMDAwKSB0cmFuc2xhdGUoLTIwLjQwNDEyOCwgLTI0Ljg1ODYzMSkgIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4="},8453:(e,i,s)=>{s.d(i,{R:()=>I,x:()=>g});var n=s(6540);const t={},M=n.createContext(t);function I(e){const i=n.useContext(M);return n.useMemo((function(){return"function"==typeof e?e(i):{...i,...e}}),[i,e])}function g(e){let i;return i=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:I(e.components),n.createElement(M.Provider,{value:i},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/bc80c935.03708a6d.js b/assets/js/bc80c935.677b496d.js similarity index 98% rename from assets/js/bc80c935.03708a6d.js rename to assets/js/bc80c935.677b496d.js index c676c1cf..a0c7dde7 100644 --- a/assets/js/bc80c935.03708a6d.js +++ b/assets/js/bc80c935.677b496d.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[2346],{4055:(e,s,r)=>{r.r(s),r.d(s,{assets:()=>a,contentTitle:()=>d,default:()=>x,frontMatter:()=>i,metadata:()=>n,toc:()=>h});const n=JSON.parse('{"id":"references/cheatsheet","title":"Cheatsheet","description":"CSS Terminology","source":"@site/docs/references/cheatsheet.mdx","sourceDirName":"references","slug":"/references/cheatsheet","permalink":"/docs/references/cheatsheet","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/cheatsheet.mdx","tags":[],"version":"current","frontMatter":{"id":"cheatsheet","title":"Cheatsheet"},"sidebar":"Specification Reference","next":{"title":"Class Selector","permalink":"/docs/references/class-selectors"}}');var l=r(4848),t=r(8453),c=r(2250);const i={id:"cheatsheet",title:"Cheatsheet"},d=void 0,a={},h=[{value:"CSS Terminology",id:"css-terminology",level:2},{value:"Syntax",id:"syntax",level:2},{value:"Selectors",id:"selectors",level:3},{value:"Module system",id:"module-system",level:3},{value:"Class extensions",id:"class-extensions",level:3},{value:"Templating",id:"templating",level:3},{value:"Other",id:"other",level:3}];function o(e){const s={a:"a",h2:"h2",h3:"h3",li:"li",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,t.R)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.h2,{id:"css-terminology",children:"CSS Terminology"}),"\n",(0,l.jsxs)(s.ul,{children:["\n",(0,l.jsxs)(s.li,{children:[(0,l.jsx)(s.strong,{children:"selector"}),": query to target elements in the DOM"]}),"\n",(0,l.jsxs)(s.li,{children:[(0,l.jsx)(s.strong,{children:"property"}),": Name of the declaration (e.g. color)"]}),"\n",(0,l.jsxs)(s.li,{children:[(0,l.jsx)(s.strong,{children:"declaration"}),": CSS property paired with a value"]}),"\n",(0,l.jsxs)(s.li,{children:[(0,l.jsx)(s.strong,{children:"declaration Block"}),": List of CSS declarations"]}),"\n",(0,l.jsxs)(s.li,{children:[(0,l.jsx)(s.strong,{children:"ruleset"}),": CSS declaration block paired with a selector"]}),"\n"]}),"\n",(0,l.jsxs)(s.p,{children:["See MDN ",(0,l.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Syntax#CSS_Declarations",children:"How CSS is structured"})," and css-tricks ",(0,l.jsx)(s.a,{href:"https://css-tricks.com/css-ruleset-terminology/",children:"Ruleset Terminology"})," for detailed explanation of CSS naming and structure."]}),"\n",(0,l.jsx)(s.h2,{id:"syntax",children:"Syntax"}),"\n",(0,l.jsx)(s.p,{children:"Syntax that is unique to Stylable or extended from CSS."}),"\n",(0,l.jsx)(s.h3,{id:"selectors",children:"Selectors"}),"\n",(0,l.jsxs)(s.table,{children:[(0,l.jsx)(s.thead,{children:(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.th,{children:"Syntax"}),(0,l.jsx)(s.th,{children:"Explanations"})]})}),(0,l.jsxs)(s.tbody,{children:[(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:".x {}"})}),(0,l.jsxs)(s.td,{children:["Class selector (",(0,l.jsx)(s.a,{href:"/docs/references/class-selectors",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:"x {}"})}),(0,l.jsxs)(s.td,{children:["Element type selector (",(0,l.jsx)(s.a,{href:"/docs/references/type-selectors",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:":x {}"})}),(0,l.jsxs)(s.td,{children:["Pseudo-class or custom state selector (",(0,l.jsx)(s.a,{href:"/docs/references/pseudo-classes",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:"::x {}"})}),(0,l.jsxs)(s.td,{children:["Pseudo-element or custom-element selector (",(0,l.jsx)(s.a,{href:"/docs/references/pseudo-elements",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:":--x {}"})}),(0,l.jsxs)(s.td,{children:["custom selector (",(0,l.jsx)(s.a,{href:"/docs/references/custom-selectors",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:":global() {}"})}),(0,l.jsxs)(s.td,{children:["disables selector namespacing (",(0,l.jsx)(s.a,{href:"/docs/references/global-selectors",children:"api"}),")"]})]})]})]}),"\n",(0,l.jsx)(s.h3,{id:"module-system",children:"Module system"}),"\n",(0,l.jsxs)(s.table,{children:[(0,l.jsx)(s.thead,{children:(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.th,{children:"Syntax"}),(0,l.jsx)(s.th,{children:"Explanations"})]})}),(0,l.jsxs)(s.tbody,{children:[(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:"@st-import X from './y.st.css';"})}),(0,l.jsxs)(s.td,{children:["Import stylesheet's root (",(0,l.jsx)(s.a,{href:"/docs/references/imports#default-import",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:"@st-import [x, y] from './y.st.css';"})}),(0,l.jsxs)(s.td,{children:["Import named exports (",(0,l.jsx)(s.a,{href:"/docs/references/imports#named-import",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:"@st-import X, [y, z] from './y.st.css';"})}),(0,l.jsxs)(s.td,{children:["Import default & named (",(0,l.jsx)(s.a,{href:"/docs/references/imports#named-import",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:"@st-import [x as local-x] from './y.st.css';"})}),(0,l.jsxs)(s.td,{children:["Local alias for named import (",(0,l.jsx)(s.a,{href:"/docs/references/imports#local-alias",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:"@st-import [keyframes(x1, x2)] from './y.st.css';"})}),(0,l.jsxs)(s.td,{children:["Import keyframes (",(0,l.jsx)(s.a,{href:"../references/keyframes#import-and-export",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:"@st-import [layer(x1, x2)] from './y.st.css';"})}),(0,l.jsxs)(s.td,{children:["Import layers (",(0,l.jsx)(s.a,{href:"../references/layer#import-and-export",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:"@st-import [container(x1, x2)] from './y.st.css';"})}),(0,l.jsxs)(s.td,{children:["Import containers (",(0,l.jsx)(s.a,{href:"../references/contains#import-and-export",children:"api"}),")"]})]})]})]}),"\n",(0,l.jsx)(s.h3,{id:"class-extensions",children:"Class extensions"}),"\n",(0,l.jsxs)(s.table,{children:[(0,l.jsx)(s.thead,{children:(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.th,{children:"Syntax"}),(0,l.jsx)(s.th,{children:"Explanations"})]})}),(0,l.jsxs)(s.tbody,{children:[(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:"-st-extends: Gallery;"})}),(0,l.jsxs)(s.td,{children:["Extend an existing class (",(0,l.jsx)(s.a,{href:"/docs/references/extend-stylesheet",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:"-st-states: stateA, stateB;"})}),(0,l.jsxs)(s.td,{children:["Define custom pseudo-classes (",(0,l.jsx)(s.a,{href:"/docs/references/pseudo-classes",children:"api"}),")"]})]})]})]}),"\n",(0,l.jsx)(s.h3,{id:"templating",children:"Templating"}),"\n",(0,l.jsxs)(s.table,{children:[(0,l.jsx)(s.thead,{children:(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.th,{children:"Syntax"}),(0,l.jsx)(s.th,{children:"Explanations"})]})}),(0,l.jsxs)(s.tbody,{children:[(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:":vars { x: red; y: blue; }"})}),(0,l.jsxs)(s.td,{children:["Build time variables definition (",(0,l.jsx)(s.a,{href:"/docs/references/st-variables#define",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:"prop: value(x);"})}),(0,l.jsxs)(s.td,{children:["Insert var value into declaration (",(0,l.jsx)(s.a,{href:"/docs/references/st-variables#evaluate",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:"prop: x(arg1, arg2);"})}),(0,l.jsxs)(s.td,{children:["Computed value from custom formatter (",(0,l.jsx)(s.a,{href:"/docs/references/formatters",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:"-st-mixin: x, y;"})}),(0,l.jsxs)(s.td,{children:["Apply multiple mixins to CSS ruleset (",(0,l.jsx)(s.a,{href:"/docs/references/mixins",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:"-st-mixin: x(param v1, param v2);"})}),(0,l.jsxs)(s.td,{children:["Apply mixins with override params (",(0,l.jsx)(s.a,{href:"/docs/references/mixins",children:"api"}),")"]})]})]})]}),"\n",(0,l.jsx)(s.h3,{id:"other",children:"Other"}),"\n",(0,l.jsxs)(s.table,{children:[(0,l.jsx)(s.thead,{children:(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.th,{children:"Syntax"}),(0,l.jsx)(s.th,{children:"Explanations"})]})}),(0,l.jsxs)(s.tbody,{children:[(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:"@st-scope .x {}"})}),(0,l.jsxs)(s.td,{children:["Scope nested rules with a given selector (",(0,l.jsx)(s.a,{href:"/docs/references/st-scope",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:'@st-namespace "x";'})}),(0,l.jsxs)(s.td,{children:["Development display name for debugging (",(0,l.jsx)(s.a,{href:"/docs/references/namespace",children:"api"}),")"]})]})]})]})]})}function x(e={}){const{wrapper:s}={...(0,t.R)(),...e.components};return s?(0,l.jsx)(s,{...e,children:(0,l.jsx)(o,{...e})}):o(e)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[2346],{4719:(e,s,r)=>{r.r(s),r.d(s,{assets:()=>a,contentTitle:()=>d,default:()=>x,frontMatter:()=>i,metadata:()=>n,toc:()=>h});const n=JSON.parse('{"id":"references/cheatsheet","title":"Cheatsheet","description":"CSS Terminology","source":"@site/docs/references/cheatsheet.mdx","sourceDirName":"references","slug":"/references/cheatsheet","permalink":"/docs/references/cheatsheet","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/cheatsheet.mdx","tags":[],"version":"current","frontMatter":{"id":"cheatsheet","title":"Cheatsheet"},"sidebar":"Specification Reference","next":{"title":"Class Selector","permalink":"/docs/references/class-selectors"}}');var l=r(4848),t=r(8453),c=r(1432);const i={id:"cheatsheet",title:"Cheatsheet"},d=void 0,a={},h=[{value:"CSS Terminology",id:"css-terminology",level:2},{value:"Syntax",id:"syntax",level:2},{value:"Selectors",id:"selectors",level:3},{value:"Module system",id:"module-system",level:3},{value:"Class extensions",id:"class-extensions",level:3},{value:"Templating",id:"templating",level:3},{value:"Other",id:"other",level:3}];function o(e){const s={a:"a",h2:"h2",h3:"h3",li:"li",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,t.R)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.h2,{id:"css-terminology",children:"CSS Terminology"}),"\n",(0,l.jsxs)(s.ul,{children:["\n",(0,l.jsxs)(s.li,{children:[(0,l.jsx)(s.strong,{children:"selector"}),": query to target elements in the DOM"]}),"\n",(0,l.jsxs)(s.li,{children:[(0,l.jsx)(s.strong,{children:"property"}),": Name of the declaration (e.g. color)"]}),"\n",(0,l.jsxs)(s.li,{children:[(0,l.jsx)(s.strong,{children:"declaration"}),": CSS property paired with a value"]}),"\n",(0,l.jsxs)(s.li,{children:[(0,l.jsx)(s.strong,{children:"declaration Block"}),": List of CSS declarations"]}),"\n",(0,l.jsxs)(s.li,{children:[(0,l.jsx)(s.strong,{children:"ruleset"}),": CSS declaration block paired with a selector"]}),"\n"]}),"\n",(0,l.jsxs)(s.p,{children:["See MDN ",(0,l.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Syntax#CSS_Declarations",children:"How CSS is structured"})," and css-tricks ",(0,l.jsx)(s.a,{href:"https://css-tricks.com/css-ruleset-terminology/",children:"Ruleset Terminology"})," for detailed explanation of CSS naming and structure."]}),"\n",(0,l.jsx)(s.h2,{id:"syntax",children:"Syntax"}),"\n",(0,l.jsx)(s.p,{children:"Syntax that is unique to Stylable or extended from CSS."}),"\n",(0,l.jsx)(s.h3,{id:"selectors",children:"Selectors"}),"\n",(0,l.jsxs)(s.table,{children:[(0,l.jsx)(s.thead,{children:(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.th,{children:"Syntax"}),(0,l.jsx)(s.th,{children:"Explanations"})]})}),(0,l.jsxs)(s.tbody,{children:[(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:".x {}"})}),(0,l.jsxs)(s.td,{children:["Class selector (",(0,l.jsx)(s.a,{href:"/docs/references/class-selectors",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:"x {}"})}),(0,l.jsxs)(s.td,{children:["Element type selector (",(0,l.jsx)(s.a,{href:"/docs/references/type-selectors",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:":x {}"})}),(0,l.jsxs)(s.td,{children:["Pseudo-class or custom state selector (",(0,l.jsx)(s.a,{href:"/docs/references/pseudo-classes",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:"::x {}"})}),(0,l.jsxs)(s.td,{children:["Pseudo-element or custom-element selector (",(0,l.jsx)(s.a,{href:"/docs/references/pseudo-elements",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:":--x {}"})}),(0,l.jsxs)(s.td,{children:["custom selector (",(0,l.jsx)(s.a,{href:"/docs/references/custom-selectors",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:":global() {}"})}),(0,l.jsxs)(s.td,{children:["disables selector namespacing (",(0,l.jsx)(s.a,{href:"/docs/references/global-selectors",children:"api"}),")"]})]})]})]}),"\n",(0,l.jsx)(s.h3,{id:"module-system",children:"Module system"}),"\n",(0,l.jsxs)(s.table,{children:[(0,l.jsx)(s.thead,{children:(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.th,{children:"Syntax"}),(0,l.jsx)(s.th,{children:"Explanations"})]})}),(0,l.jsxs)(s.tbody,{children:[(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:"@st-import X from './y.st.css';"})}),(0,l.jsxs)(s.td,{children:["Import stylesheet's root (",(0,l.jsx)(s.a,{href:"/docs/references/imports#default-import",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:"@st-import [x, y] from './y.st.css';"})}),(0,l.jsxs)(s.td,{children:["Import named exports (",(0,l.jsx)(s.a,{href:"/docs/references/imports#named-import",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:"@st-import X, [y, z] from './y.st.css';"})}),(0,l.jsxs)(s.td,{children:["Import default & named (",(0,l.jsx)(s.a,{href:"/docs/references/imports#named-import",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:"@st-import [x as local-x] from './y.st.css';"})}),(0,l.jsxs)(s.td,{children:["Local alias for named import (",(0,l.jsx)(s.a,{href:"/docs/references/imports#local-alias",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:"@st-import [keyframes(x1, x2)] from './y.st.css';"})}),(0,l.jsxs)(s.td,{children:["Import keyframes (",(0,l.jsx)(s.a,{href:"../references/keyframes#import-and-export",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:"@st-import [layer(x1, x2)] from './y.st.css';"})}),(0,l.jsxs)(s.td,{children:["Import layers (",(0,l.jsx)(s.a,{href:"../references/layer#import-and-export",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:"@st-import [container(x1, x2)] from './y.st.css';"})}),(0,l.jsxs)(s.td,{children:["Import containers (",(0,l.jsx)(s.a,{href:"../references/contains#import-and-export",children:"api"}),")"]})]})]})]}),"\n",(0,l.jsx)(s.h3,{id:"class-extensions",children:"Class extensions"}),"\n",(0,l.jsxs)(s.table,{children:[(0,l.jsx)(s.thead,{children:(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.th,{children:"Syntax"}),(0,l.jsx)(s.th,{children:"Explanations"})]})}),(0,l.jsxs)(s.tbody,{children:[(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:"-st-extends: Gallery;"})}),(0,l.jsxs)(s.td,{children:["Extend an existing class (",(0,l.jsx)(s.a,{href:"/docs/references/extend-stylesheet",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:"-st-states: stateA, stateB;"})}),(0,l.jsxs)(s.td,{children:["Define custom pseudo-classes (",(0,l.jsx)(s.a,{href:"/docs/references/pseudo-classes",children:"api"}),")"]})]})]})]}),"\n",(0,l.jsx)(s.h3,{id:"templating",children:"Templating"}),"\n",(0,l.jsxs)(s.table,{children:[(0,l.jsx)(s.thead,{children:(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.th,{children:"Syntax"}),(0,l.jsx)(s.th,{children:"Explanations"})]})}),(0,l.jsxs)(s.tbody,{children:[(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:":vars { x: red; y: blue; }"})}),(0,l.jsxs)(s.td,{children:["Build time variables definition (",(0,l.jsx)(s.a,{href:"/docs/references/st-variables#define",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:"prop: value(x);"})}),(0,l.jsxs)(s.td,{children:["Insert var value into declaration (",(0,l.jsx)(s.a,{href:"/docs/references/st-variables#evaluate",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:"prop: x(arg1, arg2);"})}),(0,l.jsxs)(s.td,{children:["Computed value from custom formatter (",(0,l.jsx)(s.a,{href:"/docs/references/formatters",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:"-st-mixin: x, y;"})}),(0,l.jsxs)(s.td,{children:["Apply multiple mixins to CSS ruleset (",(0,l.jsx)(s.a,{href:"/docs/references/mixins",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:"-st-mixin: x(param v1, param v2);"})}),(0,l.jsxs)(s.td,{children:["Apply mixins with override params (",(0,l.jsx)(s.a,{href:"/docs/references/mixins",children:"api"}),")"]})]})]})]}),"\n",(0,l.jsx)(s.h3,{id:"other",children:"Other"}),"\n",(0,l.jsxs)(s.table,{children:[(0,l.jsx)(s.thead,{children:(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.th,{children:"Syntax"}),(0,l.jsx)(s.th,{children:"Explanations"})]})}),(0,l.jsxs)(s.tbody,{children:[(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:"@st-scope .x {}"})}),(0,l.jsxs)(s.td,{children:["Scope nested rules with a given selector (",(0,l.jsx)(s.a,{href:"/docs/references/st-scope",children:"api"}),")"]})]}),(0,l.jsxs)(s.tr,{children:[(0,l.jsx)(s.td,{children:(0,l.jsx)(c.A,{language:"css",className:"inline-code",children:'@st-namespace "x";'})}),(0,l.jsxs)(s.td,{children:["Development display name for debugging (",(0,l.jsx)(s.a,{href:"/docs/references/namespace",children:"api"}),")"]})]})]})]})]})}function x(e={}){const{wrapper:s}={...(0,t.R)(),...e.components};return s?(0,l.jsx)(s,{...e,children:(0,l.jsx)(o,{...e})}):o(e)}}}]); \ No newline at end of file diff --git a/assets/js/bfefe422.e4cc47c1.js b/assets/js/bfefe422.839d2a79.js similarity index 99% rename from assets/js/bfefe422.e4cc47c1.js rename to assets/js/bfefe422.839d2a79.js index bf587219..edb3aaab 100644 --- a/assets/js/bfefe422.e4cc47c1.js +++ b/assets/js/bfefe422.839d2a79.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[693],{7724:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>l,contentTitle:()=>o,default:()=>p,frontMatter:()=>a,metadata:()=>t,toc:()=>c});const t=JSON.parse('{"id":"references/css-vars","title":"Custom Property","description":"CSS custom property is used to define and re-use variables that participate in the cascade, and to dynamically change their values at runtime.","source":"@site/docs/references/css-vars.md","sourceDirName":"references","slug":"/references/css-vars","permalink":"/docs/references/css-vars","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/css-vars.md","tags":[],"version":"current","frontMatter":{"id":"css-vars","title":"Custom Property"},"sidebar":"Specification Reference","previous":{"title":"Containers","permalink":"/docs/references/contains"},"next":{"title":"Keyframes","permalink":"/docs/references/keyframes"}}');var i=r(4848),s=r(8453);const a={id:"css-vars",title:"Custom Property"},o=void 0,l={},c=[{value:"syntax",id:"syntax",level:2},{value:"Get / Set",id:"get--set",level:3},{value:"Runtime definition",id:"runtime-definition",level:3},{value:"Build only definition",id:"build-only-definition",level:3},{value:"Comparison to build vars",id:"comparison-to-build-vars",level:2},{value:"Import and Export",id:"import-and-export",level:2},{value:"Runtime",id:"runtime",level:2},{value:"Namespace",id:"namespace",level:2},{value:"Disable namespace",id:"disable-namespace",level:3}];function d(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["CSS ",(0,i.jsx)(n.code,{children:"custom property"})," is used to define and re-use variables that participate in the cascade, and to dynamically change their values at runtime."]}),"\n",(0,i.jsxs)(n.p,{children:["This page goes over how Stylable handles ",(0,i.jsx)(n.code,{children:"custom properties"}),", for more details about the language feature itself, checkout the following resources:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/--*",children:"MDN custom properties"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/@property",children:"MDN @property"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/var",children:"MDN var()"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables",children:"MDN - Using CSS custom properties"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://drafts.csswg.org/css-variables/",children:"Custom properties in spec"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://www.smashingmagazine.com/2017/04/start-using-css-custom-properties/",children:"Smashing Magazine - It's Time To Start Using CSS Custom Properties"})}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"syntax",children:"syntax"}),"\n",(0,i.jsxs)(n.p,{children:["A CSS custom property name must start with the ",(0,i.jsx)(n.code,{children:"--"})," prefix."]}),"\n",(0,i.jsx)(n.h3,{id:"get--set",children:"Get / Set"}),"\n",(0,i.jsxs)(n.p,{children:["A custom property can be referenced from a ",(0,i.jsx)(n.code,{children:"declaration property"})," or within a value ",(0,i.jsx)(n.code,{children:"var()"})," call:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-css",children:".a {\n /* set */\n --x: green;\n}\n.a .b {\n /* get */\n color: var(--x);\n}\n.b {\n /* fallback to yellow if property is unset */\n color: var(--notSet, yellow);\n\n /* fallback to --x if property is unset */\n color: var(--notSet, var(--x));\n}\n"})}),"\n",(0,i.jsx)(n.admonition,{title:"no explicit definition",type:"note",children:(0,i.jsxs)(n.p,{children:["A custom property can be set and used without an explicit ",(0,i.jsx)(n.code,{children:"@property"})," definition"]})}),"\n",(0,i.jsx)(n.h3,{id:"runtime-definition",children:"Runtime definition"}),"\n",(0,i.jsxs)(n.p,{children:["Use ",(0,i.jsx)(n.code,{children:"@property"})," at-rule to register a configuration for a runtime property:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-css",children:"/* runtime type definition */\n@property --x {\n syntax: '\n '; /* type */\n inherits: true; /* is taken from cascade */\n initial-value: green; /* default when unset */\n}\n\n.b {\n /* get green from initial value\n if --x is unset */\n color: var(--x);\n}\n"})}),"\n",(0,i.jsx)(n.h3,{id:"build-only-definition",children:"Build only definition"}),"\n",(0,i.jsxs)(n.p,{children:["To define a custom property to be used outside of a stylesheet, without explicitly registering its runtime type or using it as a declaration property or value, you can define the ",(0,i.jsx)(n.code,{children:"@property"})," at-rule without a body:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-css",children:"@property --x;\n"})}),"\n",(0,i.jsx)(n.admonition,{title:"removed at build",type:"info",children:(0,i.jsxs)(n.p,{children:["A property with no configuration body is removed at ",(0,i.jsx)(n.code,{children:"build-time"})," as it serves no purpose during ",(0,i.jsx)(n.code,{children:"runtime"})]})}),"\n",(0,i.jsx)(n.h2,{id:"comparison-to-build-vars",children:"Comparison to build vars"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.a,{href:"/docs/references/st-variables",children:"Stylable variables"})," (build vars) and CSS custom properties offer different capabilities, and as such serve different use-cases."]}),"\n",(0,i.jsx)(n.p,{children:"Stylable variables exist only in your source code, and get replaced during build. They serve well for calculations that are not supported by native CSS, reducing code repetition, increasing readability and can benefit any static theme or styling without incurring any runtime performance cost."}),"\n",(0,i.jsx)(n.p,{children:"CSS custom properties on the other hand do incur a very small runtime cost, but offer the ability to override their values during runtime, allowing for native CSS dynamic styling."}),"\n",(0,i.jsx)(n.h2,{id:"import-and-export",children:"Import and Export"}),"\n",(0,i.jsxs)(n.p,{children:["An exported custom-property can be imported into another stylesheet with the ",(0,i.jsx)(n.a,{href:"/docs/references/imports#named-import",children:"@st-import"})," at-rule."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-css",children:"@st-import [--x] from \"./common.st.css\";\n\n.a {\n /* get --x value */\n color: var(--x);\n}\n\n.b {\n /* set/override --x value */\n --x: gold;\n\n /* get override 'gold' value */\n background-color: var(--x); /* gold */\n}\n"})}),"\n",(0,i.jsx)(n.h2,{id:"runtime",children:"Runtime"}),"\n",(0,i.jsx)(n.p,{children:"A custom property can be used dynamically in JavaScript."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-css",metastring:'title="comp.st.css"',children:"@property --x;\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-jsx",metastring:'title="comp.jsx"',children:"import { vars } from './comp.st.css';\n\n/* inline style set property value */\n;\n"})}),"\n",(0,i.jsx)(n.h2,{id:"namespace",children:"Namespace"}),"\n",(0,i.jsx)(n.p,{children:"Stylable automatically namespace any CSS custom property name according to the stylesheet it is defined in."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-css",children:"@property --x {\n syntax: ' ';\n inherits: true;\n initial-value: green;\n}\n.a {\n --x: var(--x);\n}\n\n/* OUTPUT */\n@property --NAMESPACE-x {\n syntax: ' ';\n inherits: true;\n initial-value: green;\n}\n.NAMESPACE__a {\n --NAMESPACE-x: var(--NAMESPACE-x);\n}\n"})}),"\n",(0,i.jsx)(n.h3,{id:"disable-namespace",children:"Disable namespace"}),"\n",(0,i.jsxs)(n.p,{children:["In cases where the default namespace behavior is not wanted, ",(0,i.jsx)(n.code,{children:"st-global"})," can be used to mark a custom property definition as global."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-css",children:"@property st-global(--x) {\n syntax: ' ';\n inherits: true;\n initial-value: green;\n}\n\n.a {\n --x: var(--x);\n}\n\n/* OUTPUT */\n@property --x {\n syntax: ' ';\n inherits: true;\n initial-value: green;\n}\n\n.NAMESPACE__a {\n --x: var(--x);\n}\n"})})]})}function p(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},8453:(e,n,r)=>{r.d(n,{R:()=>a,x:()=>o});var t=r(6540);const i={},s=t.createContext(i);function a(e){const n=t.useContext(s);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:a(e.components),t.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[693],{5967:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>l,contentTitle:()=>o,default:()=>p,frontMatter:()=>a,metadata:()=>t,toc:()=>c});const t=JSON.parse('{"id":"references/css-vars","title":"Custom Property","description":"CSS custom property is used to define and re-use variables that participate in the cascade, and to dynamically change their values at runtime.","source":"@site/docs/references/css-vars.md","sourceDirName":"references","slug":"/references/css-vars","permalink":"/docs/references/css-vars","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/css-vars.md","tags":[],"version":"current","frontMatter":{"id":"css-vars","title":"Custom Property"},"sidebar":"Specification Reference","previous":{"title":"Containers","permalink":"/docs/references/contains"},"next":{"title":"Keyframes","permalink":"/docs/references/keyframes"}}');var i=r(4848),s=r(8453);const a={id:"css-vars",title:"Custom Property"},o=void 0,l={},c=[{value:"syntax",id:"syntax",level:2},{value:"Get / Set",id:"get--set",level:3},{value:"Runtime definition",id:"runtime-definition",level:3},{value:"Build only definition",id:"build-only-definition",level:3},{value:"Comparison to build vars",id:"comparison-to-build-vars",level:2},{value:"Import and Export",id:"import-and-export",level:2},{value:"Runtime",id:"runtime",level:2},{value:"Namespace",id:"namespace",level:2},{value:"Disable namespace",id:"disable-namespace",level:3}];function d(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["CSS ",(0,i.jsx)(n.code,{children:"custom property"})," is used to define and re-use variables that participate in the cascade, and to dynamically change their values at runtime."]}),"\n",(0,i.jsxs)(n.p,{children:["This page goes over how Stylable handles ",(0,i.jsx)(n.code,{children:"custom properties"}),", for more details about the language feature itself, checkout the following resources:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/--*",children:"MDN custom properties"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/@property",children:"MDN @property"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/var",children:"MDN var()"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables",children:"MDN - Using CSS custom properties"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://drafts.csswg.org/css-variables/",children:"Custom properties in spec"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://www.smashingmagazine.com/2017/04/start-using-css-custom-properties/",children:"Smashing Magazine - It's Time To Start Using CSS Custom Properties"})}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"syntax",children:"syntax"}),"\n",(0,i.jsxs)(n.p,{children:["A CSS custom property name must start with the ",(0,i.jsx)(n.code,{children:"--"})," prefix."]}),"\n",(0,i.jsx)(n.h3,{id:"get--set",children:"Get / Set"}),"\n",(0,i.jsxs)(n.p,{children:["A custom property can be referenced from a ",(0,i.jsx)(n.code,{children:"declaration property"})," or within a value ",(0,i.jsx)(n.code,{children:"var()"})," call:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-css",children:".a {\n /* set */\n --x: green;\n}\n.a .b {\n /* get */\n color: var(--x);\n}\n.b {\n /* fallback to yellow if property is unset */\n color: var(--notSet, yellow);\n\n /* fallback to --x if property is unset */\n color: var(--notSet, var(--x));\n}\n"})}),"\n",(0,i.jsx)(n.admonition,{title:"no explicit definition",type:"note",children:(0,i.jsxs)(n.p,{children:["A custom property can be set and used without an explicit ",(0,i.jsx)(n.code,{children:"@property"})," definition"]})}),"\n",(0,i.jsx)(n.h3,{id:"runtime-definition",children:"Runtime definition"}),"\n",(0,i.jsxs)(n.p,{children:["Use ",(0,i.jsx)(n.code,{children:"@property"})," at-rule to register a configuration for a runtime property:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-css",children:"/* runtime type definition */\n@property --x {\n syntax: ' '; /* type */\n inherits: true; /* is taken from cascade */\n initial-value: green; /* default when unset */\n}\n\n.b {\n /* get green from initial value\n if --x is unset */\n color: var(--x);\n}\n"})}),"\n",(0,i.jsx)(n.h3,{id:"build-only-definition",children:"Build only definition"}),"\n",(0,i.jsxs)(n.p,{children:["To define a custom property to be used outside of a stylesheet, without explicitly registering its runtime type or using it as a declaration property or value, you can define the ",(0,i.jsx)(n.code,{children:"@property"})," at-rule without a body:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-css",children:"@property --x;\n"})}),"\n",(0,i.jsx)(n.admonition,{title:"removed at build",type:"info",children:(0,i.jsxs)(n.p,{children:["A property with no configuration body is removed at ",(0,i.jsx)(n.code,{children:"build-time"})," as it serves no purpose during ",(0,i.jsx)(n.code,{children:"runtime"})]})}),"\n",(0,i.jsx)(n.h2,{id:"comparison-to-build-vars",children:"Comparison to build vars"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.a,{href:"/docs/references/st-variables",children:"Stylable variables"})," (build vars) and CSS custom properties offer different capabilities, and as such serve different use-cases."]}),"\n",(0,i.jsx)(n.p,{children:"Stylable variables exist only in your source code, and get replaced during build. They serve well for calculations that are not supported by native CSS, reducing code repetition, increasing readability and can benefit any static theme or styling without incurring any runtime performance cost."}),"\n",(0,i.jsx)(n.p,{children:"CSS custom properties on the other hand do incur a very small runtime cost, but offer the ability to override their values during runtime, allowing for native CSS dynamic styling."}),"\n",(0,i.jsx)(n.h2,{id:"import-and-export",children:"Import and Export"}),"\n",(0,i.jsxs)(n.p,{children:["An exported custom-property can be imported into another stylesheet with the ",(0,i.jsx)(n.a,{href:"/docs/references/imports#named-import",children:"@st-import"})," at-rule."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-css",children:"@st-import [--x] from \"./common.st.css\";\n\n.a {\n /* get --x value */\n color: var(--x);\n}\n\n.b {\n /* set/override --x value */\n --x: gold;\n\n /* get override 'gold' value */\n background-color: var(--x); /* gold */\n}\n"})}),"\n",(0,i.jsx)(n.h2,{id:"runtime",children:"Runtime"}),"\n",(0,i.jsx)(n.p,{children:"A custom property can be used dynamically in JavaScript."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-css",metastring:'title="comp.st.css"',children:"@property --x;\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-jsx",metastring:'title="comp.jsx"',children:"import { vars } from './comp.st.css';\n\n/* inline style set property value */\n;\n"})}),"\n",(0,i.jsx)(n.h2,{id:"namespace",children:"Namespace"}),"\n",(0,i.jsx)(n.p,{children:"Stylable automatically namespace any CSS custom property name according to the stylesheet it is defined in."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-css",children:"@property --x {\n syntax: ' ';\n inherits: true;\n initial-value: green;\n}\n.a {\n --x: var(--x);\n}\n\n/* OUTPUT */\n@property --NAMESPACE-x {\n syntax: ' ';\n inherits: true;\n initial-value: green;\n}\n.NAMESPACE__a {\n --NAMESPACE-x: var(--NAMESPACE-x);\n}\n"})}),"\n",(0,i.jsx)(n.h3,{id:"disable-namespace",children:"Disable namespace"}),"\n",(0,i.jsxs)(n.p,{children:["In cases where the default namespace behavior is not wanted, ",(0,i.jsx)(n.code,{children:"st-global"})," can be used to mark a custom property definition as global."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-css",children:"@property st-global(--x) {\n syntax: ' ';\n inherits: true;\n initial-value: green;\n}\n\n.a {\n --x: var(--x);\n}\n\n/* OUTPUT */\n@property --x {\n syntax: ' ';\n inherits: true;\n initial-value: green;\n}\n\n.NAMESPACE__a {\n --x: var(--x);\n}\n"})})]})}function p(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},8453:(e,n,r)=>{r.d(n,{R:()=>a,x:()=>o});var t=r(6540);const i={},s=t.createContext(i);function a(e){const n=t.useContext(s);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:a(e.components),t.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/c0d90f50.d20d39ea.js b/assets/js/c0d90f50.19dd0b17.js similarity index 98% rename from assets/js/c0d90f50.d20d39ea.js rename to assets/js/c0d90f50.19dd0b17.js index 367ce8a4..1350806f 100644 --- a/assets/js/c0d90f50.d20d39ea.js +++ b/assets/js/c0d90f50.19dd0b17.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[7394],{3978:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>a,contentTitle:()=>l,default:()=>p,frontMatter:()=>c,metadata:()=>n,toc:()=>i});const n=JSON.parse('{"id":"references/root","title":"Root","description":"Every Stylable stylesheet has a reserved class called root that matches the root node of the component. The root class is used to signify the component top-level node where a new namespace scope is created.","source":"@site/docs/references/root.md","sourceDirName":"references","slug":"/references/root","permalink":"/docs/references/root","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/root.md","tags":[],"version":"current","frontMatter":{"id":"root","title":"Root","layout":"docs"},"sidebar":"Specification Reference","previous":{"title":"Namespace","permalink":"/docs/references/namespace"},"next":{"title":"Scope","permalink":"/docs/references/st-scope"}}');var o=t(4848),r=t(8453);const c={id:"root",title:"Root",layout:"docs"},l=void 0,a={},i=[{value:"Default export",id:"default-export",level:2},{value:"Runtime",id:"runtime",level:2},{value:"simple example",id:"simple-example",level:3},{value:"root + state + customize",id:"root--state--customize",level:3}];function d(e){const s={a:"a",code:"code",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",...(0,r.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(s.p,{children:["Every Stylable stylesheet has a reserved class called ",(0,o.jsx)(s.code,{children:"root"})," that matches the root node of the component. The ",(0,o.jsx)(s.code,{children:"root"})," class is used to signify the component top-level node where a new namespace scope is created."]}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-css",children:".root { \n /* set component background */\n background: white; \n} \n\n/* OUTPUT */\n.NAMESPACE__root { \n background: white; \n}\n"})}),"\n",(0,o.jsx)(s.h2,{id:"default-export",children:"Default export"}),"\n",(0,o.jsxs)(s.p,{children:["The root of a stylesheet can be referenced in other stylesheets by using the ",(0,o.jsx)(s.a,{href:"/docs/references/imports#default-import",children:"default import"}),"."]}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-css",metastring:'title="page.st.css"',children:"@st-import DropDown from './dropdown.st.css';\n\n/* style any dropdown component background \n nested under the page root */\n.root DropDown {\n background: salmon;\n}\n\n/* OUTPUT */\n.page__root .dropdown__root { \n background: salmon; \n}\n"})}),"\n",(0,o.jsx)(s.h2,{id:"runtime",children:"Runtime"}),"\n",(0,o.jsxs)(s.p,{children:["Each component is responsible for placing the ",(0,o.jsx)(s.code,{children:"root"})," class on its top-level node using the ",(0,o.jsx)(s.a,{href:"/docs/references/runtime",children:"runtime API"}),"."]}),"\n",(0,o.jsx)(s.h3,{id:"simple-example",children:"simple example"}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-jsx",metastring:'title="comp.jsx"',children:"import { classes } from './comp.st.css';\n\nfunction Comp() {\n return ;\n}\n"})}),"\n",(0,o.jsx)(s.h3,{id:"root--state--customize",children:"root + state + customize"}),"\n",(0,o.jsxs)(s.p,{children:["The following example uses the ",(0,o.jsx)(s.a,{href:"/docs/references/runtime#st-function",children:"st() function"})," to add multiple classes:"]}),"\n",(0,o.jsxs)(s.ol,{children:["\n",(0,o.jsx)(s.li,{children:"the component root class"}),"\n",(0,o.jsx)(s.li,{children:"state classes"}),"\n",(0,o.jsx)(s.li,{children:"classes passed from props for customizations"}),"\n"]}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-jsx",metastring:'title="comp.jsx"',children:"import { st, classes } from './comp.st.css';\n\nfunction Comp({ className }) {\n return (\n \n );\n}\n"})})]})}function p(e={}){const{wrapper:s}={...(0,r.R)(),...e.components};return s?(0,o.jsx)(s,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,s,t)=>{t.d(s,{R:()=>c,x:()=>l});var n=t(6540);const o={},r=n.createContext(o);function c(e){const s=n.useContext(r);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function l(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:c(e.components),n.createElement(r.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[7394],{4707:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>a,contentTitle:()=>l,default:()=>p,frontMatter:()=>c,metadata:()=>n,toc:()=>i});const n=JSON.parse('{"id":"references/root","title":"Root","description":"Every Stylable stylesheet has a reserved class called root that matches the root node of the component. The root class is used to signify the component top-level node where a new namespace scope is created.","source":"@site/docs/references/root.md","sourceDirName":"references","slug":"/references/root","permalink":"/docs/references/root","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/root.md","tags":[],"version":"current","frontMatter":{"id":"root","title":"Root","layout":"docs"},"sidebar":"Specification Reference","previous":{"title":"Namespace","permalink":"/docs/references/namespace"},"next":{"title":"Scope","permalink":"/docs/references/st-scope"}}');var o=t(4848),r=t(8453);const c={id:"root",title:"Root",layout:"docs"},l=void 0,a={},i=[{value:"Default export",id:"default-export",level:2},{value:"Runtime",id:"runtime",level:2},{value:"simple example",id:"simple-example",level:3},{value:"root + state + customize",id:"root--state--customize",level:3}];function d(e){const s={a:"a",code:"code",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",...(0,r.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(s.p,{children:["Every Stylable stylesheet has a reserved class called ",(0,o.jsx)(s.code,{children:"root"})," that matches the root node of the component. The ",(0,o.jsx)(s.code,{children:"root"})," class is used to signify the component top-level node where a new namespace scope is created."]}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-css",children:".root { \n /* set component background */\n background: white; \n} \n\n/* OUTPUT */\n.NAMESPACE__root { \n background: white; \n}\n"})}),"\n",(0,o.jsx)(s.h2,{id:"default-export",children:"Default export"}),"\n",(0,o.jsxs)(s.p,{children:["The root of a stylesheet can be referenced in other stylesheets by using the ",(0,o.jsx)(s.a,{href:"/docs/references/imports#default-import",children:"default import"}),"."]}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-css",metastring:'title="page.st.css"',children:"@st-import DropDown from './dropdown.st.css';\n\n/* style any dropdown component background \n nested under the page root */\n.root DropDown {\n background: salmon;\n}\n\n/* OUTPUT */\n.page__root .dropdown__root { \n background: salmon; \n}\n"})}),"\n",(0,o.jsx)(s.h2,{id:"runtime",children:"Runtime"}),"\n",(0,o.jsxs)(s.p,{children:["Each component is responsible for placing the ",(0,o.jsx)(s.code,{children:"root"})," class on its top-level node using the ",(0,o.jsx)(s.a,{href:"/docs/references/runtime",children:"runtime API"}),"."]}),"\n",(0,o.jsx)(s.h3,{id:"simple-example",children:"simple example"}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-jsx",metastring:'title="comp.jsx"',children:"import { classes } from './comp.st.css';\n\nfunction Comp() {\n return ;\n}\n"})}),"\n",(0,o.jsx)(s.h3,{id:"root--state--customize",children:"root + state + customize"}),"\n",(0,o.jsxs)(s.p,{children:["The following example uses the ",(0,o.jsx)(s.a,{href:"/docs/references/runtime#st-function",children:"st() function"})," to add multiple classes:"]}),"\n",(0,o.jsxs)(s.ol,{children:["\n",(0,o.jsx)(s.li,{children:"the component root class"}),"\n",(0,o.jsx)(s.li,{children:"state classes"}),"\n",(0,o.jsx)(s.li,{children:"classes passed from props for customizations"}),"\n"]}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-jsx",metastring:'title="comp.jsx"',children:"import { st, classes } from './comp.st.css';\n\nfunction Comp({ className }) {\n return (\n \n );\n}\n"})})]})}function p(e={}){const{wrapper:s}={...(0,r.R)(),...e.components};return s?(0,o.jsx)(s,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,s,t)=>{t.d(s,{R:()=>c,x:()=>l});var n=t(6540);const o={},r=n.createContext(o);function c(e){const s=n.useContext(r);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function l(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:c(e.components),n.createElement(r.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/cb737cc7.25dc0627.js b/assets/js/cb737cc7.25dc0627.js new file mode 100644 index 00000000..4cb703cb --- /dev/null +++ b/assets/js/cb737cc7.25dc0627.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[242],{3:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>c,contentTitle:()=>l,default:()=>p,frontMatter:()=>i,metadata:()=>n,toc:()=>d});const n=JSON.parse('{"id":"guides/handbook/import-class","title":"Import Class","description":"In the Runtime chapter, we saw how a Stylable stylesheet\'s API can be imported into a JavaScript module, and how that API can be used. In this chapter, we\'ll see how our game example can be divided into linked stylesheet modules to provide a better development experience.","source":"@site/docs/guides/handbook/import.mdx","sourceDirName":"guides/handbook","slug":"/guides/handbook/import-class","permalink":"/docs/guides/handbook/import-class","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/guides/handbook/import.mdx","tags":[],"version":"current","frontMatter":{"id":"import-class","title":"Import Class"},"sidebar":"Guides","previous":{"title":"Runtime","permalink":"/docs/guides/handbook/runtime"},"next":{"title":"Extend","permalink":"/docs/guides/handbook/extend"}}');var a=t(4848),r=t(8453),o=t(1432);const i={id:"import-class",title:"Import Class"},l=void 0,c={},d=[{value:"Stylesheet root",id:"stylesheet-root",level:2},{value:"Default import",id:"default-import",level:2},{value:"Stylesheet root selector",id:"stylesheet-root-selector",level:3},{value:"Class named import",id:"class-named-import",level:2},{value:"Validations",id:"validations",level:3},{value:"Exported by default",id:"exported-by-default",level:3},{value:"Further import use-cases",id:"further-import-use-cases",level:2}];function h(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",hr:"hr",p:"p",pre:"pre",strong:"strong",...(0,r.R)(),...e.components},{Details:t}=s;return t||function(e,s){throw new Error("Expected "+(s?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(s.p,{children:["In the ",(0,a.jsx)(s.a,{href:"/docs/guides/handbook/runtime",children:"Runtime chapter"}),", we saw how a Stylable stylesheet's API can be imported into a JavaScript module, and how that API can be used. In this chapter, we'll see how our game example can be divided into linked stylesheet modules to provide a better development experience."]}),"\n","\n",(0,a.jsxs)(s.p,{children:["Up to this point, we've talked mostly about a single stylesheet for our project (",(0,a.jsx)(s.code,{children:"game.st.css"}),"). Now we'll explore how to organize our code across multiple stylesheets."]}),"\n",(0,a.jsx)(s.p,{children:(0,a.jsx)(s.strong,{children:"Current status:"})}),"\n","\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="game.st.css"',children:".board { /* ... */ }\n\n.player {\n -st-states: registered, \n ranking(enum(first, second, third));\n background: blue;\n}\n"})}),"\n","\n",(0,a.jsx)(s.h2,{id:"stylesheet-root",children:"Stylesheet root"}),"\n",(0,a.jsxs)(s.p,{children:["Let's refactor the ",(0,a.jsx)(s.code,{children:"player"})," class from out of our ",(0,a.jsx)(s.code,{children:"game.st.css"})," to be in its own stylesheet."]}),"\n","\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="player.st.css"',children:".root {\n -st-states: registered,\n ranking(enum(first, second, third));\n background: blue;\n}\n"})}),"\n","\n",(0,a.jsxs)(s.p,{children:["We created a new ",(0,a.jsx)(s.code,{children:"player.st.css"})," file above, and in it, created a new ",(0,a.jsx)(s.code,{children:".root"})," class. Then we moved the contents of the ",(0,a.jsx)(s.code,{children:".player"})," class rules to our new ",(0,a.jsx)(s.code,{children:"root"})," class."]}),"\n",(0,a.jsx)(s.admonition,{title:"default root class",type:"info",children:(0,a.jsxs)(s.p,{children:["In Stylable, each component stylesheet is represented by a ",(0,a.jsx)(s.code,{children:"root"})," class that is automatically created, even if not explicitly defined by the user. This root class is expected to be applied to the ",(0,a.jsx)(s.a,{href:"/docs/references/root",children:"root element of the component"}),"."]})}),"\n","\n",(0,a.jsxs)(s.p,{children:["We can see that when we moved the ",(0,a.jsx)(s.code,{children:"player"})," class, we also included its styling declarations. This might cause additional work in the future when trying to customize this class from the outside."]}),"\n",(0,a.jsx)(s.admonition,{title:"base style recommendation",type:"tip",children:(0,a.jsxs)(s.p,{children:["Stylable recommends that a component's stylesheet include minimal styling - only what is crucial for the functionality of the component or defines its structure. To follow this best practice, we need a way to import the ",(0,a.jsx)(s.code,{children:"player.st.css"})," stylesheet over to ",(0,a.jsx)(s.code,{children:"game.st.css"}),", and perform our styling customizations there."]})}),"\n",(0,a.jsx)(s.h2,{id:"default-import",children:"Default import"}),"\n",(0,a.jsxs)(s.p,{children:["Keep in mind that, as we saw earlier in the ",(0,a.jsx)(s.a,{href:"/docs/guides/handbook/namespacing#supported-symbols",children:"Namespacing chapter"}),", classes in Stylable are automatically namespaced. This means that if we wish to target a class from another stylesheet in a selector, we need to import it to link to it."]}),"\n",(0,a.jsxs)(s.p,{children:["Below, we import the ",(0,a.jsx)(s.code,{children:"player.st.css"})," stylesheet and customize it by using the ",(0,a.jsx)(s.code,{children:"@st-import"})," at-rule, and providing it with a ",(0,a.jsx)(s.strong,{children:"local name"})," for the default export (beginning with a capital letter) and a ",(0,a.jsx)(s.strong,{children:"request"})," to the target stylesheet. Then we move any customizations out of ",(0,a.jsx)(s.code,{children:"player.st.css"})," into ",(0,a.jsx)(s.code,{children:"game.st.css"}),"."]}),"\n","\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="game.st.css - moved player customization"',children:'@st-import Player from "./player.st.css";\n\n.board { /* ... */ }\n\nPlayer {\n background: blue; /* moved from player.st.css */\n}\n'})}),"\n",(0,a.jsxs)(t,{children:[(0,a.jsx)("summary",{children:(0,a.jsx)(s.p,{children:"Namespacing output"})}),(0,a.jsx)(o.A,{title:"game.st.css",language:"css",children:'@st-import Player from "./player.st.css"; \n\n/* namespaced locally */\n.game__board { /* ... */ } \n\n/* namespaced by player.st.css */\n.player__root { \nbackground: blue;\n}'})]}),"\n","\n",(0,a.jsx)(s.h3,{id:"stylesheet-root-selector",children:"Stylesheet root selector"}),"\n",(0,a.jsxs)(s.p,{children:["It's important to note that a default import of a Stylable stylesheet represents a component root, and is in fact pointing to the ",(0,a.jsx)(s.code,{children:"root"})," class of that stylesheet."]}),"\n",(0,a.jsxs)(s.admonition,{title:"Unscoped warning",type:"caution",children:[(0,a.jsxs)(s.p,{children:["By importing the default export of a stylesheet and then styling it, we are potentially customizing every instance of the component across our project. It is therefore ",(0,a.jsx)(s.strong,{children:"strongly recommended"})," to scope any selector that originates from a different namespace (stylesheet) or includes native elements with a local class."]}),(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",children:'@st-import Player from "./player.st.css";\n\n/* report unscoped warnings */\nPlayer {}\ndiv {}\n\n/* no warnings */\n.root Player {}\n.root div {}\n'})})]}),"\n",(0,a.jsx)(s.h2,{id:"class-named-import",children:"Class named import"}),"\n",(0,a.jsxs)(s.p,{children:["For the next step, we would like to add ",(0,a.jsx)(s.code,{children:"avatar"})," and ",(0,a.jsx)(s.code,{children:"username"})," parts to ",(0,a.jsx)(s.code,{children:"player.st.css"}),". These will be applied to the inner elements of the component, and are assumed to be nested under the ",(0,a.jsx)(s.code,{children:"root"})," class."]}),"\n","\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="player.st.css - added avatar and username"',children:".root {\n -st-states: registered,\n ranking(enum(first, second, third));\n}\n.avatar {}\n.username {}\n"})}),"\n","\n",(0,a.jsx)(s.p,{children:"We then proceed to bind these new classes to their matching elements in the component."}),"\n","\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-jsx",metastring:'title="player.jsx - bind avatar and username"',children:'import { st, classes } from "./player.st.css";\n\nconst Player = ({ className }) => {\n return (\n \n\n )\n}\n'})}),"\n","\n",(0,a.jsxs)(s.p,{children:["Now that we have these new classes, we can customize them externally through ",(0,a.jsx)(s.code,{children:"game.st.css"}),". We do this by adding two ",(0,a.jsx)(s.code,{children:"named imports"}),", inside square brackets, that link to our classes."]}),"\n","\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="game.st.css - player customization"',children:'@st-import Player, [avatar, username] from "./player.st.css";\n\nPlayer {\n /* paint the Player component background blue */\n background: blue;\n}\nPlayer .avatar {\n /* circle avatar */\n border-radius: 50%;\n}\nPlayer .username {\n /* all caps username */\n text-transform: uppercase;\n}\n'})}),"\n",(0,a.jsxs)(t,{children:[(0,a.jsx)("summary",{children:(0,a.jsx)(s.p,{children:"Namespacing output - selectors only"})}),(0,a.jsx)(o.A,{title:"game.st.css",language:"css",children:'@st-import Player, [avatar, username] from "./player.st.css"; \n\n.player__root {}\n.player__root .player__avatar {}\n.player__root .player__username {}'})]}),"\n","\n",(0,a.jsx)(s.h3,{id:"validations",children:"Validations"}),"\n",(0,a.jsx)(s.p,{children:"One of the nice things that we gain by using these Stylable imports is that requested symbols are validated, and we'll be notified if any of the imported parts are not found."}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="game.st.css - missing import"',children:'/* report an error about an unknown "missingImport" symbol */\n@st-import [missingImport] from "./player.st.css";\n'})}),"\n",(0,a.jsx)(s.h3,{id:"exported-by-default",children:"Exported by default"}),"\n",(0,a.jsx)(s.p,{children:"Any classes and other symbols defined in a stylesheet are automatically exported and available for import."}),"\n",(0,a.jsx)(s.admonition,{title:"Explicit exports",type:"note",children:(0,a.jsxs)(s.p,{children:["We are in the process of developing ",(0,a.jsx)(s.a,{href:"https://github.com/wix/stylable/issues/2604",children:"explicit export support"}),", and will expand this section once available."]})}),"\n",(0,a.jsx)(s.h2,{id:"further-import-use-cases",children:"Further import use-cases"}),"\n",(0,a.jsx)(s.p,{children:"Up to this point, we've only needed to import classes between stylesheets. In later chapters of this guide, we will learn how to import and use additional symbols, as well as additional import use cases from JavaScript to our stylesheet."}),"\n",(0,a.jsxs)(s.p,{children:["Check out the API cheatsheet to see various ",(0,a.jsx)(s.a,{href:"../../references/cheatsheet#module-system",children:"@st-import"})," examples."]}),"\n",(0,a.jsx)(s.hr,{}),"\n",(0,a.jsx)(s.p,{children:"In this chapter, we've seen how to divide a stylesheet to separate modules, and how to customize those externally. We approached doing this by manually importing each class (default or named), and customizing them together using a selector."}),"\n",(0,a.jsxs)(s.p,{children:["In the ",(0,a.jsx)(s.a,{href:"./extend",children:"Next chapter"}),", we'll learn how Stylable can extend stylesheets, exposing their inner parts as an API to make our lives easier."]})]})}function p(e={}){const{wrapper:s}={...(0,r.R)(),...e.components};return s?(0,a.jsx)(s,{...e,children:(0,a.jsx)(h,{...e})}):h(e)}}}]); \ No newline at end of file diff --git a/assets/js/cb737cc7.4efc99f1.js b/assets/js/cb737cc7.4efc99f1.js deleted file mode 100644 index 2c98afd3..00000000 --- a/assets/js/cb737cc7.4efc99f1.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[242],{4734:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>c,contentTitle:()=>l,default:()=>p,frontMatter:()=>i,metadata:()=>n,toc:()=>d});const n=JSON.parse('{"id":"guides/handbook/import-class","title":"Import Class","description":"In the Runtime chapter, we saw how a Stylable stylesheet\'s API can be imported into a JavaScript module, and how that API can be used. In this chapter, we\'ll see how our game example can be divided into linked stylesheet modules to provide a better development experience.","source":"@site/docs/guides/handbook/import.mdx","sourceDirName":"guides/handbook","slug":"/guides/handbook/import-class","permalink":"/docs/guides/handbook/import-class","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/guides/handbook/import.mdx","tags":[],"version":"current","frontMatter":{"id":"import-class","title":"Import Class"},"sidebar":"Guides","previous":{"title":"Runtime","permalink":"/docs/guides/handbook/runtime"},"next":{"title":"Extend","permalink":"/docs/guides/handbook/extend"}}');var a=t(4848),r=t(8453),o=t(2250);const i={id:"import-class",title:"Import Class"},l=void 0,c={},d=[{value:"Stylesheet root",id:"stylesheet-root",level:2},{value:"Default import",id:"default-import",level:2},{value:"Stylesheet root selector",id:"stylesheet-root-selector",level:3},{value:"Class named import",id:"class-named-import",level:2},{value:"Validations",id:"validations",level:3},{value:"Exported by default",id:"exported-by-default",level:3},{value:"Further import use-cases",id:"further-import-use-cases",level:2}];function h(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",hr:"hr",p:"p",pre:"pre",strong:"strong",...(0,r.R)(),...e.components},{Details:t}=s;return t||function(e,s){throw new Error("Expected "+(s?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(s.p,{children:["In the ",(0,a.jsx)(s.a,{href:"/docs/guides/handbook/runtime",children:"Runtime chapter"}),", we saw how a Stylable stylesheet's API can be imported into a JavaScript module, and how that API can be used. In this chapter, we'll see how our game example can be divided into linked stylesheet modules to provide a better development experience."]}),"\n","\n",(0,a.jsxs)(s.p,{children:["Up to this point, we've talked mostly about a single stylesheet for our project (",(0,a.jsx)(s.code,{children:"game.st.css"}),"). Now we'll explore how to organize our code across multiple stylesheets."]}),"\n",(0,a.jsx)(s.p,{children:(0,a.jsx)(s.strong,{children:"Current status:"})}),"\n","\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="game.st.css"',children:".board { /* ... */ }\n\n.player {\n -st-states: registered, \n ranking(enum(first, second, third));\n background: blue;\n}\n"})}),"\n","\n",(0,a.jsx)(s.h2,{id:"stylesheet-root",children:"Stylesheet root"}),"\n",(0,a.jsxs)(s.p,{children:["Let's refactor the ",(0,a.jsx)(s.code,{children:"player"})," class from out of our ",(0,a.jsx)(s.code,{children:"game.st.css"})," to be in its own stylesheet."]}),"\n","\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="player.st.css"',children:".root {\n -st-states: registered,\n ranking(enum(first, second, third));\n background: blue;\n}\n"})}),"\n","\n",(0,a.jsxs)(s.p,{children:["We created a new ",(0,a.jsx)(s.code,{children:"player.st.css"})," file above, and in it, created a new ",(0,a.jsx)(s.code,{children:".root"})," class. Then we moved the contents of the ",(0,a.jsx)(s.code,{children:".player"})," class rules to our new ",(0,a.jsx)(s.code,{children:"root"})," class."]}),"\n",(0,a.jsx)(s.admonition,{title:"default root class",type:"info",children:(0,a.jsxs)(s.p,{children:["In Stylable, each component stylesheet is represented by a ",(0,a.jsx)(s.code,{children:"root"})," class that is automatically created, even if not explicitly defined by the user. This root class is expected to be applied to the ",(0,a.jsx)(s.a,{href:"/docs/references/root",children:"root element of the component"}),"."]})}),"\n","\n",(0,a.jsxs)(s.p,{children:["We can see that when we moved the ",(0,a.jsx)(s.code,{children:"player"})," class, we also included its styling declarations. This might cause additional work in the future when trying to customize this class from the outside."]}),"\n",(0,a.jsx)(s.admonition,{title:"base style recommendation",type:"tip",children:(0,a.jsxs)(s.p,{children:["Stylable recommends that a component's stylesheet include minimal styling - only what is crucial for the functionality of the component or defines its structure. To follow this best practice, we need a way to import the ",(0,a.jsx)(s.code,{children:"player.st.css"})," stylesheet over to ",(0,a.jsx)(s.code,{children:"game.st.css"}),", and perform our styling customizations there."]})}),"\n",(0,a.jsx)(s.h2,{id:"default-import",children:"Default import"}),"\n",(0,a.jsxs)(s.p,{children:["Keep in mind that, as we saw earlier in the ",(0,a.jsx)(s.a,{href:"/docs/guides/handbook/namespacing#supported-symbols",children:"Namespacing chapter"}),", classes in Stylable are automatically namespaced. This means that if we wish to target a class from another stylesheet in a selector, we need to import it to link to it."]}),"\n",(0,a.jsxs)(s.p,{children:["Below, we import the ",(0,a.jsx)(s.code,{children:"player.st.css"})," stylesheet and customize it by using the ",(0,a.jsx)(s.code,{children:"@st-import"})," at-rule, and providing it with a ",(0,a.jsx)(s.strong,{children:"local name"})," for the default export (beginning with a capital letter) and a ",(0,a.jsx)(s.strong,{children:"request"})," to the target stylesheet. Then we move any customizations out of ",(0,a.jsx)(s.code,{children:"player.st.css"})," into ",(0,a.jsx)(s.code,{children:"game.st.css"}),"."]}),"\n","\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="game.st.css - moved player customization"',children:'@st-import Player from "./player.st.css";\n\n.board { /* ... */ }\n\nPlayer {\n background: blue; /* moved from player.st.css */\n}\n'})}),"\n",(0,a.jsxs)(t,{children:[(0,a.jsx)("summary",{children:(0,a.jsx)(s.p,{children:"Namespacing output"})}),(0,a.jsx)(o.A,{title:"game.st.css",language:"css",children:'@st-import Player from "./player.st.css"; \n\n/* namespaced locally */\n.game__board { /* ... */ } \n\n/* namespaced by player.st.css */\n.player__root { \nbackground: blue;\n}'})]}),"\n","\n",(0,a.jsx)(s.h3,{id:"stylesheet-root-selector",children:"Stylesheet root selector"}),"\n",(0,a.jsxs)(s.p,{children:["It's important to note that a default import of a Stylable stylesheet represents a component root, and is in fact pointing to the ",(0,a.jsx)(s.code,{children:"root"})," class of that stylesheet."]}),"\n",(0,a.jsxs)(s.admonition,{title:"Unscoped warning",type:"caution",children:[(0,a.jsxs)(s.p,{children:["By importing the default export of a stylesheet and then styling it, we are potentially customizing every instance of the component across our project. It is therefore ",(0,a.jsx)(s.strong,{children:"strongly recommended"})," to scope any selector that originates from a different namespace (stylesheet) or includes native elements with a local class."]}),(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",children:'@st-import Player from "./player.st.css";\n\n/* report unscoped warnings */\nPlayer {}\ndiv {}\n\n/* no warnings */\n.root Player {}\n.root div {}\n'})})]}),"\n",(0,a.jsx)(s.h2,{id:"class-named-import",children:"Class named import"}),"\n",(0,a.jsxs)(s.p,{children:["For the next step, we would like to add ",(0,a.jsx)(s.code,{children:"avatar"})," and ",(0,a.jsx)(s.code,{children:"username"})," parts to ",(0,a.jsx)(s.code,{children:"player.st.css"}),". These will be applied to the inner elements of the component, and are assumed to be nested under the ",(0,a.jsx)(s.code,{children:"root"})," class."]}),"\n","\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="player.st.css - added avatar and username"',children:".root {\n -st-states: registered,\n ranking(enum(first, second, third));\n}\n.avatar {}\n.username {}\n"})}),"\n","\n",(0,a.jsx)(s.p,{children:"We then proceed to bind these new classes to their matching elements in the component."}),"\n","\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-jsx",metastring:'title="player.jsx - bind avatar and username"',children:'import { st, classes } from "./player.st.css";\n\nconst Player = ({ className }) => {\n return (\n\n \n \n\n )\n}\n'})}),"\n","\n",(0,a.jsxs)(s.p,{children:["Now that we have these new classes, we can customize them externally through ",(0,a.jsx)(s.code,{children:"game.st.css"}),". We do this by adding two ",(0,a.jsx)(s.code,{children:"named imports"}),", inside square brackets, that link to our classes."]}),"\n","\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="game.st.css - player customization"',children:'@st-import Player, [avatar, username] from "./player.st.css";\n\nPlayer {\n /* paint the Player component background blue */\n background: blue;\n}\nPlayer .avatar {\n /* circle avatar */\n border-radius: 50%;\n}\nPlayer .username {\n /* all caps username */\n text-transform: uppercase;\n}\n'})}),"\n",(0,a.jsxs)(t,{children:[(0,a.jsx)("summary",{children:(0,a.jsx)(s.p,{children:"Namespacing output - selectors only"})}),(0,a.jsx)(o.A,{title:"game.st.css",language:"css",children:'@st-import Player, [avatar, username] from "./player.st.css"; \n\n.player__root {}\n.player__root .player__avatar {}\n.player__root .player__username {}'})]}),"\n","\n",(0,a.jsx)(s.h3,{id:"validations",children:"Validations"}),"\n",(0,a.jsx)(s.p,{children:"One of the nice things that we gain by using these Stylable imports is that requested symbols are validated, and we'll be notified if any of the imported parts are not found."}),"\n",(0,a.jsx)(s.pre,{children:(0,a.jsx)(s.code,{className:"language-css",metastring:'title="game.st.css - missing import"',children:'/* report an error about an unknown "missingImport" symbol */\n@st-import [missingImport] from "./player.st.css";\n'})}),"\n",(0,a.jsx)(s.h3,{id:"exported-by-default",children:"Exported by default"}),"\n",(0,a.jsx)(s.p,{children:"Any classes and other symbols defined in a stylesheet are automatically exported and available for import."}),"\n",(0,a.jsx)(s.admonition,{title:"Explicit exports",type:"note",children:(0,a.jsxs)(s.p,{children:["We are in the process of developing ",(0,a.jsx)(s.a,{href:"https://github.com/wix/stylable/issues/2604",children:"explicit export support"}),", and will expand this section once available."]})}),"\n",(0,a.jsx)(s.h2,{id:"further-import-use-cases",children:"Further import use-cases"}),"\n",(0,a.jsx)(s.p,{children:"Up to this point, we've only needed to import classes between stylesheets. In later chapters of this guide, we will learn how to import and use additional symbols, as well as additional import use cases from JavaScript to our stylesheet."}),"\n",(0,a.jsxs)(s.p,{children:["Check out the API cheatsheet to see various ",(0,a.jsx)(s.a,{href:"../../references/cheatsheet#module-system",children:"@st-import"})," examples."]}),"\n",(0,a.jsx)(s.hr,{}),"\n",(0,a.jsx)(s.p,{children:"In this chapter, we've seen how to divide a stylesheet to separate modules, and how to customize those externally. We approached doing this by manually importing each class (default or named), and customizing them together using a selector."}),"\n",(0,a.jsxs)(s.p,{children:["In the ",(0,a.jsx)(s.a,{href:"./extend",children:"Next chapter"}),", we'll learn how Stylable can extend stylesheets, exposing their inner parts as an API to make our lives easier."]})]})}function p(e={}){const{wrapper:s}={...(0,r.R)(),...e.components};return s?(0,a.jsx)(s,{...e,children:(0,a.jsx)(h,{...e})}):h(e)}}}]); \ No newline at end of file diff --git a/assets/js/ccc49370.a152809e.js b/assets/js/ccc49370.78db7b43.js similarity index 84% rename from assets/js/ccc49370.a152809e.js rename to assets/js/ccc49370.78db7b43.js index 09cc3477..22867deb 100644 --- a/assets/js/ccc49370.a152809e.js +++ b/assets/js/ccc49370.78db7b43.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[3249],{1917:(e,t,n)=>{n.r(t),n.d(t,{default:()=>b});n(6540);var i=n(4164),a=n(6644),s=n(8630),r=n(9101),l=n(6953),o=n(8406),c=n(3230),d=n(3555),u=n(4848);function m(e){const{nextItem:t,prevItem:n}=e;return(0,u.jsxs)("nav",{className:"pagination-nav docusaurus-mt-lg","aria-label":(0,c.T)({id:"theme.blog.post.paginator.navAriaLabel",message:"Blog post page navigation",description:"The ARIA label for the blog posts pagination"}),children:[n&&(0,u.jsx)(d.A,{...n,subLabel:(0,u.jsx)(c.A,{id:"theme.blog.post.paginator.newerPost",description:"The blog post button label to navigate to the newer/previous post",children:"Newer post"})}),t&&(0,u.jsx)(d.A,{...t,subLabel:(0,u.jsx)(c.A,{id:"theme.blog.post.paginator.olderPost",description:"The blog post button label to navigate to the older/next post",children:"Older post"}),isNext:!0})]})}function h(){const{assets:e,metadata:t}=(0,r.e7)(),{title:n,description:i,date:s,tags:l,authors:o,frontMatter:c}=t,{keywords:d}=c,m=e.image??c.image;return(0,u.jsxs)(a.be,{title:c.title_meta??n,description:i,keywords:d,image:m,children:[(0,u.jsx)("meta",{property:"og:type",content:"article"}),(0,u.jsx)("meta",{property:"article:published_time",content:s}),o.some((e=>e.url))&&(0,u.jsx)("meta",{property:"article:author",content:o.map((e=>e.url)).filter(Boolean).join(",")}),l.length>0&&(0,u.jsx)("meta",{property:"article:tag",content:l.map((e=>e.label)).join(",")})]})}var f=n(1141);function g(){const e=(0,r.J_)();return(0,u.jsx)(f.A,{children:(0,u.jsx)("script",{type:"application/ld+json",children:JSON.stringify(e)})})}var p=n(8793),v=n(4648);function x(e){let{sidebar:t,children:n}=e;const{metadata:i,toc:a}=(0,r.e7)(),{nextItem:s,prevItem:c,frontMatter:d}=i,{hide_table_of_contents:h,toc_min_heading_level:f,toc_max_heading_level:g}=d;return(0,u.jsxs)(l.A,{sidebar:t,toc:!h&&a.length>0?(0,u.jsx)(p.A,{toc:a,minHeadingLevel:f,maxHeadingLevel:g}):void 0,children:[(0,u.jsx)(v.A,{metadata:i}),(0,u.jsx)(o.A,{children:n}),(s||c)&&(0,u.jsx)(m,{nextItem:s,prevItem:c})]})}function b(e){const t=e.content;return(0,u.jsx)(r.in,{content:e.content,isBlogPostPage:!0,children:(0,u.jsxs)(a.e3,{className:(0,i.A)(s.G.wrapper.blogPages,s.G.page.blogPostPage),children:[(0,u.jsx)(h,{}),(0,u.jsx)(g,{}),(0,u.jsx)(x,{sidebar:e.sidebar,children:(0,u.jsx)(t,{})})]})})}},8811:(e,t,n)=>{n.d(t,{A:()=>c});n(6540);var i=n(4164),a=n(6907),s=n(8630),r=n(4182),l=n(4848);function o(e){let{className:t}=e;return(0,l.jsx)(r.A,{type:"caution",title:(0,l.jsx)(a.Rc,{}),className:(0,i.A)(t,s.G.common.unlistedBanner),children:(0,l.jsx)(a.Uh,{})})}function c(e){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(a.AE,{}),(0,l.jsx)(o,{...e})]})}},4648:(e,t,n)=>{n.d(t,{A:()=>d});n(6540);var i=n(4164),a=n(6907),s=n(8630),r=n(4182),l=n(4848);function o(e){let{className:t}=e;return(0,l.jsx)(r.A,{type:"caution",title:(0,l.jsx)(a.Yh,{}),className:(0,i.A)(t,s.G.common.draftBanner),children:(0,l.jsx)(a.TT,{})})}var c=n(8811);function d(e){let{metadata:t}=e;const{unlisted:n,frontMatter:i}=t;return(0,l.jsxs)(l.Fragment,{children:[(n||i.unlisted)&&(0,l.jsx)(c.A,{}),i.draft&&(0,l.jsx)(o,{})]})}},8793:(e,t,n)=>{n.d(t,{A:()=>c});n(6540);var i=n(4164),a=n(1507);const s={tableOfContents:"tableOfContents_bqdL",docItemContainer:"docItemContainer_F8PC"};var r=n(4848);const l="table-of-contents__link toc-highlight",o="table-of-contents__link--active";function c(e){let{className:t,...n}=e;return(0,r.jsx)("div",{className:(0,i.A)(s.tableOfContents,"thin-scrollbar",t),children:(0,r.jsx)(a.A,{...n,linkClassName:l,linkActiveClassName:o})})}},1507:(e,t,n)=>{n.d(t,{A:()=>g});var i=n(6540),a=n(6957);function s(e){const t=e.map((e=>({...e,parentIndex:-1,children:[]}))),n=Array(7).fill(-1);t.forEach(((e,t)=>{const i=n.slice(2,e.level);e.parentIndex=Math.max(...i),n[e.level]=t}));const i=[];return t.forEach((e=>{const{parentIndex:n,...a}=e;n>=0?t[n].children.push(a):i.push(a)})),i}function r(e){let{toc:t,minHeadingLevel:n,maxHeadingLevel:i}=e;return t.flatMap((e=>{const t=r({toc:e.children,minHeadingLevel:n,maxHeadingLevel:i});return function(e){return e.level>=n&&e.level<=i}(e)?[{...e,children:t}]:t}))}function l(e){const t=e.getBoundingClientRect();return t.top===t.bottom?l(e.parentNode):t}function o(e,t){let{anchorTopOffset:n}=t;const i=e.find((e=>l(e).top>=n));if(i){return function(e){return e.top>0&&e.bottom\n \n {e.current=t?0:document.querySelector(".navbar").clientHeight}),[t]),e}function d(e){const t=(0,i.useRef)(void 0),n=c();(0,i.useEffect)((()=>{if(!e)return()=>{};const{linkClassName:i,linkActiveClassName:a,minHeadingLevel:s,maxHeadingLevel:r}=e;function l(){const e=function(e){return Array.from(document.getElementsByClassName(e))}(i),l=function(e){let{minHeadingLevel:t,maxHeadingLevel:n}=e;const i=[];for(let a=t;a<=n;a+=1)i.push(`h${a}.anchor`);return Array.from(document.querySelectorAll(i.join()))}({minHeadingLevel:s,maxHeadingLevel:r}),c=o(l,{anchorTopOffset:n.current}),d=e.find((e=>c&&c.id===function(e){return decodeURIComponent(e.href.substring(e.href.indexOf("#")+1))}(e)));e.forEach((e=>{!function(e,n){n?(t.current&&t.current!==e&&t.current.classList.remove(a),e.classList.add(a),t.current=e):e.classList.remove(a)}(e,e===d)}))}return document.addEventListener("scroll",l),document.addEventListener("resize",l),l(),()=>{document.removeEventListener("scroll",l),document.removeEventListener("resize",l)}}),[e,n])}var u=n(4783),m=n(4848);function h(e){let{toc:t,className:n,linkClassName:i,isChild:a}=e;return t.length?(0,m.jsx)("ul",{className:a?void 0:n,children:t.map((e=>(0,m.jsxs)("li",{children:[(0,m.jsx)(u.A,{to:`#${e.id}`,className:i??void 0,dangerouslySetInnerHTML:{__html:e.value}}),(0,m.jsx)(h,{isChild:!0,toc:e.children,className:n,linkClassName:i})]},e.id)))}):null}const f=i.memo(h);function g(e){let{toc:t,className:n="table-of-contents table-of-contents__left-border",linkClassName:l="table-of-contents__link",linkActiveClassName:o,minHeadingLevel:c,maxHeadingLevel:u,...h}=e;const g=(0,a.p)(),p=c??g.tableOfContents.minHeadingLevel,v=u??g.tableOfContents.maxHeadingLevel,x=function(e){let{toc:t,minHeadingLevel:n,maxHeadingLevel:a}=e;return(0,i.useMemo)((()=>r({toc:s(t),minHeadingLevel:n,maxHeadingLevel:a})),[t,n,a])}({toc:t,minHeadingLevel:p,maxHeadingLevel:v});return d((0,i.useMemo)((()=>{if(l&&o)return{linkClassName:l,linkActiveClassName:o,minHeadingLevel:p,maxHeadingLevel:v}}),[l,o,p,v])),(0,m.jsx)(f,{toc:x,className:n,linkClassName:l,...h})}},6907:(e,t,n)=>{n.d(t,{AE:()=>o,Rc:()=>r,TT:()=>d,Uh:()=>l,Yh:()=>c});n(6540);var i=n(3230),a=n(1141),s=n(4848);function r(){return(0,s.jsx)(i.A,{id:"theme.contentVisibility.unlistedBanner.title",description:"The unlisted content banner title",children:"Unlisted page"})}function l(){return(0,s.jsx)(i.A,{id:"theme.contentVisibility.unlistedBanner.message",description:"The unlisted content banner message",children:"This page is unlisted. Search engines will not index it, and only users having a direct link can access it."})}function o(){return(0,s.jsx)(a.A,{children:(0,s.jsx)("meta",{name:"robots",content:"noindex, nofollow"})})}function c(){return(0,s.jsx)(i.A,{id:"theme.contentVisibility.draftBanner.title",description:"The draft content banner title",children:"Draft page"})}function d(){return(0,s.jsx)(i.A,{id:"theme.contentVisibility.draftBanner.message",description:"The draft content banner message",children:"This page is a draft. It will only be visible in dev and be excluded from the production build."})}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[3249],{3858:(e,t,n)=>{n.r(t),n.d(t,{default:()=>b});n(6540);var i=n(4164),a=n(1213),s=n(7559),r=n(4096),l=n(8027),o=n(4387),c=n(1312),d=n(9022),u=n(4848);function m(e){const{nextItem:t,prevItem:n}=e;return(0,u.jsxs)("nav",{className:"pagination-nav docusaurus-mt-lg","aria-label":(0,c.T)({id:"theme.blog.post.paginator.navAriaLabel",message:"Blog post page navigation",description:"The ARIA label for the blog posts pagination"}),children:[n&&(0,u.jsx)(d.A,{...n,subLabel:(0,u.jsx)(c.A,{id:"theme.blog.post.paginator.newerPost",description:"The blog post button label to navigate to the newer/previous post",children:"Newer post"})}),t&&(0,u.jsx)(d.A,{...t,subLabel:(0,u.jsx)(c.A,{id:"theme.blog.post.paginator.olderPost",description:"The blog post button label to navigate to the older/next post",children:"Older post"}),isNext:!0})]})}function h(){const{assets:e,metadata:t}=(0,r.e7)(),{title:n,description:i,date:s,tags:l,authors:o,frontMatter:c}=t,{keywords:d}=c,m=e.image??c.image;return(0,u.jsxs)(a.be,{title:c.title_meta??n,description:i,keywords:d,image:m,children:[(0,u.jsx)("meta",{property:"og:type",content:"article"}),(0,u.jsx)("meta",{property:"article:published_time",content:s}),o.some((e=>e.url))&&(0,u.jsx)("meta",{property:"article:author",content:o.map((e=>e.url)).filter(Boolean).join(",")}),l.length>0&&(0,u.jsx)("meta",{property:"article:tag",content:l.map((e=>e.label)).join(",")})]})}var f=n(5260);function g(){const e=(0,r.J_)();return(0,u.jsx)(f.A,{children:(0,u.jsx)("script",{type:"application/ld+json",children:JSON.stringify(e)})})}var p=n(7763),v=n(1689);function x(e){let{sidebar:t,children:n}=e;const{metadata:i,toc:a}=(0,r.e7)(),{nextItem:s,prevItem:c,frontMatter:d}=i,{hide_table_of_contents:h,toc_min_heading_level:f,toc_max_heading_level:g}=d;return(0,u.jsxs)(l.A,{sidebar:t,toc:!h&&a.length>0?(0,u.jsx)(p.A,{toc:a,minHeadingLevel:f,maxHeadingLevel:g}):void 0,children:[(0,u.jsx)(v.A,{metadata:i}),(0,u.jsx)(o.A,{children:n}),(s||c)&&(0,u.jsx)(m,{nextItem:s,prevItem:c})]})}function b(e){const t=e.content;return(0,u.jsx)(r.in,{content:e.content,isBlogPostPage:!0,children:(0,u.jsxs)(a.e3,{className:(0,i.A)(s.G.wrapper.blogPages,s.G.page.blogPostPage),children:[(0,u.jsx)(h,{}),(0,u.jsx)(g,{}),(0,u.jsx)(x,{sidebar:e.sidebar,children:(0,u.jsx)(t,{})})]})})}},2234:(e,t,n)=>{n.d(t,{A:()=>c});n(6540);var i=n(4164),a=n(4084),s=n(7559),r=n(7293),l=n(4848);function o(e){let{className:t}=e;return(0,l.jsx)(r.A,{type:"caution",title:(0,l.jsx)(a.Rc,{}),className:(0,i.A)(t,s.G.common.unlistedBanner),children:(0,l.jsx)(a.Uh,{})})}function c(e){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(a.AE,{}),(0,l.jsx)(o,{...e})]})}},1689:(e,t,n)=>{n.d(t,{A:()=>d});n(6540);var i=n(4164),a=n(4084),s=n(7559),r=n(7293),l=n(4848);function o(e){let{className:t}=e;return(0,l.jsx)(r.A,{type:"caution",title:(0,l.jsx)(a.Yh,{}),className:(0,i.A)(t,s.G.common.draftBanner),children:(0,l.jsx)(a.TT,{})})}var c=n(2234);function d(e){let{metadata:t}=e;const{unlisted:n,frontMatter:i}=t;return(0,l.jsxs)(l.Fragment,{children:[(n||i.unlisted)&&(0,l.jsx)(c.A,{}),i.draft&&(0,l.jsx)(o,{})]})}},7763:(e,t,n)=>{n.d(t,{A:()=>c});n(6540);var i=n(4164),a=n(5195);const s={tableOfContents:"tableOfContents_bqdL",docItemContainer:"docItemContainer_F8PC"};var r=n(4848);const l="table-of-contents__link toc-highlight",o="table-of-contents__link--active";function c(e){let{className:t,...n}=e;return(0,r.jsx)("div",{className:(0,i.A)(s.tableOfContents,"thin-scrollbar",t),children:(0,r.jsx)(a.A,{...n,linkClassName:l,linkActiveClassName:o})})}},5195:(e,t,n)=>{n.d(t,{A:()=>g});var i=n(6540),a=n(6342);function s(e){const t=e.map((e=>({...e,parentIndex:-1,children:[]}))),n=Array(7).fill(-1);t.forEach(((e,t)=>{const i=n.slice(2,e.level);e.parentIndex=Math.max(...i),n[e.level]=t}));const i=[];return t.forEach((e=>{const{parentIndex:n,...a}=e;n>=0?t[n].children.push(a):i.push(a)})),i}function r(e){let{toc:t,minHeadingLevel:n,maxHeadingLevel:i}=e;return t.flatMap((e=>{const t=r({toc:e.children,minHeadingLevel:n,maxHeadingLevel:i});return function(e){return e.level>=n&&e.level<=i}(e)?[{...e,children:t}]:t}))}function l(e){const t=e.getBoundingClientRect();return t.top===t.bottom?l(e.parentNode):t}function o(e,t){let{anchorTopOffset:n}=t;const i=e.find((e=>l(e).top>=n));if(i){return function(e){return e.top>0&&e.bottom {e.current=t?0:document.querySelector(".navbar").clientHeight}),[t]),e}function d(e){const t=(0,i.useRef)(void 0),n=c();(0,i.useEffect)((()=>{if(!e)return()=>{};const{linkClassName:i,linkActiveClassName:a,minHeadingLevel:s,maxHeadingLevel:r}=e;function l(){const e=function(e){return Array.from(document.getElementsByClassName(e))}(i),l=function(e){let{minHeadingLevel:t,maxHeadingLevel:n}=e;const i=[];for(let a=t;a<=n;a+=1)i.push(`h${a}.anchor`);return Array.from(document.querySelectorAll(i.join()))}({minHeadingLevel:s,maxHeadingLevel:r}),c=o(l,{anchorTopOffset:n.current}),d=e.find((e=>c&&c.id===function(e){return decodeURIComponent(e.href.substring(e.href.indexOf("#")+1))}(e)));e.forEach((e=>{!function(e,n){n?(t.current&&t.current!==e&&t.current.classList.remove(a),e.classList.add(a),t.current=e):e.classList.remove(a)}(e,e===d)}))}return document.addEventListener("scroll",l),document.addEventListener("resize",l),l(),()=>{document.removeEventListener("scroll",l),document.removeEventListener("resize",l)}}),[e,n])}var u=n(8774),m=n(4848);function h(e){let{toc:t,className:n,linkClassName:i,isChild:a}=e;return t.length?(0,m.jsx)("ul",{className:a?void 0:n,children:t.map((e=>(0,m.jsxs)("li",{children:[(0,m.jsx)(u.A,{to:`#${e.id}`,className:i??void 0,dangerouslySetInnerHTML:{__html:e.value}}),(0,m.jsx)(h,{isChild:!0,toc:e.children,className:n,linkClassName:i})]},e.id)))}):null}const f=i.memo(h);function g(e){let{toc:t,className:n="table-of-contents table-of-contents__left-border",linkClassName:l="table-of-contents__link",linkActiveClassName:o,minHeadingLevel:c,maxHeadingLevel:u,...h}=e;const g=(0,a.p)(),p=c??g.tableOfContents.minHeadingLevel,v=u??g.tableOfContents.maxHeadingLevel,x=function(e){let{toc:t,minHeadingLevel:n,maxHeadingLevel:a}=e;return(0,i.useMemo)((()=>r({toc:s(t),minHeadingLevel:n,maxHeadingLevel:a})),[t,n,a])}({toc:t,minHeadingLevel:p,maxHeadingLevel:v});return d((0,i.useMemo)((()=>{if(l&&o)return{linkClassName:l,linkActiveClassName:o,minHeadingLevel:p,maxHeadingLevel:v}}),[l,o,p,v])),(0,m.jsx)(f,{toc:x,className:n,linkClassName:l,...h})}},4084:(e,t,n)=>{n.d(t,{AE:()=>o,Rc:()=>r,TT:()=>d,Uh:()=>l,Yh:()=>c});n(6540);var i=n(1312),a=n(5260),s=n(4848);function r(){return(0,s.jsx)(i.A,{id:"theme.contentVisibility.unlistedBanner.title",description:"The unlisted content banner title",children:"Unlisted page"})}function l(){return(0,s.jsx)(i.A,{id:"theme.contentVisibility.unlistedBanner.message",description:"The unlisted content banner message",children:"This page is unlisted. Search engines will not index it, and only users having a direct link can access it."})}function o(){return(0,s.jsx)(a.A,{children:(0,s.jsx)("meta",{name:"robots",content:"noindex, nofollow"})})}function c(){return(0,s.jsx)(i.A,{id:"theme.contentVisibility.draftBanner.title",description:"The draft content banner title",children:"Draft page"})}function d(){return(0,s.jsx)(i.A,{id:"theme.contentVisibility.draftBanner.message",description:"The draft content banner message",children:"This page is a draft. It will only be visible in dev and be excluded from the production build."})}}}]); \ No newline at end of file diff --git a/assets/js/d879f3fa.e5bcb76a.js b/assets/js/d879f3fa.491194ca.js similarity index 99% rename from assets/js/d879f3fa.e5bcb76a.js rename to assets/js/d879f3fa.491194ca.js index 9299595a..d7f7a42f 100644 --- a/assets/js/d879f3fa.e5bcb76a.js +++ b/assets/js/d879f3fa.491194ca.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[7381],{6054:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>o,contentTitle:()=>i,default:()=>h,frontMatter:()=>l,metadata:()=>r,toc:()=>c});const r=JSON.parse('{"id":"references/layer","title":"Layer","description":"In CSS, @layer provides a way to group rules together in order to override other rules for better control of the styling order.","source":"@site/docs/references/layer.md","sourceDirName":"references","slug":"/references/layer","permalink":"/docs/references/layer","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/layer.md","tags":[],"version":"current","frontMatter":{"id":"layer","title":"Layer"},"sidebar":"Specification Reference","previous":{"title":"Keyframes","permalink":"/docs/references/keyframes"},"next":{"title":"Pseudo-Class","permalink":"/docs/references/pseudo-classes"}}');var a=s(4848),t=s(8453);const l={id:"layer",title:"Layer"},i=void 0,o={},c=[{value:"Syntax",id:"syntax",level:2},{value:"Import and Export",id:"import-and-export",level:2},{value:"Native CSS import",id:"native-css-import",level:3},{value:"Runtime",id:"runtime",level:2},{value:"Namespace",id:"namespace",level:2},{value:"Disable namespace",id:"disable-namespace",level:3}];function d(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(n.p,{children:["In CSS, ",(0,a.jsx)(n.code,{children:"@layer"})," provides a way to group rules together in order to override other rules for better control of the styling order."]}),"\n",(0,a.jsxs)(n.p,{children:["This page goes over how Stylable handles ",(0,a.jsx)(n.code,{children:"@layer"}),", for more details about the language feature itself, check out the following resources:"]}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:(0,a.jsx)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/@layer",children:"MDN @layer"})}),"\n",(0,a.jsx)(n.li,{children:(0,a.jsx)(n.a,{href:"https://www.bram.us/2021/09/15/the-future-of-css-cascade-layers-css-at-layer/",children:"The Future of CSS: Cascade Layers by Bramus"})}),"\n",(0,a.jsx)(n.li,{children:(0,a.jsx)(n.a,{href:"https://drafts.csswg.org/css-cascade-5/#layering",children:"CSS cascade spec"})}),"\n"]}),"\n",(0,a.jsx)(n.h2,{id:"syntax",children:"Syntax"}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"Layer order definition"})}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",children:"@layer base, layout, theme;\n"})}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"Layer style definition"})}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",children:"@layer theme {\n /* layer style rules */\n}\n"})}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"Nested style definition"})}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",children:"@layer theme {\n @layer app {\n /* layer style rules */\n }\n}\n\n/* equivalent to */\n\n@layer theme.app {\n /* layer style rules */\n}\n"})}),"\n",(0,a.jsx)(n.h2,{id:"import-and-export",children:"Import and Export"}),"\n",(0,a.jsxs)(n.p,{children:["An exported layer definition can be imported into another stylesheet with the ",(0,a.jsx)(n.a,{href:"/docs/references/imports",children:(0,a.jsx)(n.code,{children:"@st-import"})})," atrule."]}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"Insert rules into imported layer"})}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",children:"/* get base layer definition from another stylesheet */\n@st-import [layer(base)] from './x.st.css';\n\n/* insert rules into layer */\n@layer base {\n /* layer style rules */\n}\n"})}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"More import examples"})}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",children:"/* map 'base' layer to local name 'x-base' */\n@st-import [layer(base as x-base)] from './x.st.css';\n\n/* import multiple layers */\n@st-import [layer(layerA, layerB)] from './x.st.css';\n"})}),"\n",(0,a.jsx)(n.h3,{id:"native-css-import",children:"Native CSS import"}),"\n",(0,a.jsxs)(n.p,{children:["CSS native ",(0,a.jsx)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/@import",children:(0,a.jsx)(n.code,{children:"@import"})})," can be used to import a stylesheet into a layer:"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",children:"/* import the content of 'other.css' in the base layer */\n@import url(./x.css) layer(base);\n"})}),"\n",(0,a.jsx)(n.admonition,{type:"caution",children:(0,a.jsx)(n.p,{children:"While Stylable collects and namespaces layer definitions from native CSS imports, it does not handle bundling of them at current time, and they are not recommended for use."})}),"\n",(0,a.jsx)(n.h2,{id:"runtime",children:"Runtime"}),"\n",(0,a.jsxs)(n.p,{children:["A layer can be accessed for dynamic styles using the ",(0,a.jsx)(n.code,{children:"layers"})," mapping on the ",(0,a.jsx)(n.strong,{children:"Stylable"})," runtime stylesheet:"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-js",children:"import { layers } from './sheet.st.css';\n\n// map to target namespaced layer\nlayers['layer-name'];\n"})}),"\n",(0,a.jsx)(n.h2,{id:"namespace",children:"Namespace"}),"\n",(0,a.jsx)(n.p,{children:"Stylable automatically namespaces any layer name according to the stylesheet it is defined in:"}),"\n",(0,a.jsx)(n.p,{children:"Source:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",children:"@layer base, layout, theme;\n"})}),"\n",(0,a.jsx)(n.p,{children:"Output:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",children:"@layer ns__base, ns__layout, ns__theme;\n"})}),"\n",(0,a.jsx)(n.h3,{id:"disable-namespace",children:"Disable namespace"}),"\n",(0,a.jsxs)(n.p,{children:["In some cases the default namespace behavior is unwanted, for example when a layer is external and not defined or imported by Stylable. In such cases, ",(0,a.jsx)(n.code,{children:"st-global"})," can be used to mark a layer definition as global:"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",children:"/* keep the layer name as-is with no namespace */\n@layer st-global(external);\n"})}),"\n",(0,a.jsx)(n.p,{children:"Once a layer is marked as global, all references to that layer transpile to the un-namespaced name (nested or imported)."}),"\n",(0,a.jsxs)(n.blockquote,{children:["\n",(0,a.jsxs)(n.p,{children:["Notice that ",(0,a.jsx)(n.code,{children:"st-global"})," is not supported in nested definitions (e.g. ",(0,a.jsx)(n.code,{children:"a.st-global(external).c"}),") or native import (e.g. ",(0,a.jsx)(n.code,{children:"@import url() layer(st-global(external))"}),"), but marking the layer as global in a later definition will keep it global everywhere."]}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>l,x:()=>i});var r=s(6540);const a={},t=r.createContext(a);function l(e){const n=r.useContext(t);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:l(e.components),r.createElement(t.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[7381],{8514:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>o,contentTitle:()=>i,default:()=>h,frontMatter:()=>l,metadata:()=>r,toc:()=>c});const r=JSON.parse('{"id":"references/layer","title":"Layer","description":"In CSS, @layer provides a way to group rules together in order to override other rules for better control of the styling order.","source":"@site/docs/references/layer.md","sourceDirName":"references","slug":"/references/layer","permalink":"/docs/references/layer","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/layer.md","tags":[],"version":"current","frontMatter":{"id":"layer","title":"Layer"},"sidebar":"Specification Reference","previous":{"title":"Keyframes","permalink":"/docs/references/keyframes"},"next":{"title":"Pseudo-Class","permalink":"/docs/references/pseudo-classes"}}');var a=s(4848),t=s(8453);const l={id:"layer",title:"Layer"},i=void 0,o={},c=[{value:"Syntax",id:"syntax",level:2},{value:"Import and Export",id:"import-and-export",level:2},{value:"Native CSS import",id:"native-css-import",level:3},{value:"Runtime",id:"runtime",level:2},{value:"Namespace",id:"namespace",level:2},{value:"Disable namespace",id:"disable-namespace",level:3}];function d(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(n.p,{children:["In CSS, ",(0,a.jsx)(n.code,{children:"@layer"})," provides a way to group rules together in order to override other rules for better control of the styling order."]}),"\n",(0,a.jsxs)(n.p,{children:["This page goes over how Stylable handles ",(0,a.jsx)(n.code,{children:"@layer"}),", for more details about the language feature itself, check out the following resources:"]}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:(0,a.jsx)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/@layer",children:"MDN @layer"})}),"\n",(0,a.jsx)(n.li,{children:(0,a.jsx)(n.a,{href:"https://www.bram.us/2021/09/15/the-future-of-css-cascade-layers-css-at-layer/",children:"The Future of CSS: Cascade Layers by Bramus"})}),"\n",(0,a.jsx)(n.li,{children:(0,a.jsx)(n.a,{href:"https://drafts.csswg.org/css-cascade-5/#layering",children:"CSS cascade spec"})}),"\n"]}),"\n",(0,a.jsx)(n.h2,{id:"syntax",children:"Syntax"}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"Layer order definition"})}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",children:"@layer base, layout, theme;\n"})}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"Layer style definition"})}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",children:"@layer theme {\n /* layer style rules */\n}\n"})}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"Nested style definition"})}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",children:"@layer theme {\n @layer app {\n /* layer style rules */\n }\n}\n\n/* equivalent to */\n\n@layer theme.app {\n /* layer style rules */\n}\n"})}),"\n",(0,a.jsx)(n.h2,{id:"import-and-export",children:"Import and Export"}),"\n",(0,a.jsxs)(n.p,{children:["An exported layer definition can be imported into another stylesheet with the ",(0,a.jsx)(n.a,{href:"/docs/references/imports",children:(0,a.jsx)(n.code,{children:"@st-import"})})," atrule."]}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"Insert rules into imported layer"})}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",children:"/* get base layer definition from another stylesheet */\n@st-import [layer(base)] from './x.st.css';\n\n/* insert rules into layer */\n@layer base {\n /* layer style rules */\n}\n"})}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"More import examples"})}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",children:"/* map 'base' layer to local name 'x-base' */\n@st-import [layer(base as x-base)] from './x.st.css';\n\n/* import multiple layers */\n@st-import [layer(layerA, layerB)] from './x.st.css';\n"})}),"\n",(0,a.jsx)(n.h3,{id:"native-css-import",children:"Native CSS import"}),"\n",(0,a.jsxs)(n.p,{children:["CSS native ",(0,a.jsx)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/@import",children:(0,a.jsx)(n.code,{children:"@import"})})," can be used to import a stylesheet into a layer:"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",children:"/* import the content of 'other.css' in the base layer */\n@import url(./x.css) layer(base);\n"})}),"\n",(0,a.jsx)(n.admonition,{type:"caution",children:(0,a.jsx)(n.p,{children:"While Stylable collects and namespaces layer definitions from native CSS imports, it does not handle bundling of them at current time, and they are not recommended for use."})}),"\n",(0,a.jsx)(n.h2,{id:"runtime",children:"Runtime"}),"\n",(0,a.jsxs)(n.p,{children:["A layer can be accessed for dynamic styles using the ",(0,a.jsx)(n.code,{children:"layers"})," mapping on the ",(0,a.jsx)(n.strong,{children:"Stylable"})," runtime stylesheet:"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-js",children:"import { layers } from './sheet.st.css';\n\n// map to target namespaced layer\nlayers['layer-name'];\n"})}),"\n",(0,a.jsx)(n.h2,{id:"namespace",children:"Namespace"}),"\n",(0,a.jsx)(n.p,{children:"Stylable automatically namespaces any layer name according to the stylesheet it is defined in:"}),"\n",(0,a.jsx)(n.p,{children:"Source:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",children:"@layer base, layout, theme;\n"})}),"\n",(0,a.jsx)(n.p,{children:"Output:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",children:"@layer ns__base, ns__layout, ns__theme;\n"})}),"\n",(0,a.jsx)(n.h3,{id:"disable-namespace",children:"Disable namespace"}),"\n",(0,a.jsxs)(n.p,{children:["In some cases the default namespace behavior is unwanted, for example when a layer is external and not defined or imported by Stylable. In such cases, ",(0,a.jsx)(n.code,{children:"st-global"})," can be used to mark a layer definition as global:"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",children:"/* keep the layer name as-is with no namespace */\n@layer st-global(external);\n"})}),"\n",(0,a.jsx)(n.p,{children:"Once a layer is marked as global, all references to that layer transpile to the un-namespaced name (nested or imported)."}),"\n",(0,a.jsxs)(n.blockquote,{children:["\n",(0,a.jsxs)(n.p,{children:["Notice that ",(0,a.jsx)(n.code,{children:"st-global"})," is not supported in nested definitions (e.g. ",(0,a.jsx)(n.code,{children:"a.st-global(external).c"}),") or native import (e.g. ",(0,a.jsx)(n.code,{children:"@import url() layer(st-global(external))"}),"), but marking the layer as global in a later definition will keep it global everywhere."]}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>l,x:()=>i});var r=s(6540);const a={},t=r.createContext(a);function l(e){const n=r.useContext(t);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:l(e.components),r.createElement(t.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/de106496.b8301a67.js b/assets/js/de106496.31074b54.js similarity index 98% rename from assets/js/de106496.b8301a67.js rename to assets/js/de106496.31074b54.js index adf4b6af..74ea2ad7 100644 --- a/assets/js/de106496.b8301a67.js +++ b/assets/js/de106496.31074b54.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[614],{6756:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>a,default:()=>p,frontMatter:()=>i,metadata:()=>r,toc:()=>c});const r=JSON.parse('{"id":"references/st-scope","title":"Scope","description":"Stylable scope enables you to wrap several style-rules using a single directive.","source":"@site/docs/references/st-scope.md","sourceDirName":"references","slug":"/references/st-scope","permalink":"/docs/references/st-scope","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/st-scope.md","tags":[],"version":"current","frontMatter":{"id":"st-scope","title":"Scope"},"sidebar":"Specification Reference","previous":{"title":"Root","permalink":"/docs/references/root"},"next":{"title":"Formatters","permalink":"/docs/references/formatters"}}');var s=t(4848),o=t(8453);const i={id:"st-scope",title:"Scope"},a=void 0,l={},c=[{value:"Syntax",id:"syntax",level:3},{value:"Theming with scope",id:"theming-with-scope",level:3},{value:"Creating a theme",id:"creating-a-theme",level:4},{value:"Extending a theme",id:"extending-a-theme",level:4},{value:"Theming with mixins",id:"theming-with-mixins",level:4}];function d(e){const n={code:"code",h3:"h3",h4:"h4",p:"p",pre:"pre",strong:"strong",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Stylable"})," scope enables you to wrap several style-rules using a single directive.\nThe scoping directive receives any valid Stylable selector to use for its scoping."]}),"\n",(0,s.jsx)(n.p,{children:"Stylable scoping directive is similar in its behavior to CSS nesting, but can only be applied to a single level."}),"\n",(0,s.jsx)(n.h3,{id:"syntax",children:"Syntax"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:"/* entry.st.css */\n@st-scope .root {\n input {\n color: purple;\n }\n}\n"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:"/* output */\n.entry__root input {\n color: purple;\n}\n"})}),"\n",(0,s.jsx)(n.h3,{id:"theming-with-scope",children:"Theming with scope"}),"\n",(0,s.jsx)(n.p,{children:"There are many possible patterns that can be used to theme a site or application in CSS. Stylable scoping capability serves as syntax sugar to allow an easier theme implementation."}),"\n",(0,s.jsx)(n.p,{children:"Below are several examples for how theming can be done."}),"\n",(0,s.jsx)(n.h4,{id:"creating-a-theme",children:"Creating a theme"}),"\n",(0,s.jsx)(n.p,{children:"In this example, we're representing a dark theme as a stylesheet. Creating your overriding rules under that Stylesheet's symbol and apply it to the relevant part of your DOM."}),"\n",(0,s.jsx)(n.p,{children:"In this theme implementation we are targeting three components and overriding their default look."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:'/* dark-theme.st.css */\n@st-import App, [Button, DropDown] from "./index.st.css";\n\n@st-scope .root {\n App {\n border-color: darkgrey;\n }\n Button {\n background: darkgreen;\n }\n DropDown {\n background: darkgrey;\n color: beige;\n }\n}\n'})}),"\n",(0,s.jsx)(n.h4,{id:"extending-a-theme",children:"Extending a theme"}),"\n",(0,s.jsx)(n.p,{children:"In this example, we are extending our previously created dark theme, with a specific override for the Gallery component."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:'@st-import Gallery from "./gallery.st.css";\n@st-import DarkTheme from "./dark.st.css";\n\n@st-scope DarkTheme {\n DropDown {\n color: yellow; /* overriding DarkTheme color, perserving background */\n }\n Gallery {\n background: darkgrey;\n }\n}\n'})}),"\n",(0,s.jsx)(n.h4,{id:"theming-with-mixins",children:"Theming with mixins"}),"\n",(0,s.jsx)(n.p,{children:"In this file, we are creating pre-designed flavors that uses Stylable variables to determine their styling."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:'/* flavors.st.css */\n@st-import [Button, UserForm] from "./index.st.css";\n\n:vars {\n background: white;\n text: black;\n bordercolor: green;\n}\n\n.button-flavor {\n -st-extends: Button;\n background: value(background);\n color: value(text);\n}\n\n.userForm-flavor {\n -st-extends: UserForm;\n background: value(background);\n color: value(text);\n border: 1px solid value(borderColor);\n}\n'})}),"\n",(0,s.jsx)(n.p,{children:"In this example, we use our existing flavors from above to customize our components look under the dark theme."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:'@st-import [UserForm, Button] from "./index.st.css";\n@st-import [button-flavor, userForm-flavor] from "./flavors.st.css";\n\n@st-scope .root {\n Button {\n -st-mixin: button-flavor(background black, text white);\n }\n\n UserForm {\n -st-mixin: userForm-flavor(background black, text white, borderColor #f4f4f4);\n }\n}\n'})})]})}function p(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>a});var r=t(6540);const s={},o=r.createContext(s);function i(e){const n=r.useContext(o);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),r.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[614],{4059:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>a,default:()=>p,frontMatter:()=>i,metadata:()=>r,toc:()=>c});const r=JSON.parse('{"id":"references/st-scope","title":"Scope","description":"Stylable scope enables you to wrap several style-rules using a single directive.","source":"@site/docs/references/st-scope.md","sourceDirName":"references","slug":"/references/st-scope","permalink":"/docs/references/st-scope","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/st-scope.md","tags":[],"version":"current","frontMatter":{"id":"st-scope","title":"Scope"},"sidebar":"Specification Reference","previous":{"title":"Root","permalink":"/docs/references/root"},"next":{"title":"Formatters","permalink":"/docs/references/formatters"}}');var s=t(4848),o=t(8453);const i={id:"st-scope",title:"Scope"},a=void 0,l={},c=[{value:"Syntax",id:"syntax",level:3},{value:"Theming with scope",id:"theming-with-scope",level:3},{value:"Creating a theme",id:"creating-a-theme",level:4},{value:"Extending a theme",id:"extending-a-theme",level:4},{value:"Theming with mixins",id:"theming-with-mixins",level:4}];function d(e){const n={code:"code",h3:"h3",h4:"h4",p:"p",pre:"pre",strong:"strong",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Stylable"})," scope enables you to wrap several style-rules using a single directive.\nThe scoping directive receives any valid Stylable selector to use for its scoping."]}),"\n",(0,s.jsx)(n.p,{children:"Stylable scoping directive is similar in its behavior to CSS nesting, but can only be applied to a single level."}),"\n",(0,s.jsx)(n.h3,{id:"syntax",children:"Syntax"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:"/* entry.st.css */\n@st-scope .root {\n input {\n color: purple;\n }\n}\n"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:"/* output */\n.entry__root input {\n color: purple;\n}\n"})}),"\n",(0,s.jsx)(n.h3,{id:"theming-with-scope",children:"Theming with scope"}),"\n",(0,s.jsx)(n.p,{children:"There are many possible patterns that can be used to theme a site or application in CSS. Stylable scoping capability serves as syntax sugar to allow an easier theme implementation."}),"\n",(0,s.jsx)(n.p,{children:"Below are several examples for how theming can be done."}),"\n",(0,s.jsx)(n.h4,{id:"creating-a-theme",children:"Creating a theme"}),"\n",(0,s.jsx)(n.p,{children:"In this example, we're representing a dark theme as a stylesheet. Creating your overriding rules under that Stylesheet's symbol and apply it to the relevant part of your DOM."}),"\n",(0,s.jsx)(n.p,{children:"In this theme implementation we are targeting three components and overriding their default look."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:'/* dark-theme.st.css */\n@st-import App, [Button, DropDown] from "./index.st.css";\n\n@st-scope .root {\n App {\n border-color: darkgrey;\n }\n Button {\n background: darkgreen;\n }\n DropDown {\n background: darkgrey;\n color: beige;\n }\n}\n'})}),"\n",(0,s.jsx)(n.h4,{id:"extending-a-theme",children:"Extending a theme"}),"\n",(0,s.jsx)(n.p,{children:"In this example, we are extending our previously created dark theme, with a specific override for the Gallery component."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:'@st-import Gallery from "./gallery.st.css";\n@st-import DarkTheme from "./dark.st.css";\n\n@st-scope DarkTheme {\n DropDown {\n color: yellow; /* overriding DarkTheme color, perserving background */\n }\n Gallery {\n background: darkgrey;\n }\n}\n'})}),"\n",(0,s.jsx)(n.h4,{id:"theming-with-mixins",children:"Theming with mixins"}),"\n",(0,s.jsx)(n.p,{children:"In this file, we are creating pre-designed flavors that uses Stylable variables to determine their styling."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:'/* flavors.st.css */\n@st-import [Button, UserForm] from "./index.st.css";\n\n:vars {\n background: white;\n text: black;\n bordercolor: green;\n}\n\n.button-flavor {\n -st-extends: Button;\n background: value(background);\n color: value(text);\n}\n\n.userForm-flavor {\n -st-extends: UserForm;\n background: value(background);\n color: value(text);\n border: 1px solid value(borderColor);\n}\n'})}),"\n",(0,s.jsx)(n.p,{children:"In this example, we use our existing flavors from above to customize our components look under the dark theme."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:'@st-import [UserForm, Button] from "./index.st.css";\n@st-import [button-flavor, userForm-flavor] from "./flavors.st.css";\n\n@st-scope .root {\n Button {\n -st-mixin: button-flavor(background black, text white);\n }\n\n UserForm {\n -st-mixin: userForm-flavor(background black, text white, borderColor #f4f4f4);\n }\n}\n'})})]})}function p(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>a});var r=t(6540);const s={},o=r.createContext(s);function i(e){const n=r.useContext(o);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),r.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/de714d10.9df8e645.js b/assets/js/de714d10.be755631.js similarity index 99% rename from assets/js/de714d10.9df8e645.js rename to assets/js/de714d10.be755631.js index 27056125..5e2b9f84 100644 --- a/assets/js/de714d10.9df8e645.js +++ b/assets/js/de714d10.be755631.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[4729],{7895:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>r,contentTitle:()=>a,default:()=>h,frontMatter:()=>l,metadata:()=>t,toc:()=>c});const t=JSON.parse('{"id":"guides/component-best-practices","title":"Stylable Component - Best Practices","description":"Stylable components should be easily stylable and themable from the outside. This means that the stylesheet describing the component CSS should be as simple and generic as possible, and should expose a clear and concise API for its internal parts.","source":"@site/docs/guides/component-best-practices.md","sourceDirName":"guides","slug":"/guides/component-best-practices","permalink":"/docs/guides/component-best-practices","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/guides/component-best-practices.md","tags":[],"version":"current","frontMatter":{"id":"component-best-practices","title":"Stylable Component - Best Practices","sidebar_label":"Component Best Practices"},"sidebar":"Guides","previous":{"title":"Extend","permalink":"/docs/guides/handbook/extend"},"next":{"title":"Project Commons","permalink":"/docs/guides/project-commons"}}');var o=n(4848),i=n(8453);const l={id:"component-best-practices",title:"Stylable Component - Best Practices",sidebar_label:"Component Best Practices"},a=void 0,r={},c=[{value:"Avoid size declarations",id:"avoid-size-declarations",level:2},{value:"Give meaningful names",id:"give-meaningful-names",level:2},{value:"Avoid global settings in your stylesheet",id:"avoid-global-settings-in-your-stylesheet",level:2},{value:"Keep your layout minimal",id:"keep-your-layout-minimal",level:2},{value:"Keep coloring to a minimum",id:"keep-coloring-to-a-minimum",level:2},{value:"Keep browser defaults intact",id:"keep-browser-defaults-intact",level:2},{value:"Keep specificity low",id:"keep-specificity-low",level:2},{value:"Keep your selectors as simple as possible",id:"keep-your-selectors-as-simple-as-possible",level:2},{value:"Justify your CSS declarations in comments",id:"justify-your-css-declarations-in-comments",level:2},{value:"Use consistent variables from a central location",id:"use-consistent-variables-from-a-central-location",level:2},{value:"Keep SVG and images overridable",id:"keep-svg-and-images-overridable",level:2}];function d(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",strong:"strong",...(0,i.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(s.p,{children:[(0,o.jsx)(s.strong,{children:"Stylable"})," components should be easily stylable and themable from the outside. This means that the stylesheet describing the component CSS should be as ",(0,o.jsx)(s.strong,{children:"simple"})," and ",(0,o.jsx)(s.strong,{children:"generic"})," as possible, and should expose a clear and concise API for its internal parts."]}),"\n",(0,o.jsxs)(s.p,{children:["When building your components, we recommend following the guidelines below that we've collected through our work with ",(0,o.jsx)(s.strong,{children:"Stylable"}),":"]}),"\n",(0,o.jsx)(s.h2,{id:"avoid-size-declarations",children:"Avoid size declarations"}),"\n",(0,o.jsx)(s.p,{children:"Try avoiding size declaration just because it offers an easier API. To override a component specifying size limitations, you would need to override multiple CSS declarations."}),"\n",(0,o.jsxs)(s.p,{children:["If you do set a default size or size limitations, use ",(0,o.jsx)(s.code,{children:"em/rem"})," units to resize to the HTML context."]}),"\n",(0,o.jsx)(s.h2,{id:"give-meaningful-names",children:"Give meaningful names"}),"\n",(0,o.jsxs)(s.p,{children:["Give meaningful class names that will make sense as part of a selector. Any CSS class selector can be targeted from the outside as a ",(0,o.jsx)(s.a,{href:"/docs/references/pseudo-elements",children:(0,o.jsx)(s.code,{children:"pseudo-element"})})," and should be considered part of the component API."]}),"\n",(0,o.jsx)(s.p,{children:"Use camelCase and avoid hyphens (-) and capital letters at the beginning."}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-css",children:"/* good */\nGallery::navbtn::label {\n} /* camelCase with clear pseudo-element names */\n"})}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-css",children:"/* bad */\nGallery::gallerynavbtn {\n} /* it is better to reuse the generic component id */\nGallery::nav-btn {\n} /* don't use kebab-case - stylable exports JS */\n"})}),"\n",(0,o.jsx)(s.h2,{id:"avoid-global-settings-in-your-stylesheet",children:"Avoid global settings in your stylesheet"}),"\n",(0,o.jsxs)(s.p,{children:["Try avoiding global-related selectors like ",(0,o.jsx)(s.code,{children:"@media"})," or matching DOM outside the component scope like ",(0,o.jsx)(s.code,{children:"body"}),". These would potentially cause side effects if others use them."]}),"\n",(0,o.jsxs)(s.p,{children:[(0,o.jsx)(s.a,{href:"/docs/references/type-selectors",children:"Element type selectors"})," should be avoided inside a component because they affect any nested component or element. The exception to this is when specifically targeting the element with ",(0,o.jsx)(s.strong,{children:"child selector"})," (for example ",(0,o.jsx)(s.code,{children:".root > p"}),") and not a ",(0,o.jsx)(s.strong,{children:"descendant selector"})," (for example ",(0,o.jsx)(s.code,{children:".root p"}),")."]}),"\n",(0,o.jsx)(s.h2,{id:"keep-your-layout-minimal",children:"Keep your layout minimal"}),"\n",(0,o.jsx)(s.p,{children:"While internal structure does demand some CSS to work correctly, you should strive to find the minimal combination of CSS to make the component layout work as it should."}),"\n",(0,o.jsx)(s.h2,{id:"keep-coloring-to-a-minimum",children:"Keep coloring to a minimum"}),"\n",(0,o.jsx)(s.p,{children:"The component stylesheet should describe the bare minimum coloring to make its parts visible. Colors should be used sparingly, and just to achieve visibility."}),"\n",(0,o.jsx)(s.p,{children:"The best practice is to make sure every color used for a text across the project has a sufficiently contrasting background."}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-css",children:".options {\n background: value(color1);\n color: value(color2);\n}\n"})}),"\n",(0,o.jsx)(s.h2,{id:"keep-browser-defaults-intact",children:"Keep browser defaults intact"}),"\n",(0,o.jsx)(s.p,{children:'Browsers add a default user agent stylesheet to provide the HTML with a default "style".'}),"\n",(0,o.jsxs)(s.p,{children:['It is tempting to "clean up" a ',(0,o.jsx)(s.code,{children:"button"}),"'s default style in the component. But, we want our component to \"blend in\" in every context it's used. A button element in our component should look like other button tags in the context of the application where it is used."]}),"\n",(0,o.jsxs)(s.p,{children:["As such, when building a component, it is best to set CSS only for behaviors that ",(0,o.jsx)(s.strong,{children:"must"})," be overridden for the component to function."]}),"\n",(0,o.jsx)(s.h2,{id:"keep-specificity-low",children:"Keep specificity low"}),"\n",(0,o.jsx)(s.p,{children:"Write low specificity selectors that will be easy to override from a parent component."}),"\n",(0,o.jsx)(s.h2,{id:"keep-your-selectors-as-simple-as-possible",children:"Keep your selectors as simple as possible"}),"\n",(0,o.jsx)(s.p,{children:"It takes a more complex selector to override a high specificity selector that was defined in a component stylesheet."}),"\n",(0,o.jsxs)(s.p,{children:["Override CSS only for behaviors that ",(0,o.jsx)(s.strong,{children:"must"})," be overridden for the component to function, and minimize the use of ",(0,o.jsx)(s.code,{children:"element type selectors"})," and ",(0,o.jsx)(s.code,{children:"pseudo-elements"})," of nested components."]}),"\n",(0,o.jsx)(s.p,{children:"Styling pseudo-elements in a component creates a selector that takes more specificity to override"}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-css",metastring:'title="gallery.st.css"',children:"/* \n> directly style navBtn - a type of button\nselector: .comp__gallery .gallery__navBtn\nspecificity: 0,0,2,0 \n*/\n.gallery::navbtn {}\n"})}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-css",metastring:'title="page.st.css"',children:"/* \n> less specific than component override \nselector: .page__root button\nspecificity: 0,0,1,1\n*/\n.root button {}\n"})}),"\n",(0,o.jsx)(s.admonition,{type:"note",children:(0,o.jsxs)(s.p,{children:["For the ",(0,o.jsx)(s.code,{children:"button"})," selector, we manually added the ",(0,o.jsx)(s.code,{children:".root"})," class to avoid overriding ",(0,o.jsx)(s.code,{children:"button"})," outside this scope."]})}),"\n",(0,o.jsx)(s.h2,{id:"justify-your-css-declarations-in-comments",children:"Justify your CSS declarations in comments"}),"\n",(0,o.jsx)(s.p,{children:"A good way to validate minimal CSS is to add comments. There should be a few words clarifying why a certain declaration or rule set combination is found in the stylesheet. We recommend you justify any special overrides or interactions with a comment per this example."}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-css",children:".link {\n display: block;\n /* override default anchor color */\n color: currentColor;\n}\n"})}),"\n",(0,o.jsx)(s.p,{children:"This helps with maintenance and development, since we don't test CSS as thoroughly as other code."}),"\n",(0,o.jsx)(s.h2,{id:"use-consistent-variables-from-a-central-location",children:"Use consistent variables from a central location"}),"\n",(0,o.jsxs)(s.p,{children:["Import CSS or Stylable variables from the ",(0,o.jsx)(s.a,{href:"/docs/guides/project-commons",children:"project commons stylesheet"}),"."]}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-css",children:'@st-import [color1, --font-small] from "./project.st.css";\n\n.item {\n background: value(color1);\n font-size: var(--font-small);\n}\n'})}),"\n",(0,o.jsx)(s.h2,{id:"keep-svg-and-images-overridable",children:"Keep SVG and images overridable"}),"\n",(0,o.jsx)(s.p,{children:"When using an image element source or SVG directly in the DOM, it is not easy, and in some cases not possible, to modify the asset from outside the component using CSS."}),"\n",(0,o.jsx)(s.p,{children:"When an asset is part of the style API, it should be placed in the background of an element, allowing it to be overridden from a parent component."})]})}function h(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,o.jsx)(s,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,s,n)=>{n.d(s,{R:()=>l,x:()=>a});var t=n(6540);const o={},i=t.createContext(o);function l(e){const s=t.useContext(i);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function a(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:l(e.components),t.createElement(i.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[4729],{7415:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>r,contentTitle:()=>a,default:()=>h,frontMatter:()=>l,metadata:()=>t,toc:()=>c});const t=JSON.parse('{"id":"guides/component-best-practices","title":"Stylable Component - Best Practices","description":"Stylable components should be easily stylable and themable from the outside. This means that the stylesheet describing the component CSS should be as simple and generic as possible, and should expose a clear and concise API for its internal parts.","source":"@site/docs/guides/component-best-practices.md","sourceDirName":"guides","slug":"/guides/component-best-practices","permalink":"/docs/guides/component-best-practices","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/guides/component-best-practices.md","tags":[],"version":"current","frontMatter":{"id":"component-best-practices","title":"Stylable Component - Best Practices","sidebar_label":"Component Best Practices"},"sidebar":"Guides","previous":{"title":"Extend","permalink":"/docs/guides/handbook/extend"},"next":{"title":"Project Commons","permalink":"/docs/guides/project-commons"}}');var o=n(4848),i=n(8453);const l={id:"component-best-practices",title:"Stylable Component - Best Practices",sidebar_label:"Component Best Practices"},a=void 0,r={},c=[{value:"Avoid size declarations",id:"avoid-size-declarations",level:2},{value:"Give meaningful names",id:"give-meaningful-names",level:2},{value:"Avoid global settings in your stylesheet",id:"avoid-global-settings-in-your-stylesheet",level:2},{value:"Keep your layout minimal",id:"keep-your-layout-minimal",level:2},{value:"Keep coloring to a minimum",id:"keep-coloring-to-a-minimum",level:2},{value:"Keep browser defaults intact",id:"keep-browser-defaults-intact",level:2},{value:"Keep specificity low",id:"keep-specificity-low",level:2},{value:"Keep your selectors as simple as possible",id:"keep-your-selectors-as-simple-as-possible",level:2},{value:"Justify your CSS declarations in comments",id:"justify-your-css-declarations-in-comments",level:2},{value:"Use consistent variables from a central location",id:"use-consistent-variables-from-a-central-location",level:2},{value:"Keep SVG and images overridable",id:"keep-svg-and-images-overridable",level:2}];function d(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",strong:"strong",...(0,i.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(s.p,{children:[(0,o.jsx)(s.strong,{children:"Stylable"})," components should be easily stylable and themable from the outside. This means that the stylesheet describing the component CSS should be as ",(0,o.jsx)(s.strong,{children:"simple"})," and ",(0,o.jsx)(s.strong,{children:"generic"})," as possible, and should expose a clear and concise API for its internal parts."]}),"\n",(0,o.jsxs)(s.p,{children:["When building your components, we recommend following the guidelines below that we've collected through our work with ",(0,o.jsx)(s.strong,{children:"Stylable"}),":"]}),"\n",(0,o.jsx)(s.h2,{id:"avoid-size-declarations",children:"Avoid size declarations"}),"\n",(0,o.jsx)(s.p,{children:"Try avoiding size declaration just because it offers an easier API. To override a component specifying size limitations, you would need to override multiple CSS declarations."}),"\n",(0,o.jsxs)(s.p,{children:["If you do set a default size or size limitations, use ",(0,o.jsx)(s.code,{children:"em/rem"})," units to resize to the HTML context."]}),"\n",(0,o.jsx)(s.h2,{id:"give-meaningful-names",children:"Give meaningful names"}),"\n",(0,o.jsxs)(s.p,{children:["Give meaningful class names that will make sense as part of a selector. Any CSS class selector can be targeted from the outside as a ",(0,o.jsx)(s.a,{href:"/docs/references/pseudo-elements",children:(0,o.jsx)(s.code,{children:"pseudo-element"})})," and should be considered part of the component API."]}),"\n",(0,o.jsx)(s.p,{children:"Use camelCase and avoid hyphens (-) and capital letters at the beginning."}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-css",children:"/* good */\nGallery::navbtn::label {\n} /* camelCase with clear pseudo-element names */\n"})}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-css",children:"/* bad */\nGallery::gallerynavbtn {\n} /* it is better to reuse the generic component id */\nGallery::nav-btn {\n} /* don't use kebab-case - stylable exports JS */\n"})}),"\n",(0,o.jsx)(s.h2,{id:"avoid-global-settings-in-your-stylesheet",children:"Avoid global settings in your stylesheet"}),"\n",(0,o.jsxs)(s.p,{children:["Try avoiding global-related selectors like ",(0,o.jsx)(s.code,{children:"@media"})," or matching DOM outside the component scope like ",(0,o.jsx)(s.code,{children:"body"}),". These would potentially cause side effects if others use them."]}),"\n",(0,o.jsxs)(s.p,{children:[(0,o.jsx)(s.a,{href:"/docs/references/type-selectors",children:"Element type selectors"})," should be avoided inside a component because they affect any nested component or element. The exception to this is when specifically targeting the element with ",(0,o.jsx)(s.strong,{children:"child selector"})," (for example ",(0,o.jsx)(s.code,{children:".root > p"}),") and not a ",(0,o.jsx)(s.strong,{children:"descendant selector"})," (for example ",(0,o.jsx)(s.code,{children:".root p"}),")."]}),"\n",(0,o.jsx)(s.h2,{id:"keep-your-layout-minimal",children:"Keep your layout minimal"}),"\n",(0,o.jsx)(s.p,{children:"While internal structure does demand some CSS to work correctly, you should strive to find the minimal combination of CSS to make the component layout work as it should."}),"\n",(0,o.jsx)(s.h2,{id:"keep-coloring-to-a-minimum",children:"Keep coloring to a minimum"}),"\n",(0,o.jsx)(s.p,{children:"The component stylesheet should describe the bare minimum coloring to make its parts visible. Colors should be used sparingly, and just to achieve visibility."}),"\n",(0,o.jsx)(s.p,{children:"The best practice is to make sure every color used for a text across the project has a sufficiently contrasting background."}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-css",children:".options {\n background: value(color1);\n color: value(color2);\n}\n"})}),"\n",(0,o.jsx)(s.h2,{id:"keep-browser-defaults-intact",children:"Keep browser defaults intact"}),"\n",(0,o.jsx)(s.p,{children:'Browsers add a default user agent stylesheet to provide the HTML with a default "style".'}),"\n",(0,o.jsxs)(s.p,{children:['It is tempting to "clean up" a ',(0,o.jsx)(s.code,{children:"button"}),"'s default style in the component. But, we want our component to \"blend in\" in every context it's used. A button element in our component should look like other button tags in the context of the application where it is used."]}),"\n",(0,o.jsxs)(s.p,{children:["As such, when building a component, it is best to set CSS only for behaviors that ",(0,o.jsx)(s.strong,{children:"must"})," be overridden for the component to function."]}),"\n",(0,o.jsx)(s.h2,{id:"keep-specificity-low",children:"Keep specificity low"}),"\n",(0,o.jsx)(s.p,{children:"Write low specificity selectors that will be easy to override from a parent component."}),"\n",(0,o.jsx)(s.h2,{id:"keep-your-selectors-as-simple-as-possible",children:"Keep your selectors as simple as possible"}),"\n",(0,o.jsx)(s.p,{children:"It takes a more complex selector to override a high specificity selector that was defined in a component stylesheet."}),"\n",(0,o.jsxs)(s.p,{children:["Override CSS only for behaviors that ",(0,o.jsx)(s.strong,{children:"must"})," be overridden for the component to function, and minimize the use of ",(0,o.jsx)(s.code,{children:"element type selectors"})," and ",(0,o.jsx)(s.code,{children:"pseudo-elements"})," of nested components."]}),"\n",(0,o.jsx)(s.p,{children:"Styling pseudo-elements in a component creates a selector that takes more specificity to override"}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-css",metastring:'title="gallery.st.css"',children:"/* \n> directly style navBtn - a type of button\nselector: .comp__gallery .gallery__navBtn\nspecificity: 0,0,2,0 \n*/\n.gallery::navbtn {}\n"})}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-css",metastring:'title="page.st.css"',children:"/* \n> less specific than component override \nselector: .page__root button\nspecificity: 0,0,1,1\n*/\n.root button {}\n"})}),"\n",(0,o.jsx)(s.admonition,{type:"note",children:(0,o.jsxs)(s.p,{children:["For the ",(0,o.jsx)(s.code,{children:"button"})," selector, we manually added the ",(0,o.jsx)(s.code,{children:".root"})," class to avoid overriding ",(0,o.jsx)(s.code,{children:"button"})," outside this scope."]})}),"\n",(0,o.jsx)(s.h2,{id:"justify-your-css-declarations-in-comments",children:"Justify your CSS declarations in comments"}),"\n",(0,o.jsx)(s.p,{children:"A good way to validate minimal CSS is to add comments. There should be a few words clarifying why a certain declaration or rule set combination is found in the stylesheet. We recommend you justify any special overrides or interactions with a comment per this example."}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-css",children:".link {\n display: block;\n /* override default anchor color */\n color: currentColor;\n}\n"})}),"\n",(0,o.jsx)(s.p,{children:"This helps with maintenance and development, since we don't test CSS as thoroughly as other code."}),"\n",(0,o.jsx)(s.h2,{id:"use-consistent-variables-from-a-central-location",children:"Use consistent variables from a central location"}),"\n",(0,o.jsxs)(s.p,{children:["Import CSS or Stylable variables from the ",(0,o.jsx)(s.a,{href:"/docs/guides/project-commons",children:"project commons stylesheet"}),"."]}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-css",children:'@st-import [color1, --font-small] from "./project.st.css";\n\n.item {\n background: value(color1);\n font-size: var(--font-small);\n}\n'})}),"\n",(0,o.jsx)(s.h2,{id:"keep-svg-and-images-overridable",children:"Keep SVG and images overridable"}),"\n",(0,o.jsx)(s.p,{children:"When using an image element source or SVG directly in the DOM, it is not easy, and in some cases not possible, to modify the asset from outside the component using CSS."}),"\n",(0,o.jsx)(s.p,{children:"When an asset is part of the style API, it should be placed in the background of an element, allowing it to be overridden from a parent component."})]})}function h(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,o.jsx)(s,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,s,n)=>{n.d(s,{R:()=>l,x:()=>a});var t=n(6540);const o={},i=t.createContext(o);function l(e){const s=t.useContext(i);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function a(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:l(e.components),t.createElement(i.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/e19b9990.9b71d185.js b/assets/js/e19b9990.9b71d185.js new file mode 100644 index 00000000..0a483b31 --- /dev/null +++ b/assets/js/e19b9990.9b71d185.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[7377],{6817:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>u,contentTitle:()=>d,default:()=>p,frontMatter:()=>c,metadata:()=>t,toc:()=>h});const t=JSON.parse('{"id":"references/programmatic-api","title":"Programmatic API","description":"Stylable instance","source":"@site/docs/references/programmatic-api.mdx","sourceDirName":"references","slug":"/references/programmatic-api","permalink":"/docs/references/programmatic-api","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/programmatic-api.mdx","tags":[],"version":"current","frontMatter":{"id":"programmatic-api","title":"Programmatic API"},"sidebar":"Specification Reference","previous":{"title":"Runtime","permalink":"/docs/references/runtime"}}');var s=r(4848),l=r(8453),a=r(1470),i=r(9365),o=r(1432);const c={id:"programmatic-api",title:"Programmatic API"},d=void 0,u={},h=[{value:"Stylable instance",id:"stylable-instance",level:2},{value:"Configuration",id:"configuration",level:3},{value:" MinimalFS
",id:"minimalfs",level:3},{value:"ResolveNamespace
",id:"resolvenamespace",level:3},{value:"Basic example",id:"basic-example",level:4},{value:"ModuleResolver
",id:"moduleresolver",level:3},{value:"RequireModule
",id:"requiremodule",level:3}];function m(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,l.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h2,{id:"stylable-instance",children:"Stylable instance"}),"\n",(0,s.jsx)(n.p,{children:"Stylable is usually consumed through one of its available integration, for more specific or advanced use-cases, the programmatic API can be used for greater control on how Stylable operates."}),"\n",(0,s.jsx)(n.admonition,{type:"note",children:(0,s.jsx)(n.p,{children:"The APIs described here are treated as stable, and available for use. Any other API exposed by Stylable not described here may changed, and should not be dependant on."})}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"Stylable"})," class provided from ",(0,s.jsx)(n.code,{children:"@stylable/core"})," requires configuration to initialize."]}),"\n",(0,s.jsx)(n.p,{children:"Example:"}),"\n","\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="Initialize Stylable instance"',children:"import fs from 'node:fs';\nimport { Stylable } from '@stylable/core';\n\n// minimal required configuration\nStylable({ fs, projectRoot: __dirname });\n"})}),"\n","\n",(0,s.jsx)(n.h3,{id:"configuration",children:"Configuration"}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Option"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default Value"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"fs"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.a,{href:"#minimalfs",children:(0,s.jsx)(n.code,{children:"MinimalFS"})})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"required"})}),(0,s.jsx)(n.td,{children:"Filesystem instance to use"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"projectRoot"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"required"})}),(0,s.jsx)(n.td,{children:"The project root directory path"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"mode"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:'"production"'})}),(0,s.jsx)(n.td,{children:"Development or production mode"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"resolveNamespace"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.a,{href:"#resolvenamespace",children:(0,s.jsx)(n.code,{children:"ResolveNamespace"})})}),(0,s.jsx)(n.td,{children:"default resolver depends on running context"}),(0,s.jsx)(n.td,{children:"Function to determine namespacing"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"resolveModule"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.a,{href:"#moduleresolver",children:(0,s.jsx)(n.code,{children:"ModuleResolver"})})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.a,{href:"https://github.com/webpack/enhanced-resolve",children:(0,s.jsx)(n.code,{children:"enhanced-resolve"})})}),(0,s.jsxs)(n.td,{children:["Module resolver to be used for all import paths and ",(0,s.jsx)(n.code,{children:"url()"})," requests"]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"resolveOptions"})}),(0,s.jsx)(n.td,{children:(0,s.jsxs)(o.A,{className:"inline-code",children:[(0,s.jsx)("br",{})," alias?: any;",(0,s.jsx)("br",{})," symlinks?: boolean;",(0,s.jsx)("br",{})]})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(o.A,{className:"inline-code",children:"{}"})}),(0,s.jsxs)(n.td,{children:["Options that are passed to the ",(0,s.jsx)(n.strong,{children:"default"})," module resolver"]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"requrieModule"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.a,{href:"#requiremodule",children:(0,s.jsx)(n.code,{children:"RequireModule"})})}),(0,s.jsx)(n.td,{children:"none"}),(0,s.jsx)(n.td,{children:"Require module that receives a path, and attempts to return a module"})]})]})]}),"\n",(0,s.jsx)(n.h3,{id:"minimalfs",children:(0,s.jsx)(n.code,{children:"MinimalFS"})}),"\n",(0,s.jsx)(n.p,{children:"Stylable minimal required file system interface:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ts",metastring:'title="MinimalFS interface"',children:"interface MinimalFS {\n statSync: (filePath: string) => { mtime: Date };\n readFileSync: (filePath: string, encoding: 'utf8') => string;\n readlinkSync: (filePath: string) => string;\n}\n"})}),"\n",(0,s.jsx)(n.h3,{id:"resolvenamespace",children:(0,s.jsx)(n.code,{children:"ResolveNamespace"})}),"\n",(0,s.jsx)(n.p,{children:"Provide exact control of the namespacing mechanism by providing a function that accepts:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"namespace"})," - a stylesheet source namespace - determined by the ",(0,s.jsx)(n.code,{children:"@st-namespace"})," if exists, and falls back to the filename"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"origin"})," - an origin path - path to the source stylesheet"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:'This function will then return a string to be used as the "namespace" for stylesheet definitions.'}),"\n",(0,s.jsx)(n.h4,{id:"basic-example",children:"Basic example"}),"\n",(0,s.jsx)(n.p,{children:"An example for a basic namespace resolver, that generates unique verbose namespaces based on the component namespace and origin path of the stylesheet."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ts",metastring:'title="Resolve namespace example"',children:"const resolveNamespace: ResolveNamespace = (namespace: string, origin: string): string {\n return namespace + hash(origin);\n}\n"})}),"\n","\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",metastring:'title="comp.st.css"',children:".root {}\n\n/* OUTPUT */\n.comp1169059893__root {}\n"})}),"\n","\n",(0,s.jsx)(n.h3,{id:"moduleresolver",children:(0,s.jsx)(n.code,{children:"ModuleResolver"})}),"\n",(0,s.jsx)(n.p,{children:"Override Stylable's default module resolver, to control path resolution according to your projects' needs."}),"\n",(0,s.jsx)(n.p,{children:"The default module resolver is a function that accepts two arguments:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"directoryPath"})," - the directory path to resolve from"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"request"})," - the module request to resolve"]}),"\n"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const fs = require('node:fs');\nconst { createDefaultResolver, Stylable } = require('@stylable/core');\n\nconst defaultResolver = createDefaultResolver(fs);\nconst stylable = new Stylable({\n projectRoot: 'path/to/project/root',\n filesystem: fs,\n resolveModule: (directoryPath, request) => {\n if (request.startsWith('my-custom-module')) {\n return '/path/to/my-custom-module';\n }\n\n return defaultResolver(directoryPath, request);\n },\n});\n"})}),"\n",(0,s.jsx)(n.h3,{id:"requiremodule",children:(0,s.jsx)(n.code,{children:"RequireModule"})}),"\n",(0,s.jsxs)(n.p,{children:["Defines a function to require imported JavaScript modules from a path, used when a JavaScript ",(0,s.jsx)(n.a,{href:"./mixins#javascript-mixins",children:"Mixins"})," or ",(0,s.jsx)(n.a,{href:"./formatters",children:"Formatters"})," is used within a Stylable stylesheet."]}),"\n","\n",(0,s.jsxs)(a.A,{groupId:"runtimeEnv",children:[(0,s.jsx)(i.A,{value:"nodejs",label:"NodeJS",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const fs = require('node:fs');\nconst { Stylable } = require('@stylable/core');\n\nconst stylable = new Stylable({\n projectRoot: 'path/to/project/root',\n filesystem: fs,\n requireModule: require\n})\n"})})}),(0,s.jsx)(i.A,{value:"memoryfs",label:"Memory FS",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const { Stylable } = require('@stylable/core');\n\nconst stylable = new Stylable({\n projectRoot: 'path/to/project/root',\n filesystem: memoryFS,\n requireModule(path: string) {\n const _module = {\n id,\n exports: {},\n };\n try {\n // create a module evaluation function\n const fn = new Function(\n 'module',\n 'exports',\n 'require',\n fs.readFileSync(id, { encoding: 'utf8', flag: 'r' })\n );\n // evaluate the module\n fn(_module, _module.exports, requireModule);\n } catch (e) { \n throw new Error('Cannot require file: ' + id + 'reason: ' + e.message);\n }\n return _module.exports;\n }\n})\n"})})})]}),"\n"]})}function p(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(m,{...e})}):m(e)}},9365:(e,n,r)=>{r.d(n,{A:()=>a});r(6540);var t=r(4164);const s={tabItem:"tabItem_Ymn6"};var l=r(4848);function a(e){let{children:n,hidden:r,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,t.A)(s.tabItem,a),hidden:r,children:n})}},1470:(e,n,r)=>{r.d(n,{A:()=>S});var t=r(6540),s=r(4164),l=r(3104),a=r(6347),i=r(205),o=r(7485),c=r(1682),d=r(679);function u(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Badchild <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:r}=e;return(0,t.useMemo)((()=>{const e=n??function(e){return u(e).map((e=>{let{props:{value:n,label:r,attributes:t,default:s}}=e;return{value:n,label:r,attributes:t,default:s}}))}(r);return function(e){const n=(0,c.XI)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,r])}function m(e){let{value:n,tabValues:r}=e;return r.some((e=>e.value===n))}function p(e){let{queryString:n=!1,groupId:r}=e;const s=(0,a.W6)(),l=function(e){let{queryString:n=!1,groupId:r}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:n,groupId:r});return[(0,o.aZ)(l),(0,t.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(s.location.search);n.set(l,e),s.replace({...s.location,search:n.toString()})}),[l,s])]}function x(e){const{defaultValue:n,queryString:r=!1,groupId:s}=e,l=h(e),[a,o]=(0,t.useState)((()=>function(e){let{defaultValue:n,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!m({value:n,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const t=r.find((e=>e.default))??r[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:l}))),[c,u]=p({queryString:r,groupId:s}),[x,f]=function(e){let{groupId:n}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(n),[s,l]=(0,d.Dv)(r);return[s,(0,t.useCallback)((e=>{r&&l.set(e)}),[r,l])]}({groupId:s}),j=(()=>{const e=c??x;return m({value:e,tabValues:l})?e:null})();(0,i.A)((()=>{j&&o(j)}),[j]);return{selectedValue:a,selectValue:(0,t.useCallback)((e=>{if(!m({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);o(e),u(e),f(e)}),[u,f,l]),tabValues:l}}var f=r(2303);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var b=r(4848);function v(e){let{className:n,block:r,selectedValue:t,selectValue:a,tabValues:i}=e;const o=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.a_)(),d=e=>{const n=e.currentTarget,r=o.indexOf(n),s=i[r].value;s!==t&&(c(n),a(s))},u=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const r=o.indexOf(e.currentTarget)+1;n=o[r]??o[0];break}case"ArrowLeft":{const r=o.indexOf(e.currentTarget)-1;n=o[r]??o[o.length-1];break}}n?.focus()};return(0,b.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":r},n),children:i.map((e=>{let{value:n,label:r,attributes:l}=e;return(0,b.jsx)("li",{role:"tab",tabIndex:t===n?0:-1,"aria-selected":t===n,ref:e=>{o.push(e)},onKeyDown:u,onClick:d,...l,className:(0,s.A)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":t===n}),children:r??n},n)}))})}function g(e){let{lazy:n,children:r,selectedValue:l}=e;const a=(Array.isArray(r)?r:[r]).filter(Boolean);if(n){const e=a.find((e=>e.props.value===l));return e?(0,t.cloneElement)(e,{className:(0,s.A)("margin-top--md",e.props.className)}):null}return(0,b.jsx)("div",{className:"margin-top--md",children:a.map(((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==l})))})}function y(e){const n=x(e);return(0,b.jsxs)("div",{className:(0,s.A)("tabs-container",j.tabList),children:[(0,b.jsx)(v,{...n,...e}),(0,b.jsx)(g,{...n,...e})]})}function S(e){const n=(0,f.A)();return(0,b.jsx)(y,{...e,children:u(e.children)},String(n))}}}]); \ No newline at end of file diff --git a/assets/js/e19b9990.c0392c7d.js b/assets/js/e19b9990.c0392c7d.js deleted file mode 100644 index 844488cc..00000000 --- a/assets/js/e19b9990.c0392c7d.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[7377],{701:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>u,contentTitle:()=>d,default:()=>p,frontMatter:()=>c,metadata:()=>t,toc:()=>h});const t=JSON.parse('{"id":"references/programmatic-api","title":"Programmatic API","description":"Stylable instance","source":"@site/docs/references/programmatic-api.mdx","sourceDirName":"references","slug":"/references/programmatic-api","permalink":"/docs/references/programmatic-api","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/programmatic-api.mdx","tags":[],"version":"current","frontMatter":{"id":"programmatic-api","title":"Programmatic API"},"sidebar":"Specification Reference","previous":{"title":"Runtime","permalink":"/docs/references/runtime"}}');var s=r(4848),l=r(8453),a=r(9489),i=r(7227),o=r(2250);const c={id:"programmatic-api",title:"Programmatic API"},d=void 0,u={},h=[{value:"Stylable instance",id:"stylable-instance",level:2},{value:"Configuration",id:"configuration",level:3},{value:" MinimalFS
",id:"minimalfs",level:3},{value:"ResolveNamespace
",id:"resolvenamespace",level:3},{value:"Basic example",id:"basic-example",level:4},{value:"ModuleResolver
",id:"moduleresolver",level:3},{value:"RequireModule
",id:"requiremodule",level:3}];function m(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,l.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h2,{id:"stylable-instance",children:"Stylable instance"}),"\n",(0,s.jsx)(n.p,{children:"Stylable is usually consumed through one of its available integration, for more specific or advanced use-cases, the programmatic API can be used for greater control on how Stylable operates."}),"\n",(0,s.jsx)(n.admonition,{type:"note",children:(0,s.jsx)(n.p,{children:"The APIs described here are treated as stable, and available for use. Any other API exposed by Stylable not described here may changed, and should not be dependant on."})}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"Stylable"})," class provided from ",(0,s.jsx)(n.code,{children:"@stylable/core"})," requires configuration to initialize."]}),"\n",(0,s.jsx)(n.p,{children:"Example:"}),"\n","\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="Initialize Stylable instance"',children:"import fs from 'node:fs';\nimport { Stylable } from '@stylable/core';\n\n// minimal required configuration\nStylable({ fs, projectRoot: __dirname });\n"})}),"\n","\n",(0,s.jsx)(n.h3,{id:"configuration",children:"Configuration"}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Option"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default Value"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"fs"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.a,{href:"#minimalfs",children:(0,s.jsx)(n.code,{children:"MinimalFS"})})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"required"})}),(0,s.jsx)(n.td,{children:"Filesystem instance to use"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"projectRoot"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"required"})}),(0,s.jsx)(n.td,{children:"The project root directory path"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"mode"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:'"production"'})}),(0,s.jsx)(n.td,{children:"Development or production mode"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"resolveNamespace"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.a,{href:"#resolvenamespace",children:(0,s.jsx)(n.code,{children:"ResolveNamespace"})})}),(0,s.jsx)(n.td,{children:"default resolver depends on running context"}),(0,s.jsx)(n.td,{children:"Function to determine namespacing"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"resolveModule"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.a,{href:"#moduleresolver",children:(0,s.jsx)(n.code,{children:"ModuleResolver"})})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.a,{href:"https://github.com/webpack/enhanced-resolve",children:(0,s.jsx)(n.code,{children:"enhanced-resolve"})})}),(0,s.jsxs)(n.td,{children:["Module resolver to be used for all import paths and ",(0,s.jsx)(n.code,{children:"url()"})," requests"]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"resolveOptions"})}),(0,s.jsx)(n.td,{children:(0,s.jsxs)(o.A,{className:"inline-code",children:[(0,s.jsx)("br",{})," alias?: any;",(0,s.jsx)("br",{})," symlinks?: boolean;",(0,s.jsx)("br",{})]})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(o.A,{className:"inline-code",children:"{}"})}),(0,s.jsxs)(n.td,{children:["Options that are passed to the ",(0,s.jsx)(n.strong,{children:"default"})," module resolver"]})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"requrieModule"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.a,{href:"#requiremodule",children:(0,s.jsx)(n.code,{children:"RequireModule"})})}),(0,s.jsx)(n.td,{children:"none"}),(0,s.jsx)(n.td,{children:"Require module that receives a path, and attempts to return a module"})]})]})]}),"\n",(0,s.jsx)(n.h3,{id:"minimalfs",children:(0,s.jsx)(n.code,{children:"MinimalFS"})}),"\n",(0,s.jsx)(n.p,{children:"Stylable minimal required file system interface:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ts",metastring:'title="MinimalFS interface"',children:"interface MinimalFS {\n statSync: (filePath: string) => { mtime: Date };\n readFileSync: (filePath: string, encoding: 'utf8') => string;\n readlinkSync: (filePath: string) => string;\n}\n"})}),"\n",(0,s.jsx)(n.h3,{id:"resolvenamespace",children:(0,s.jsx)(n.code,{children:"ResolveNamespace"})}),"\n",(0,s.jsx)(n.p,{children:"Provide exact control of the namespacing mechanism by providing a function that accepts:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"namespace"})," - a stylesheet source namespace - determined by the ",(0,s.jsx)(n.code,{children:"@st-namespace"})," if exists, and falls back to the filename"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"origin"})," - an origin path - path to the source stylesheet"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:'This function will then return a string to be used as the "namespace" for stylesheet definitions.'}),"\n",(0,s.jsx)(n.h4,{id:"basic-example",children:"Basic example"}),"\n",(0,s.jsx)(n.p,{children:"An example for a basic namespace resolver, that generates unique verbose namespaces based on the component namespace and origin path of the stylesheet."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ts",metastring:'title="Resolve namespace example"',children:"const resolveNamespace: ResolveNamespace = (namespace: string, origin: string): string {\n return namespace + hash(origin);\n}\n"})}),"\n","\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",metastring:'title="comp.st.css"',children:".root {}\n\n/* OUTPUT */\n.comp1169059893__root {}\n"})}),"\n","\n",(0,s.jsx)(n.h3,{id:"moduleresolver",children:(0,s.jsx)(n.code,{children:"ModuleResolver"})}),"\n",(0,s.jsx)(n.p,{children:"Override Stylable's default module resolver, to control path resolution according to your projects' needs."}),"\n",(0,s.jsx)(n.p,{children:"The default module resolver is a function that accepts two arguments:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"directoryPath"})," - the directory path to resolve from"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"request"})," - the module request to resolve"]}),"\n"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const fs = require('node:fs');\nconst { createDefaultResolver, Stylable } = require('@stylable/core');\n\nconst defaultResolver = createDefaultResolver(fs);\nconst stylable = new Stylable({\n projectRoot: 'path/to/project/root',\n filesystem: fs,\n resolveModule: (directoryPath, request) => {\n if (request.startsWith('my-custom-module')) {\n return '/path/to/my-custom-module';\n }\n\n return defaultResolver(directoryPath, request);\n },\n});\n"})}),"\n",(0,s.jsx)(n.h3,{id:"requiremodule",children:(0,s.jsx)(n.code,{children:"RequireModule"})}),"\n",(0,s.jsxs)(n.p,{children:["Defines a function to require imported JavaScript modules from a path, used when a JavaScript ",(0,s.jsx)(n.a,{href:"./mixins#javascript-mixins",children:"Mixins"})," or ",(0,s.jsx)(n.a,{href:"./formatters",children:"Formatters"})," is used within a Stylable stylesheet."]}),"\n","\n",(0,s.jsxs)(a.A,{groupId:"runtimeEnv",children:[(0,s.jsx)(i.A,{value:"nodejs",label:"NodeJS",default:!0,children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const fs = require('node:fs');\nconst { Stylable } = require('@stylable/core');\n\nconst stylable = new Stylable({\n projectRoot: 'path/to/project/root',\n filesystem: fs,\n requireModule: require\n})\n"})})}),(0,s.jsx)(i.A,{value:"memoryfs",label:"Memory FS",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"const { Stylable } = require('@stylable/core');\n\nconst stylable = new Stylable({\n projectRoot: 'path/to/project/root',\n filesystem: memoryFS,\n requireModule(path: string) {\n const _module = {\n id,\n exports: {},\n };\n try {\n // create a module evaluation function\n const fn = new Function(\n 'module',\n 'exports',\n 'require',\n fs.readFileSync(id, { encoding: 'utf8', flag: 'r' })\n );\n // evaluate the module\n fn(_module, _module.exports, requireModule);\n } catch (e) { \n throw new Error('Cannot require file: ' + id + 'reason: ' + e.message);\n }\n return _module.exports;\n }\n})\n"})})})]}),"\n"]})}function p(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(m,{...e})}):m(e)}},7227:(e,n,r)=>{r.d(n,{A:()=>a});r(6540);var t=r(4164);const s={tabItem:"tabItem_Ymn6"};var l=r(4848);function a(e){let{children:n,hidden:r,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,t.A)(s.tabItem,a),hidden:r,children:n})}},9489:(e,n,r)=>{r.d(n,{A:()=>S});var t=r(6540),s=r(4164),l=r(4245),a=r(6347),i=r(6494),o=r(2814),c=r(5167),d=r(9900);function u(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Badchild <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:n,children:r}=e;return(0,t.useMemo)((()=>{const e=n??function(e){return u(e).map((e=>{let{props:{value:n,label:r,attributes:t,default:s}}=e;return{value:n,label:r,attributes:t,default:s}}))}(r);return function(e){const n=(0,c.XI)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,r])}function m(e){let{value:n,tabValues:r}=e;return r.some((e=>e.value===n))}function p(e){let{queryString:n=!1,groupId:r}=e;const s=(0,a.W6)(),l=function(e){let{queryString:n=!1,groupId:r}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:n,groupId:r});return[(0,o.aZ)(l),(0,t.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(s.location.search);n.set(l,e),s.replace({...s.location,search:n.toString()})}),[l,s])]}function x(e){const{defaultValue:n,queryString:r=!1,groupId:s}=e,l=h(e),[a,o]=(0,t.useState)((()=>function(e){let{defaultValue:n,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!m({value:n,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const t=r.find((e=>e.default))??r[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:l}))),[c,u]=p({queryString:r,groupId:s}),[x,f]=function(e){let{groupId:n}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(n),[s,l]=(0,d.Dv)(r);return[s,(0,t.useCallback)((e=>{r&&l.set(e)}),[r,l])]}({groupId:s}),j=(()=>{const e=c??x;return m({value:e,tabValues:l})?e:null})();(0,i.A)((()=>{j&&o(j)}),[j]);return{selectedValue:a,selectValue:(0,t.useCallback)((e=>{if(!m({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);o(e),u(e),f(e)}),[u,f,l]),tabValues:l}}var f=r(1062);const j={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var b=r(4848);function v(e){let{className:n,block:r,selectedValue:t,selectValue:a,tabValues:i}=e;const o=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.a_)(),d=e=>{const n=e.currentTarget,r=o.indexOf(n),s=i[r].value;s!==t&&(c(n),a(s))},u=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const r=o.indexOf(e.currentTarget)+1;n=o[r]??o[0];break}case"ArrowLeft":{const r=o.indexOf(e.currentTarget)-1;n=o[r]??o[o.length-1];break}}n?.focus()};return(0,b.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,s.A)("tabs",{"tabs--block":r},n),children:i.map((e=>{let{value:n,label:r,attributes:l}=e;return(0,b.jsx)("li",{role:"tab",tabIndex:t===n?0:-1,"aria-selected":t===n,ref:e=>o.push(e),onKeyDown:u,onClick:d,...l,className:(0,s.A)("tabs__item",j.tabItem,l?.className,{"tabs__item--active":t===n}),children:r??n},n)}))})}function g(e){let{lazy:n,children:r,selectedValue:l}=e;const a=(Array.isArray(r)?r:[r]).filter(Boolean);if(n){const e=a.find((e=>e.props.value===l));return e?(0,t.cloneElement)(e,{className:(0,s.A)("margin-top--md",e.props.className)}):null}return(0,b.jsx)("div",{className:"margin-top--md",children:a.map(((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==l})))})}function y(e){const n=x(e);return(0,b.jsxs)("div",{className:(0,s.A)("tabs-container",j.tabList),children:[(0,b.jsx)(v,{...n,...e}),(0,b.jsx)(g,{...n,...e})]})}function S(e){const n=(0,f.A)();return(0,b.jsx)(y,{...e,children:u(e.children)},String(n))}}}]); \ No newline at end of file diff --git a/assets/js/e74825b7.d2761f43.js b/assets/js/e74825b7.7addcb27.js similarity index 99% rename from assets/js/e74825b7.d2761f43.js rename to assets/js/e74825b7.7addcb27.js index 837d031e..d770bfe4 100644 --- a/assets/js/e74825b7.d2761f43.js +++ b/assets/js/e74825b7.7addcb27.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[2765],{3830:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>r,contentTitle:()=>l,default:()=>h,frontMatter:()=>o,metadata:()=>t,toc:()=>c});const t=JSON.parse('{"id":"references/pseudo-classes","title":"Pseudo-Class","description":"In addition to CSS\'s native pseudo-classes, likenth-child(), Stylable allow you to define custom pseudo-classes so that you can apply styles to your components based on state. Let\'s say you want a component to have different styling applied to it when its content is loading. You can define loading as a custom pseudo-class and toggle it in your component.","source":"@site/docs/references/pseudo-classes.md","sourceDirName":"references","slug":"/references/pseudo-classes","permalink":"/docs/references/pseudo-classes","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/pseudo-classes.md","tags":[],"version":"current","frontMatter":{"id":"pseudo-classes","title":"Pseudo-Class"},"sidebar":"Specification Reference","previous":{"title":"Layer","permalink":"/docs/references/layer"},"next":{"title":"Pseudo-Element","permalink":"/docs/references/pseudo-elements"}}');var a=s(4848),i=s(8453);const o={id:"pseudo-classes",title:"Pseudo-Class"},l=void 0,r={},c=[{value:"Syntax",id:"syntax",level:2},{value:"Boolean",id:"boolean",level:3},{value:"Enum",id:"enum",level:3},{value:"String",id:"string",level:3},{value:"Optional string validation",id:"optional-string-validation",level:4},{value:"Number",id:"number",level:3},{value:"Optional number validation",id:"optional-number-validation",level:4},{value:"State inheritance",id:"state-inheritance",level:2},{value:"Runtime",id:"runtime",level:2},{value:"Namespace",id:"namespace",level:2},{value:"Map to selector",id:"map-to-selector",level:3}];function d(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(n.p,{children:["In addition to CSS's native ",(0,a.jsx)(n.code,{children:"pseudo-classes"}),", like ",(0,a.jsx)(n.code,{children:":hover"})," and ",(0,a.jsx)(n.code,{children:":nth-child()"}),", Stylable allow you to define custom pseudo-classes so that you can apply styles to your components based on state. Let's say you want a component to have different styling applied to it when its content is loading. You can define ",(0,a.jsx)(n.code,{children:"loading"})," as a custom pseudo-class and toggle it in your component."]}),"\n",(0,a.jsxs)(n.p,{children:["This page goes over how Stylable handles custom ",(0,a.jsx)(n.code,{children:"pseudo-classes"}),", for more details about the language feature itself, checkout the following resources:"]}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:(0,a.jsx)(n.a,{href:"https://developer.mozilla.org/en/docs/Web/CSS/Pseudo-classes",children:"MDN pseudo-class"})}),"\n",(0,a.jsx)(n.li,{children:(0,a.jsx)(n.a,{href:"https://drafts.csswg.org/selectors/#pseudo-classes",children:"pseudo-class in spec"})}),"\n"]}),"\n",(0,a.jsx)(n.h2,{id:"syntax",children:"Syntax"}),"\n",(0,a.jsxs)(n.p,{children:["The Stylable ",(0,a.jsx)(n.code,{children:"-st-states"})," declaration is used ",(0,a.jsx)(n.strong,{children:"on a class selector"})," to provide a list of the possible custom ",(0,a.jsx)(n.code,{children:"pseudo-classes"})," that can later be targeted from CSS and controlled from JavaScript."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",metastring:'title="list of custom states"',children:".x {\n -st-states: stateA, stateB;\n}\n"})}),"\n",(0,a.jsx)(n.admonition,{title:"allowed context",type:"note",children:(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.code,{children:"-st-states"})," is only allowed in a rule with a ",(0,a.jsx)(n.strong,{children:"single class selector"})," to indicate custom pseudo classes for that class."]})}),"\n",(0,a.jsx)(n.h3,{id:"boolean",children:"Boolean"}),"\n",(0,a.jsxs)(n.p,{children:["To define a custom state that can be either ",(0,a.jsx)(n.strong,{children:"on or off"}),", provide state definitions with a single ident as the name for the state, then target the state using a pseudo-class."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",children:".x {\n /* define 2 boolean states on 'x' */\n -st-states: toggled, loading;\n}\n\n/* target single custom state */\n.x:toggled {}\n\n/* target multiple custom states */\n.x:toggled:loading {}\n"})}),"\n",(0,a.jsx)(n.h3,{id:"enum",children:"Enum"}),"\n",(0,a.jsxs)(n.p,{children:["A custom state with a ",(0,a.jsx)(n.strong,{children:"restricted option list"})," that can target one of the options using a pseudo-class selector with a matching parameter and an ",(0,a.jsx)(n.strong,{children:"optional default value"}),"."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",children:".x {\n /* define a 'size' custom state with 3 options \n and a 'color' state with options and a default 'green' value */\n -st-states: size(enum(small, medium, large)),\n color(enum(reg, green, blue)) green;\n}\n\n/* target an element with a size of `medium` */\n.x:size(medium) {}\n\n/* INVALID! - 'huge' is not a possible value for size */\n.x:size(huge) {}\n\n/* INVALID! - parameter is required for size */\n.x:size {}\n\n/* VALID! - same as ':color(green)' */\n.x:color {}\n"})}),"\n",(0,a.jsx)(n.h3,{id:"string",children:"String"}),"\n",(0,a.jsxs)(n.p,{children:["A custom state that can accept a ",(0,a.jsx)(n.code,{children:"string parameter"})," value."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",children:".x {\n /* define 'category' custom state that accepts a string parameter */\n -st-states: category(string);\n}\n\n/* target an element with state category='kitchen' */\n.x:category(kitchen) {}\n\n/* target an element with state category='office' */\n.x:category(office) {}\n"})}),"\n",(0,a.jsx)(n.h4,{id:"optional-string-validation",children:"Optional string validation"}),"\n",(0,a.jsx)(n.p,{children:"There are several options that can be used to validate the potential string parameter input:"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.strong,{children:"minLength"})," - validates min length of input"]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.strong,{children:"maxLength"})," - validates max length of input"]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.strong,{children:"contains"})," - validates substring value exist in input"]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.strong,{children:"regex"})," - validates input against a regular expression"]}),"\n"]}),"\n",(0,a.jsx)(n.p,{children:"To set validations on a string state type, call the string as a function and pass a list of validations."}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",metastring:'title="string validation definition examples"',children:".a { \n /* validates input has min/max length and has the string 'user' in it */\n -st-states: x(string(minLength(5), maxLength(10), contains('user')));\n}\n\n.b {\n /* validates input begins with 'user' */\n -st-states: x(string(regex('^user')));\n}\n"})}),"\n",(0,a.jsx)(n.h3,{id:"number",children:"Number"}),"\n",(0,a.jsxs)(n.p,{children:["A custom state that can accept a ",(0,a.jsx)(n.code,{children:"number parameter"})," value."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",children:".a {\n /* define 'ranking' custom state that accepts a number parameter */\n -st-states: ranking(number);\n}\n\n/* target an element with a state rankin='5' */\n.a:ranking(5) {}\n"})}),"\n",(0,a.jsx)(n.h4,{id:"optional-number-validation",children:"Optional number validation"}),"\n",(0,a.jsx)(n.p,{children:"There are several options that can be used to validate the potential number parameter input:"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.strong,{children:"min"})," - validates min size of input"]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.strong,{children:"max"})," - validates max size of input"]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.strong,{children:"multiplyOf"})," - validates input is multiply of a given value"]}),"\n"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",metastring:'title="number validation definition example"',children:'.a {\n /* validates the targeting number argument */\n -st-states: x(number(min(2), max(6), multipleOf(2)));\n}\n\n/* valid arguments */\n.a:x(2) {}\n.a:x(4) {}\n.a:x(6) {}\n\n/* INVALID! - "multipleOf(2)" */\n.a:x(3) {}\n.a:x(5) {}\n\n/* INVALID! - "min(2)" and "max(6)" */\n.a:x(1) {}\n.a:x(7) {}\n'})}),"\n",(0,a.jsx)(n.h2,{id:"state-inheritance",children:"State inheritance"}),"\n",(0,a.jsxs)(n.p,{children:["When using ",(0,a.jsx)(n.a,{href:"./extend-stylesheet",children:"-st-extends"})," to extend another stylesheet or class, states definitions are inherited, but can also be overridden at any level."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",metastring:'title="base.st.css"',children:".root {\n /* define states 'a' and 'b' for the root of base stylesheet */\n -st-states: a, b;\n}\n"})}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",metastring:'title="extend.st.css"',children:"@st-import Base from './base.st.css';\n\n.root {\n /* inherits states 'a' and 'b' */\n -st-extends: Base;\n\n /* define states 'c' and 'b' (override 'b' from 'Base') */\n -st-states: c, b;\n}\n\n.root:a {}\n.root:b {}\n.root:c {}\n\n/* OUTPUT */\n.extend__root.base--a {} /* 'a' defined in base */\n.extend__root.extend--b {} /* 'b' defined in base, but overridden in extend */\n.extend__root.extend--c {} /* 'c' defined in extend */\n"})}),"\n",(0,a.jsx)(n.admonition,{title:"Native pseudo-class override",type:"note",children:(0,a.jsxs)(n.p,{children:["You can override the behavior of native pseudo-classes. This can enable you to write ",(0,a.jsx)(n.a,{href:"https://remysharp.com/2010/10/08/what-is-a-polyfill",children:"polyfills"})," for forthcoming CSS pseudo-classes to ensure that when you define a name for a custom pseudo-class, if there are clashes with a new CSS pseudo-class in the future, your app's behavior does not change. We don't recommend you to override an existing CSS pseudo-class unless you want to drive your teammates insane."]})}),"\n",(0,a.jsx)(n.h2,{id:"runtime",children:"Runtime"}),"\n",(0,a.jsxs)(n.p,{children:["To activate a custom state, use the ",(0,a.jsx)(n.a,{href:"./runtime#custom-state-mapping",children:"cssStates"})," or ",(0,a.jsx)(n.a,{href:"./runtime#st-function",children:"st() function"})," to generate the active ",(0,a.jsx)(n.code,{children:"CSS classes"})," states."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-js",children:"import { st, classes } from './sheet.st.css'; \n\n// active states\nst(classes.part, {\n isOn: true, // boolean\n size: 'small' // string or enum\n place: 1 // number state\n});\n\n// un-active states - only 'part' class\nst(classes.part, {\n isFirst: false, // boolean\n size: undefined // string or enum\n place: undefined // number\n});\n"})}),"\n",(0,a.jsx)(n.h2,{id:"namespace",children:"Namespace"}),"\n",(0,a.jsx)(n.p,{children:"Stylable generates namespaced CSS classes for custom states:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",children:".x:bool {}\n.x:enum(option1) {}\n.x:string(word) {}\n.x:number(55) {}\n\n/* OUTPUT */\n.NAMESPACE__x.NAMESPACE--bool {}\n.NAMESPACE__x.NAMESPACE---enum-7-option1 {}\n.NAMESPACE__x.NAMESPACE---string-4-word {}\n.NAMESPACE__x.NAMESPACE---number-2-55 {}\n"})}),"\n",(0,a.jsx)(n.h3,{id:"map-to-selector",children:"Map to selector"}),"\n",(0,a.jsxs)(n.p,{children:["In some cases the default way Stylable transforms a state into a class is not the desired behavior, for example when writing style interface to an external view that might mark state as an attribute, For this ",(0,a.jsx)(n.code,{children:"mapped state"})," can be used to transform the state into a another selector."]}),"\n",(0,a.jsx)(n.p,{children:"To define a global mapped state, pass a selector as a string instead of a type:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",children:".x {\n -st-states: toggled('.on'), \n loading('[dataSpinner]');\n}\n\n.x:toggled {}\n.x:loading {}\n\n/* OUTPUT */\n.NAMESPACE__x.on {}\n.NAMESPACE__x[dataSpinner] {}\n"})}),"\n",(0,a.jsxs)(n.p,{children:["Additionally a single parameter can be defined after the selector string and referenced in the selector string using ",(0,a.jsx)(n.code,{children:"$0"}),":"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",children:".x {\n -st-states: size('[size=\"$0\"]', enum(small, medium, large));\n}\n\n.x:size(small) {}\n\n/* OUTPUT */\n.NAMESPACE__x[size='small'] {}\n"})})]})}function h(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>o,x:()=>l});var t=s(6540);const a={},i=t.createContext(a);function o(e){const n=t.useContext(i);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:o(e.components),t.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[2765],{4284:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>r,contentTitle:()=>l,default:()=>h,frontMatter:()=>o,metadata:()=>t,toc:()=>c});const t=JSON.parse('{"id":"references/pseudo-classes","title":"Pseudo-Class","description":"In addition to CSS\'s native pseudo-classes, likenth-child(), Stylable allow you to define custom pseudo-classes so that you can apply styles to your components based on state. Let\'s say you want a component to have different styling applied to it when its content is loading. You can define loading as a custom pseudo-class and toggle it in your component.","source":"@site/docs/references/pseudo-classes.md","sourceDirName":"references","slug":"/references/pseudo-classes","permalink":"/docs/references/pseudo-classes","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/pseudo-classes.md","tags":[],"version":"current","frontMatter":{"id":"pseudo-classes","title":"Pseudo-Class"},"sidebar":"Specification Reference","previous":{"title":"Layer","permalink":"/docs/references/layer"},"next":{"title":"Pseudo-Element","permalink":"/docs/references/pseudo-elements"}}');var a=s(4848),i=s(8453);const o={id:"pseudo-classes",title:"Pseudo-Class"},l=void 0,r={},c=[{value:"Syntax",id:"syntax",level:2},{value:"Boolean",id:"boolean",level:3},{value:"Enum",id:"enum",level:3},{value:"String",id:"string",level:3},{value:"Optional string validation",id:"optional-string-validation",level:4},{value:"Number",id:"number",level:3},{value:"Optional number validation",id:"optional-number-validation",level:4},{value:"State inheritance",id:"state-inheritance",level:2},{value:"Runtime",id:"runtime",level:2},{value:"Namespace",id:"namespace",level:2},{value:"Map to selector",id:"map-to-selector",level:3}];function d(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(n.p,{children:["In addition to CSS's native ",(0,a.jsx)(n.code,{children:"pseudo-classes"}),", like ",(0,a.jsx)(n.code,{children:":hover"})," and ",(0,a.jsx)(n.code,{children:":nth-child()"}),", Stylable allow you to define custom pseudo-classes so that you can apply styles to your components based on state. Let's say you want a component to have different styling applied to it when its content is loading. You can define ",(0,a.jsx)(n.code,{children:"loading"})," as a custom pseudo-class and toggle it in your component."]}),"\n",(0,a.jsxs)(n.p,{children:["This page goes over how Stylable handles custom ",(0,a.jsx)(n.code,{children:"pseudo-classes"}),", for more details about the language feature itself, checkout the following resources:"]}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:(0,a.jsx)(n.a,{href:"https://developer.mozilla.org/en/docs/Web/CSS/Pseudo-classes",children:"MDN pseudo-class"})}),"\n",(0,a.jsx)(n.li,{children:(0,a.jsx)(n.a,{href:"https://drafts.csswg.org/selectors/#pseudo-classes",children:"pseudo-class in spec"})}),"\n"]}),"\n",(0,a.jsx)(n.h2,{id:"syntax",children:"Syntax"}),"\n",(0,a.jsxs)(n.p,{children:["The Stylable ",(0,a.jsx)(n.code,{children:"-st-states"})," declaration is used ",(0,a.jsx)(n.strong,{children:"on a class selector"})," to provide a list of the possible custom ",(0,a.jsx)(n.code,{children:"pseudo-classes"})," that can later be targeted from CSS and controlled from JavaScript."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",metastring:'title="list of custom states"',children:".x {\n -st-states: stateA, stateB;\n}\n"})}),"\n",(0,a.jsx)(n.admonition,{title:"allowed context",type:"note",children:(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.code,{children:"-st-states"})," is only allowed in a rule with a ",(0,a.jsx)(n.strong,{children:"single class selector"})," to indicate custom pseudo classes for that class."]})}),"\n",(0,a.jsx)(n.h3,{id:"boolean",children:"Boolean"}),"\n",(0,a.jsxs)(n.p,{children:["To define a custom state that can be either ",(0,a.jsx)(n.strong,{children:"on or off"}),", provide state definitions with a single ident as the name for the state, then target the state using a pseudo-class."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",children:".x {\n /* define 2 boolean states on 'x' */\n -st-states: toggled, loading;\n}\n\n/* target single custom state */\n.x:toggled {}\n\n/* target multiple custom states */\n.x:toggled:loading {}\n"})}),"\n",(0,a.jsx)(n.h3,{id:"enum",children:"Enum"}),"\n",(0,a.jsxs)(n.p,{children:["A custom state with a ",(0,a.jsx)(n.strong,{children:"restricted option list"})," that can target one of the options using a pseudo-class selector with a matching parameter and an ",(0,a.jsx)(n.strong,{children:"optional default value"}),"."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",children:".x {\n /* define a 'size' custom state with 3 options \n and a 'color' state with options and a default 'green' value */\n -st-states: size(enum(small, medium, large)),\n color(enum(reg, green, blue)) green;\n}\n\n/* target an element with a size of `medium` */\n.x:size(medium) {}\n\n/* INVALID! - 'huge' is not a possible value for size */\n.x:size(huge) {}\n\n/* INVALID! - parameter is required for size */\n.x:size {}\n\n/* VALID! - same as ':color(green)' */\n.x:color {}\n"})}),"\n",(0,a.jsx)(n.h3,{id:"string",children:"String"}),"\n",(0,a.jsxs)(n.p,{children:["A custom state that can accept a ",(0,a.jsx)(n.code,{children:"string parameter"})," value."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",children:".x {\n /* define 'category' custom state that accepts a string parameter */\n -st-states: category(string);\n}\n\n/* target an element with state category='kitchen' */\n.x:category(kitchen) {}\n\n/* target an element with state category='office' */\n.x:category(office) {}\n"})}),"\n",(0,a.jsx)(n.h4,{id:"optional-string-validation",children:"Optional string validation"}),"\n",(0,a.jsx)(n.p,{children:"There are several options that can be used to validate the potential string parameter input:"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.strong,{children:"minLength"})," - validates min length of input"]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.strong,{children:"maxLength"})," - validates max length of input"]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.strong,{children:"contains"})," - validates substring value exist in input"]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.strong,{children:"regex"})," - validates input against a regular expression"]}),"\n"]}),"\n",(0,a.jsx)(n.p,{children:"To set validations on a string state type, call the string as a function and pass a list of validations."}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",metastring:'title="string validation definition examples"',children:".a { \n /* validates input has min/max length and has the string 'user' in it */\n -st-states: x(string(minLength(5), maxLength(10), contains('user')));\n}\n\n.b {\n /* validates input begins with 'user' */\n -st-states: x(string(regex('^user')));\n}\n"})}),"\n",(0,a.jsx)(n.h3,{id:"number",children:"Number"}),"\n",(0,a.jsxs)(n.p,{children:["A custom state that can accept a ",(0,a.jsx)(n.code,{children:"number parameter"})," value."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",children:".a {\n /* define 'ranking' custom state that accepts a number parameter */\n -st-states: ranking(number);\n}\n\n/* target an element with a state rankin='5' */\n.a:ranking(5) {}\n"})}),"\n",(0,a.jsx)(n.h4,{id:"optional-number-validation",children:"Optional number validation"}),"\n",(0,a.jsx)(n.p,{children:"There are several options that can be used to validate the potential number parameter input:"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.strong,{children:"min"})," - validates min size of input"]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.strong,{children:"max"})," - validates max size of input"]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsx)(n.strong,{children:"multiplyOf"})," - validates input is multiply of a given value"]}),"\n"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",metastring:'title="number validation definition example"',children:'.a {\n /* validates the targeting number argument */\n -st-states: x(number(min(2), max(6), multipleOf(2)));\n}\n\n/* valid arguments */\n.a:x(2) {}\n.a:x(4) {}\n.a:x(6) {}\n\n/* INVALID! - "multipleOf(2)" */\n.a:x(3) {}\n.a:x(5) {}\n\n/* INVALID! - "min(2)" and "max(6)" */\n.a:x(1) {}\n.a:x(7) {}\n'})}),"\n",(0,a.jsx)(n.h2,{id:"state-inheritance",children:"State inheritance"}),"\n",(0,a.jsxs)(n.p,{children:["When using ",(0,a.jsx)(n.a,{href:"./extend-stylesheet",children:"-st-extends"})," to extend another stylesheet or class, states definitions are inherited, but can also be overridden at any level."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",metastring:'title="base.st.css"',children:".root {\n /* define states 'a' and 'b' for the root of base stylesheet */\n -st-states: a, b;\n}\n"})}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",metastring:'title="extend.st.css"',children:"@st-import Base from './base.st.css';\n\n.root {\n /* inherits states 'a' and 'b' */\n -st-extends: Base;\n\n /* define states 'c' and 'b' (override 'b' from 'Base') */\n -st-states: c, b;\n}\n\n.root:a {}\n.root:b {}\n.root:c {}\n\n/* OUTPUT */\n.extend__root.base--a {} /* 'a' defined in base */\n.extend__root.extend--b {} /* 'b' defined in base, but overridden in extend */\n.extend__root.extend--c {} /* 'c' defined in extend */\n"})}),"\n",(0,a.jsx)(n.admonition,{title:"Native pseudo-class override",type:"note",children:(0,a.jsxs)(n.p,{children:["You can override the behavior of native pseudo-classes. This can enable you to write ",(0,a.jsx)(n.a,{href:"https://remysharp.com/2010/10/08/what-is-a-polyfill",children:"polyfills"})," for forthcoming CSS pseudo-classes to ensure that when you define a name for a custom pseudo-class, if there are clashes with a new CSS pseudo-class in the future, your app's behavior does not change. We don't recommend you to override an existing CSS pseudo-class unless you want to drive your teammates insane."]})}),"\n",(0,a.jsx)(n.h2,{id:"runtime",children:"Runtime"}),"\n",(0,a.jsxs)(n.p,{children:["To activate a custom state, use the ",(0,a.jsx)(n.a,{href:"./runtime#custom-state-mapping",children:"cssStates"})," or ",(0,a.jsx)(n.a,{href:"./runtime#st-function",children:"st() function"})," to generate the active ",(0,a.jsx)(n.code,{children:"CSS classes"})," states."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-js",children:"import { st, classes } from './sheet.st.css'; \n\n// active states\nst(classes.part, {\n isOn: true, // boolean\n size: 'small' // string or enum\n place: 1 // number state\n});\n\n// un-active states - only 'part' class\nst(classes.part, {\n isFirst: false, // boolean\n size: undefined // string or enum\n place: undefined // number\n});\n"})}),"\n",(0,a.jsx)(n.h2,{id:"namespace",children:"Namespace"}),"\n",(0,a.jsx)(n.p,{children:"Stylable generates namespaced CSS classes for custom states:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",children:".x:bool {}\n.x:enum(option1) {}\n.x:string(word) {}\n.x:number(55) {}\n\n/* OUTPUT */\n.NAMESPACE__x.NAMESPACE--bool {}\n.NAMESPACE__x.NAMESPACE---enum-7-option1 {}\n.NAMESPACE__x.NAMESPACE---string-4-word {}\n.NAMESPACE__x.NAMESPACE---number-2-55 {}\n"})}),"\n",(0,a.jsx)(n.h3,{id:"map-to-selector",children:"Map to selector"}),"\n",(0,a.jsxs)(n.p,{children:["In some cases the default way Stylable transforms a state into a class is not the desired behavior, for example when writing style interface to an external view that might mark state as an attribute, For this ",(0,a.jsx)(n.code,{children:"mapped state"})," can be used to transform the state into a another selector."]}),"\n",(0,a.jsx)(n.p,{children:"To define a global mapped state, pass a selector as a string instead of a type:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",children:".x {\n -st-states: toggled('.on'), \n loading('[dataSpinner]');\n}\n\n.x:toggled {}\n.x:loading {}\n\n/* OUTPUT */\n.NAMESPACE__x.on {}\n.NAMESPACE__x[dataSpinner] {}\n"})}),"\n",(0,a.jsxs)(n.p,{children:["Additionally a single parameter can be defined after the selector string and referenced in the selector string using ",(0,a.jsx)(n.code,{children:"$0"}),":"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-css",children:".x {\n -st-states: size('[size=\"$0\"]', enum(small, medium, large));\n}\n\n.x:size(small) {}\n\n/* OUTPUT */\n.NAMESPACE__x[size='small'] {}\n"})})]})}function h(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>o,x:()=>l});var t=s(6540);const a={},i=t.createContext(a);function o(e){const n=t.useContext(i);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:o(e.components),t.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/e8f63a9c.bc8580ba.js b/assets/js/e8f63a9c.d84a4db7.js similarity index 97% rename from assets/js/e8f63a9c.bc8580ba.js rename to assets/js/e8f63a9c.d84a4db7.js index 2ed33501..ca2f5c81 100644 --- a/assets/js/e8f63a9c.bc8580ba.js +++ b/assets/js/e8f63a9c.d84a4db7.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[4412],{5483:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>a,contentTitle:()=>s,default:()=>u,frontMatter:()=>o,metadata:()=>l,toc:()=>d});const l=JSON.parse('{"id":"getting-started/rollup-integration","title":"Rollup","description":"The Stylable Rollup integration provides development, build, and bundle capabilities.","source":"@site/docs/getting-started/rollup-integration.md","sourceDirName":"getting-started","slug":"/getting-started/rollup-integration","permalink":"/docs/getting-started/rollup-integration","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/getting-started/rollup-integration.md","tags":[],"version":"current","frontMatter":{"id":"rollup-integration","title":"Rollup"},"sidebar":"Discover","previous":{"title":"NextJS","permalink":"/docs/getting-started/nextjs-integration"},"next":{"title":"Storybook","permalink":"/docs/getting-started/storybook-integration"}}');var i=n(4848),r=n(8453);const o={id:"rollup-integration",title:"Rollup"},s=void 0,a={},d=[{value:"Install",id:"install",level:2},{value:"Configuration",id:"configuration",level:2}];function c(e){const t={a:"a",code:"code",h2:"h2",p:"p",pre:"pre",strong:"strong",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.p,{children:"The Stylable Rollup integration provides development, build, and bundle capabilities."}),"\n",(0,i.jsx)(t.h2,{id:"install",children:"Install"}),"\n",(0,i.jsxs)(t.p,{children:["Install the ",(0,i.jsx)(t.strong,{children:"@stylable/rollup-plugin"})," as a dev dependency in your local project."]}),"\n",(0,i.jsx)(t.p,{children:"Using npm:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"npm install @stylable/rollup-plugin --save-dev\n"})}),"\n",(0,i.jsx)(t.p,{children:"Using Yarn:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"yarn add @stylable/rollup-plugin --dev\n"})}),"\n",(0,i.jsx)(t.h2,{id:"configuration",children:"Configuration"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",metastring:'title="rollup.config.js"',children:"const { stylableRollupPlugin } = require('@stylable/rollup-plugin');\n\nmodule.exports = {\n plugins: [stylableRollupPlugin()],\n};\n"})}),"\n",(0,i.jsxs)(t.p,{children:["For more information on configuring the ",(0,i.jsx)(t.code,{children:"@stylable/rollup-plugin"}),", see the ",(0,i.jsx)(t.a,{href:"https://github.com/wix/stylable/tree/master/packages/rollup-plugin",children:"readme file"}),"."]})]})}function u(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>o,x:()=>s});var l=n(6540);const i={},r=l.createContext(i);function o(e){const t=l.useContext(r);return l.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),l.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[4412],{7043:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>a,contentTitle:()=>s,default:()=>u,frontMatter:()=>o,metadata:()=>l,toc:()=>d});const l=JSON.parse('{"id":"getting-started/rollup-integration","title":"Rollup","description":"The Stylable Rollup integration provides development, build, and bundle capabilities.","source":"@site/docs/getting-started/rollup-integration.md","sourceDirName":"getting-started","slug":"/getting-started/rollup-integration","permalink":"/docs/getting-started/rollup-integration","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/getting-started/rollup-integration.md","tags":[],"version":"current","frontMatter":{"id":"rollup-integration","title":"Rollup"},"sidebar":"Discover","previous":{"title":"NextJS","permalink":"/docs/getting-started/nextjs-integration"},"next":{"title":"Storybook","permalink":"/docs/getting-started/storybook-integration"}}');var i=n(4848),r=n(8453);const o={id:"rollup-integration",title:"Rollup"},s=void 0,a={},d=[{value:"Install",id:"install",level:2},{value:"Configuration",id:"configuration",level:2}];function c(e){const t={a:"a",code:"code",h2:"h2",p:"p",pre:"pre",strong:"strong",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.p,{children:"The Stylable Rollup integration provides development, build, and bundle capabilities."}),"\n",(0,i.jsx)(t.h2,{id:"install",children:"Install"}),"\n",(0,i.jsxs)(t.p,{children:["Install the ",(0,i.jsx)(t.strong,{children:"@stylable/rollup-plugin"})," as a dev dependency in your local project."]}),"\n",(0,i.jsx)(t.p,{children:"Using npm:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"npm install @stylable/rollup-plugin --save-dev\n"})}),"\n",(0,i.jsx)(t.p,{children:"Using Yarn:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"yarn add @stylable/rollup-plugin --dev\n"})}),"\n",(0,i.jsx)(t.h2,{id:"configuration",children:"Configuration"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",metastring:'title="rollup.config.js"',children:"const { stylableRollupPlugin } = require('@stylable/rollup-plugin');\n\nmodule.exports = {\n plugins: [stylableRollupPlugin()],\n};\n"})}),"\n",(0,i.jsxs)(t.p,{children:["For more information on configuring the ",(0,i.jsx)(t.code,{children:"@stylable/rollup-plugin"}),", see the ",(0,i.jsx)(t.a,{href:"https://github.com/wix/stylable/tree/master/packages/rollup-plugin",children:"readme file"}),"."]})]})}function u(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>o,x:()=>s});var l=n(6540);const i={},r=l.createContext(i);function o(e){const t=l.useContext(r);return l.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),l.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/ebfcd236.88740659.js b/assets/js/ebfcd236.f0675543.js similarity index 98% rename from assets/js/ebfcd236.88740659.js rename to assets/js/ebfcd236.f0675543.js index 5a469835..d8da9e2a 100644 --- a/assets/js/ebfcd236.88740659.js +++ b/assets/js/ebfcd236.f0675543.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[3746],{6994:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>i,contentTitle:()=>l,default:()=>h,frontMatter:()=>a,metadata:()=>s,toc:()=>c});const s=JSON.parse('{"id":"getting-started/intro","title":"Intro","description":"What is Stylable?","source":"@site/docs/getting-started/get-started.md","sourceDirName":"getting-started","slug":"/getting-started/intro","permalink":"/docs/getting-started/intro","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/getting-started/get-started.md","tags":[],"version":"current","frontMatter":{"id":"intro","title":"Intro"},"sidebar":"Discover","next":{"title":"Boilerplate","permalink":"/docs/getting-started/boilerplate"}}');var r=n(4848),o=n(8453);const a={id:"intro",title:"Intro"},l=void 0,i={},c=[{value:"What is Stylable?",id:"what-is-stylable",level:2},{value:"Where do I start?",id:"where-do-i-start",level:2},{value:"Want to learn more?",id:"want-to-learn-more",level:2}];function d(e){const t={a:"a",h2:"h2",li:"li",p:"p",strong:"strong",ul:"ul",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h2,{id:"what-is-stylable",children:"What is Stylable?"}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Stylable"})," is a CSS preprocessor that enables you to write reusable, highly-performant, styled components. Each component exposes a style API that maps its internal parts so you can reuse components across teams without sacrificing stylability."]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:'Namespace styles to components so they don\'t "leak" and clash with other styles.'}),"\n",(0,r.jsx)(t.li,{children:"Enable custom pseudo-classes and pseudo-elements that abstract the internal structure of a component. These can then be styled externally."}),"\n"]}),"\n",(0,r.jsxs)(t.p,{children:["At build time, the preprocessor converts the ",(0,r.jsx)(t.strong,{children:"Stylable"})," CSS into flat, static, valid, vanilla CSS that works cross-browser."]}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Stylable"})," is agnostic to the component framework being used, it provides a way to write CSS that can be applied to any framework. All examples on the site use React-like syntax for demo purposes. However, the CSS written with ",(0,r.jsx)(t.strong,{children:"Stylable"})," can easily be used with any other frameworks such as Vue, Angular, or SolidJS."]}),"\n",(0,r.jsx)(t.h2,{id:"where-do-i-start",children:"Where do I start?"}),"\n",(0,r.jsxs)(t.p,{children:["There are currently two ways of starting working with ",(0,r.jsx)(t.strong,{children:"Stylable"}),":"]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["Quickly start a new project from a ",(0,r.jsx)(t.a,{href:"/docs/getting-started/boilerplate",children:"boilerplate"})]}),"\n",(0,r.jsxs)(t.li,{children:["Integrate into a new or existing project by ",(0,r.jsx)(t.a,{href:"/docs/getting-started/manual-integration",children:"manually configuring"})," ",(0,r.jsx)(t.strong,{children:"Stylable"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(t.p,{children:["Optionally, you can install ",(0,r.jsx)(t.a,{href:"/docs/getting-started/tooling/stylable-intelligence",children:(0,r.jsx)(t.strong,{children:"Stylable Intelligence"})}),", an extension providing IDE support for code completion and diagnostics (currently supported only for Visual Studio Code)."]}),"\n",(0,r.jsx)(t.h2,{id:"want-to-learn-more",children:"Want to learn more?"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Read the handbook"})," - Take a tour through the features of Stylable, and see how to use them in the ",(0,r.jsx)(t.a,{href:"/docs/guides/handbook/intro",children:"handbook guides"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Explore the API docs"})," - Take a look at our ",(0,r.jsx)(t.a,{href:"/docs/references/cheatsheet",children:"specification reference documents"})," to get more acquainted with our code and to see specific code examples. Use the overview as a cheat sheet to help you keep track of ",(0,r.jsx)(t.strong,{children:"Stylable"})," syntax."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Play with Stylable Online"})," - Take Stylable for a spin and see how it works in the ",(0,r.jsx)(t.a,{href:"/playground",children:"Stylable Playground"}),"."]}),"\n"]}),"\n"]})]})}function h(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>a,x:()=>l});var s=n(6540);const r={},o=s.createContext(r);function a(e){const t=s.useContext(o);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),s.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[3746],{5450:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>i,contentTitle:()=>l,default:()=>h,frontMatter:()=>a,metadata:()=>s,toc:()=>c});const s=JSON.parse('{"id":"getting-started/intro","title":"Intro","description":"What is Stylable?","source":"@site/docs/getting-started/get-started.md","sourceDirName":"getting-started","slug":"/getting-started/intro","permalink":"/docs/getting-started/intro","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/getting-started/get-started.md","tags":[],"version":"current","frontMatter":{"id":"intro","title":"Intro"},"sidebar":"Discover","next":{"title":"Boilerplate","permalink":"/docs/getting-started/boilerplate"}}');var r=n(4848),o=n(8453);const a={id:"intro",title:"Intro"},l=void 0,i={},c=[{value:"What is Stylable?",id:"what-is-stylable",level:2},{value:"Where do I start?",id:"where-do-i-start",level:2},{value:"Want to learn more?",id:"want-to-learn-more",level:2}];function d(e){const t={a:"a",h2:"h2",li:"li",p:"p",strong:"strong",ul:"ul",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h2,{id:"what-is-stylable",children:"What is Stylable?"}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Stylable"})," is a CSS preprocessor that enables you to write reusable, highly-performant, styled components. Each component exposes a style API that maps its internal parts so you can reuse components across teams without sacrificing stylability."]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:'Namespace styles to components so they don\'t "leak" and clash with other styles.'}),"\n",(0,r.jsx)(t.li,{children:"Enable custom pseudo-classes and pseudo-elements that abstract the internal structure of a component. These can then be styled externally."}),"\n"]}),"\n",(0,r.jsxs)(t.p,{children:["At build time, the preprocessor converts the ",(0,r.jsx)(t.strong,{children:"Stylable"})," CSS into flat, static, valid, vanilla CSS that works cross-browser."]}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Stylable"})," is agnostic to the component framework being used, it provides a way to write CSS that can be applied to any framework. All examples on the site use React-like syntax for demo purposes. However, the CSS written with ",(0,r.jsx)(t.strong,{children:"Stylable"})," can easily be used with any other frameworks such as Vue, Angular, or SolidJS."]}),"\n",(0,r.jsx)(t.h2,{id:"where-do-i-start",children:"Where do I start?"}),"\n",(0,r.jsxs)(t.p,{children:["There are currently two ways of starting working with ",(0,r.jsx)(t.strong,{children:"Stylable"}),":"]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["Quickly start a new project from a ",(0,r.jsx)(t.a,{href:"/docs/getting-started/boilerplate",children:"boilerplate"})]}),"\n",(0,r.jsxs)(t.li,{children:["Integrate into a new or existing project by ",(0,r.jsx)(t.a,{href:"/docs/getting-started/manual-integration",children:"manually configuring"})," ",(0,r.jsx)(t.strong,{children:"Stylable"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(t.p,{children:["Optionally, you can install ",(0,r.jsx)(t.a,{href:"/docs/getting-started/tooling/stylable-intelligence",children:(0,r.jsx)(t.strong,{children:"Stylable Intelligence"})}),", an extension providing IDE support for code completion and diagnostics (currently supported only for Visual Studio Code)."]}),"\n",(0,r.jsx)(t.h2,{id:"want-to-learn-more",children:"Want to learn more?"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Read the handbook"})," - Take a tour through the features of Stylable, and see how to use them in the ",(0,r.jsx)(t.a,{href:"/docs/guides/handbook/intro",children:"handbook guides"}),"."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Explore the API docs"})," - Take a look at our ",(0,r.jsx)(t.a,{href:"/docs/references/cheatsheet",children:"specification reference documents"})," to get more acquainted with our code and to see specific code examples. Use the overview as a cheat sheet to help you keep track of ",(0,r.jsx)(t.strong,{children:"Stylable"})," syntax."]}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Play with Stylable Online"})," - Take Stylable for a spin and see how it works in the ",(0,r.jsx)(t.a,{href:"/playground",children:"Stylable Playground"}),"."]}),"\n"]}),"\n"]})]})}function h(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>a,x:()=>l});var s=n(6540);const r={},o=s.createContext(r);function a(e){const t=s.useContext(o);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),s.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/ef20d218.27f76f51.js b/assets/js/ef20d218.c82ab2db.js similarity index 96% rename from assets/js/ef20d218.27f76f51.js rename to assets/js/ef20d218.c82ab2db.js index a4b89e21..88e28394 100644 --- a/assets/js/ef20d218.27f76f51.js +++ b/assets/js/ef20d218.c82ab2db.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[8065],{1801:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>l,contentTitle:()=>a,default:()=>u,frontMatter:()=>i,metadata:()=>t,toc:()=>c});const t=JSON.parse('{"id":"guides/handbook/classes","title":"Classes","description":"- opening intro paragraph","source":"@site/docs/guides/handbook/structure.md","sourceDirName":"guides/handbook","slug":"/guides/handbook/classes","permalink":"/docs/guides/handbook/classes","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/guides/handbook/structure.md","tags":[],"version":"current","frontMatter":{"id":"classes","title":"Classes"}}');var o=n(4848),r=n(8453);const i={id:"classes",title:"Classes"},a=void 0,l={},c=[{value:"CSS feature",id:"css-feature",level:2}];function d(e){const s={code:"code",h2:"h2",li:"li",pre:"pre",ul:"ul",...(0,r.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(s.ul,{children:["\n",(0,o.jsx)(s.li,{children:"opening intro paragraph"}),"\n"]}),"\n",(0,o.jsx)(s.h2,{id:"css-feature",children:"CSS feature"}),"\n",(0,o.jsxs)(s.ul,{children:["\n",(0,o.jsx)(s.li,{children:"syntax definition + mdn link"}),"\n"]}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-css",children:"SOME EXAMPLE\n"})}),"\n",(0,o.jsxs)(s.ul,{children:["\n",(0,o.jsx)(s.li,{children:"explainer of example above"}),"\n"]})]})}function u(e={}){const{wrapper:s}={...(0,r.R)(),...e.components};return s?(0,o.jsx)(s,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,s,n)=>{n.d(s,{R:()=>i,x:()=>a});var t=n(6540);const o={},r=t.createContext(o);function i(e){const s=t.useContext(r);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function a(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:i(e.components),t.createElement(r.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[8065],{5417:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>l,contentTitle:()=>a,default:()=>u,frontMatter:()=>i,metadata:()=>t,toc:()=>c});const t=JSON.parse('{"id":"guides/handbook/classes","title":"Classes","description":"- opening intro paragraph","source":"@site/docs/guides/handbook/structure.md","sourceDirName":"guides/handbook","slug":"/guides/handbook/classes","permalink":"/docs/guides/handbook/classes","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/guides/handbook/structure.md","tags":[],"version":"current","frontMatter":{"id":"classes","title":"Classes"}}');var o=n(4848),r=n(8453);const i={id:"classes",title:"Classes"},a=void 0,l={},c=[{value:"CSS feature",id:"css-feature",level:2}];function d(e){const s={code:"code",h2:"h2",li:"li",pre:"pre",ul:"ul",...(0,r.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(s.ul,{children:["\n",(0,o.jsx)(s.li,{children:"opening intro paragraph"}),"\n"]}),"\n",(0,o.jsx)(s.h2,{id:"css-feature",children:"CSS feature"}),"\n",(0,o.jsxs)(s.ul,{children:["\n",(0,o.jsx)(s.li,{children:"syntax definition + mdn link"}),"\n"]}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-css",children:"SOME EXAMPLE\n"})}),"\n",(0,o.jsxs)(s.ul,{children:["\n",(0,o.jsx)(s.li,{children:"explainer of example above"}),"\n"]})]})}function u(e={}){const{wrapper:s}={...(0,r.R)(),...e.components};return s?(0,o.jsx)(s,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,s,n)=>{n.d(s,{R:()=>i,x:()=>a});var t=n(6540);const o={},r=t.createContext(o);function i(e){const s=t.useContext(r);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function a(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:i(e.components),t.createElement(r.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/f0dcc6ac.184791cf.js b/assets/js/f0dcc6ac.7d2c19e2.js similarity index 99% rename from assets/js/f0dcc6ac.184791cf.js rename to assets/js/f0dcc6ac.7d2c19e2.js index d7396358..9c492ec1 100644 --- a/assets/js/f0dcc6ac.184791cf.js +++ b/assets/js/f0dcc6ac.7d2c19e2.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[7001],{7004:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>p,frontMatter:()=>r,metadata:()=>a,toc:()=>l});const a=JSON.parse('{"id":"references/contains","title":"Containers","description":"CSS container queries are used to target and style an element depending on the conditions of a container it is nested within.","source":"@site/docs/references/contains.md","sourceDirName":"references","slug":"/references/contains","permalink":"/docs/references/contains","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/contains.md","tags":[],"version":"current","frontMatter":{"id":"contains","title":"Containers"},"sidebar":"Specification Reference","previous":{"title":"Class Selector","permalink":"/docs/references/class-selectors"},"next":{"title":"Custom Property","permalink":"/docs/references/css-vars"}}');var s=t(4848),i=t(8453);const r={id:"contains",title:"Containers"},o=void 0,c={},l=[{value:"Syntax",id:"syntax",level:2},{value:"Import and Export",id:"import-and-export",level:2},{value:"Runtime",id:"runtime",level:2},{value:"Namespace",id:"namespace",level:2},{value:"Disable namespace",id:"disable-namespace",level:3}];function d(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.p,{children:"CSS container queries are used to target and style an element depending on the conditions of a container it is nested within."}),"\n",(0,s.jsxs)(n.p,{children:["This page goes over how Stylable handles the ",(0,s.jsx)(n.code,{children:"container-name"})," declaration and the ",(0,s.jsx)(n.code,{children:"@container"})," at-rule, for more details about the language feature itself, check out the following resources:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Container_Queries",children:"MDN CSS container queries"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://drafts.csswg.org/css-contain-3",children:"CSS contains spec"})}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"syntax",children:"Syntax"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"Container definition"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:".panel {\n /* longhand */\n container-name: panel;\n\n /* shorthand */\n container-name: panel / inline-size;\n\n /* longhand with multiple names */\n container-name: panel side;\n}\n"})}),"\n",(0,s.jsx)(n.admonition,{title:"soft definition",type:"note",children:(0,s.jsxs)(n.p,{children:["A container name symbol is defined using the ",(0,s.jsx)(n.code,{children:"container/container-name"})," declaration only when not explicitly defined by an import or a ",(0,s.jsxs)(n.a,{href:"#disable-namespace",children:["global ",(0,s.jsx)(n.code,{children:"@container"})," definition"]}),"."]})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"Usage"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:"@container panel (width <= 250px) {\n /* style nested rules */\n}\n"})}),"\n",(0,s.jsx)(n.h2,{id:"import-and-export",children:"Import and Export"}),"\n",(0,s.jsxs)(n.p,{children:["An exported container can be imported into another stylesheet with the ",(0,s.jsx)(n.a,{href:"/docs/references/imports",children:"@st-import"})," at-rule."]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"Style nested container rules"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:"/* get 'panel' container definition from another stylesheet */\n@st-import [container(panel)] from './x.st.css';\n\n@container panel (width <= 150px) {\n /* nested container rules */\n}\n"})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"More import examples"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:"/* map 'panel' container to local name 'x-panel' */\n@st-import [container(panel as x-panel)] from './x.st.css';\n\n/* import multiple containers */\n@st-import [container(panel, header)] from './x.st.css';\n"})}),"\n",(0,s.jsx)(n.h2,{id:"runtime",children:"Runtime"}),"\n",(0,s.jsx)(n.p,{children:"A Container definition can be accessed to generate dynamic styles using the containers mapping on the Stylable runtime stylesheet:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import { containers } from './sheet.st.css';\n\n// map to target namespaced container\ncontainers.panel;\n"})}),"\n",(0,s.jsx)(n.h2,{id:"namespace",children:"Namespace"}),"\n",(0,s.jsx)(n.p,{children:"Stylable automatically namespaces any container name according to the stylesheet it is defined in:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:".x {\n container: panel;\n}\n\n@container panel (width > 100px) {}\n\n/* OUTPUT */\n.x {\n container: NAMESPACE__panel;\n}\n\n@container NAMESPACE__panel (width > 100px) {}\n"})}),"\n",(0,s.jsx)(n.h3,{id:"disable-namespace",children:"Disable namespace"}),"\n",(0,s.jsxs)(n.p,{children:["In some cases the default namespace behavior is unwanted. In such cases, ",(0,s.jsx)(n.code,{children:"st-global"})," can be used to set a container name as global:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:".x {\n container: st-global(panel);\n}\n\n@container st-global(panel) (width > 100px) {}\n\n/* OUTPUT */\n.x {\n container: panel;\n}\n\n@container panel (width > 100px) {}\n"})}),"\n",(0,s.jsxs)(n.p,{children:["::note global without symbol deinition\nSetting ",(0,s.jsx)(n.code,{children:"st-global"})," around the container name in either the declaration or container query only references a global container name, without creating a symbol that can later be imported or referenced.\n::"]}),"\n",(0,s.jsxs)(n.p,{children:["To register a global container name symbol, that can be imported and referenced by other stylesheets, use the ",(0,s.jsx)(n.code,{children:"@container"})," at-rule with no body or query:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:"/* global panel container name definition */\n@container st-global(panel);\n\n.x {\n container: panel;\n}\n@container panel (width > 100px) {}\n\n\n/* OUTPUT */\n\n.x {\n container: panel;\n}\n@container panel (width > 100px) {}\n"})})]})}function p(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>o});var a=t(6540);const s={},i=a.createContext(s);function r(e){const n=a.useContext(i);return a.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),a.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[7001],{6048:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>p,frontMatter:()=>r,metadata:()=>a,toc:()=>l});const a=JSON.parse('{"id":"references/contains","title":"Containers","description":"CSS container queries are used to target and style an element depending on the conditions of a container it is nested within.","source":"@site/docs/references/contains.md","sourceDirName":"references","slug":"/references/contains","permalink":"/docs/references/contains","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/contains.md","tags":[],"version":"current","frontMatter":{"id":"contains","title":"Containers"},"sidebar":"Specification Reference","previous":{"title":"Class Selector","permalink":"/docs/references/class-selectors"},"next":{"title":"Custom Property","permalink":"/docs/references/css-vars"}}');var s=t(4848),i=t(8453);const r={id:"contains",title:"Containers"},o=void 0,c={},l=[{value:"Syntax",id:"syntax",level:2},{value:"Import and Export",id:"import-and-export",level:2},{value:"Runtime",id:"runtime",level:2},{value:"Namespace",id:"namespace",level:2},{value:"Disable namespace",id:"disable-namespace",level:3}];function d(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.p,{children:"CSS container queries are used to target and style an element depending on the conditions of a container it is nested within."}),"\n",(0,s.jsxs)(n.p,{children:["This page goes over how Stylable handles the ",(0,s.jsx)(n.code,{children:"container-name"})," declaration and the ",(0,s.jsx)(n.code,{children:"@container"})," at-rule, for more details about the language feature itself, check out the following resources:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Container_Queries",children:"MDN CSS container queries"})}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"https://drafts.csswg.org/css-contain-3",children:"CSS contains spec"})}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"syntax",children:"Syntax"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"Container definition"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:".panel {\n /* longhand */\n container-name: panel;\n\n /* shorthand */\n container-name: panel / inline-size;\n\n /* longhand with multiple names */\n container-name: panel side;\n}\n"})}),"\n",(0,s.jsx)(n.admonition,{title:"soft definition",type:"note",children:(0,s.jsxs)(n.p,{children:["A container name symbol is defined using the ",(0,s.jsx)(n.code,{children:"container/container-name"})," declaration only when not explicitly defined by an import or a ",(0,s.jsxs)(n.a,{href:"#disable-namespace",children:["global ",(0,s.jsx)(n.code,{children:"@container"})," definition"]}),"."]})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"Usage"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:"@container panel (width <= 250px) {\n /* style nested rules */\n}\n"})}),"\n",(0,s.jsx)(n.h2,{id:"import-and-export",children:"Import and Export"}),"\n",(0,s.jsxs)(n.p,{children:["An exported container can be imported into another stylesheet with the ",(0,s.jsx)(n.a,{href:"/docs/references/imports",children:"@st-import"})," at-rule."]}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"Style nested container rules"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:"/* get 'panel' container definition from another stylesheet */\n@st-import [container(panel)] from './x.st.css';\n\n@container panel (width <= 150px) {\n /* nested container rules */\n}\n"})}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"More import examples"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:"/* map 'panel' container to local name 'x-panel' */\n@st-import [container(panel as x-panel)] from './x.st.css';\n\n/* import multiple containers */\n@st-import [container(panel, header)] from './x.st.css';\n"})}),"\n",(0,s.jsx)(n.h2,{id:"runtime",children:"Runtime"}),"\n",(0,s.jsx)(n.p,{children:"A Container definition can be accessed to generate dynamic styles using the containers mapping on the Stylable runtime stylesheet:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",children:"import { containers } from './sheet.st.css';\n\n// map to target namespaced container\ncontainers.panel;\n"})}),"\n",(0,s.jsx)(n.h2,{id:"namespace",children:"Namespace"}),"\n",(0,s.jsx)(n.p,{children:"Stylable automatically namespaces any container name according to the stylesheet it is defined in:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:".x {\n container: panel;\n}\n\n@container panel (width > 100px) {}\n\n/* OUTPUT */\n.x {\n container: NAMESPACE__panel;\n}\n\n@container NAMESPACE__panel (width > 100px) {}\n"})}),"\n",(0,s.jsx)(n.h3,{id:"disable-namespace",children:"Disable namespace"}),"\n",(0,s.jsxs)(n.p,{children:["In some cases the default namespace behavior is unwanted. In such cases, ",(0,s.jsx)(n.code,{children:"st-global"})," can be used to set a container name as global:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:".x {\n container: st-global(panel);\n}\n\n@container st-global(panel) (width > 100px) {}\n\n/* OUTPUT */\n.x {\n container: panel;\n}\n\n@container panel (width > 100px) {}\n"})}),"\n",(0,s.jsxs)(n.p,{children:["::note global without symbol deinition\nSetting ",(0,s.jsx)(n.code,{children:"st-global"})," around the container name in either the declaration or container query only references a global container name, without creating a symbol that can later be imported or referenced.\n::"]}),"\n",(0,s.jsxs)(n.p,{children:["To register a global container name symbol, that can be imported and referenced by other stylesheets, use the ",(0,s.jsx)(n.code,{children:"@container"})," at-rule with no body or query:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:"/* global panel container name definition */\n@container st-global(panel);\n\n.x {\n container: panel;\n}\n@container panel (width > 100px) {}\n\n\n/* OUTPUT */\n\n.x {\n container: panel;\n}\n@container panel (width > 100px) {}\n"})})]})}function p(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>o});var a=t(6540);const s={},i=a.createContext(s);function r(e){const n=a.useContext(i);return a.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),a.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/f242c874.2420e882.js b/assets/js/f242c874.5c4c0ad4.js similarity index 99% rename from assets/js/f242c874.2420e882.js rename to assets/js/f242c874.5c4c0ad4.js index 46bf4791..506cc5c0 100644 --- a/assets/js/f242c874.2420e882.js +++ b/assets/js/f242c874.5c4c0ad4.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[8829],{2135:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>i,contentTitle:()=>l,default:()=>p,frontMatter:()=>a,metadata:()=>s,toc:()=>c});const s=JSON.parse('{"id":"references/pseudo-elements","title":"Pseudo-Element","description":"In addition to CSS\'s native pseudo-elements, like ::backdrop, Stylable allow you to define custom pseudo-elements so that you can target and apply styles to inner parts of your components.","source":"@site/docs/references/pseudo-elements.md","sourceDirName":"references","slug":"/references/pseudo-elements","permalink":"/docs/references/pseudo-elements","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/pseudo-elements.md","tags":[],"version":"current","frontMatter":{"id":"pseudo-elements","title":"Pseudo-Element"},"sidebar":"Specification Reference","previous":{"title":"Pseudo-Class","permalink":"/docs/references/pseudo-classes"},"next":{"title":"Type Selector","permalink":"/docs/references/type-selectors"}}');var o=t(4848),r=t(8453);const a={id:"pseudo-elements",title:"Pseudo-Element"},l=void 0,i={},c=[{value:"Syntax",id:"syntax",level:2},{value:"Style a component",id:"style-a-component",level:2},{value:"Style a variant",id:"style-a-variant",level:2},{value:"Define",id:"define",level:2},{value:"Element inheritance",id:"element-inheritance",level:3},{value:"Build transformation",id:"build-transformation",level:2}];function d(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(n.p,{children:["In addition to CSS's native pseudo-elements, like ",(0,o.jsx)(n.code,{children:"::before"})," and ",(0,o.jsx)(n.code,{children:"::backdrop"}),", Stylable allow you to define custom pseudo-elements so that you can target and apply styles to inner parts of your components."]}),"\n",(0,o.jsx)(n.p,{children:"This page goes over how Stylable handles custom pseudo-elements, for more details about the language feature itself, checkout the following resources:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements",children:"MDN pseudo-element"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"https://www.w3.org/TR/CSS22/selector.html#pseudo-element-selectors",children:"pseudo-element in spec"})}),"\n"]}),"\n",(0,o.jsx)(n.h2,{id:"syntax",children:"Syntax"}),"\n",(0,o.jsxs)(n.p,{children:["To target an internal element, Use the pseudo-element prefix ",(0,o.jsx)(n.code,{children:"::"})," with the part name."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-css",children:"Component::firstlevel::secondlevel {}\n"})}),"\n",(0,o.jsx)(n.admonition,{title:"deep pseudo-elements",type:"info",children:(0,o.jsxs)(n.p,{children:["Custom pseudo-elements are not limited to the end of a selector like native pseudo-elements, and can be chained. For example, you can access the label of a navigation button from a gallery: ",(0,o.jsx)(n.code,{children:"Gallery::navBtn::label"})]})}),"\n",(0,o.jsx)(n.h2,{id:"style-a-component",children:"Style a component"}),"\n",(0,o.jsxs)(n.p,{children:["Customizing ",(0,o.jsx)(n.strong,{children:"all component instances"})," nested under a stylesheet using the imported ",(0,o.jsx)(n.a,{href:"/docs/references/type-selectors#component-element",children:"component type selector"}),"."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-css",children:"@st-import Comp from './comp.st.css';\n\n/* target Comp internal part */\n.root Comp::part {/* customize */}\n"})}),"\n",(0,o.jsx)(n.h2,{id:"style-a-variant",children:"Style a variant"}),"\n",(0,o.jsxs)(n.p,{children:["Customizing a variant class of a component by ",(0,o.jsx)(n.a,{href:"/docs/references/extend-stylesheet",children:"extending"})," a class with the component stylesheet."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-css",metastring:'title="page.st.css"',children:"@st-import Comp from './comp.st.css';\n\n.compVariant {\n /* set compVariant to inherit from Comp */\n -st-extends: Comp;\n}\n/* target compVariant internal part (inherited from Comp) */\n.compVariant::part {/* customize */}\n"})}),"\n",(0,o.jsx)(n.p,{children:"Then set the variant class to the component instance."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-jsx",metastring:'title="page.jsx"',children:"import Comp from './comp';\nimport { classes } from './page.st.css';\n\nconst Page = () => {\n return (\n \n /* customize Comp with compVariant class */\n\n );\n};\n"})}),"\n",(0,o.jsx)(n.h2,{id:"define",children:"Define"}),"\n",(0,o.jsxs)(n.p,{children:["Any ",(0,o.jsx)(n.a,{href:"/docs/references/class-selectors",children:"CSS class"})," that is exported from a stylesheet is accessible as a pseudo-element."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-css",metastring:'title="comp.st.css"',children:"/* available as ::part for this stylesheet */\n.part {} \n"})}),"\n",(0,o.jsxs)(n.p,{children:["Additionally a ",(0,o.jsx)(n.a,{href:"/docs/references/custom-selectors",children:"custom-selector"})," defined within a stylesheet is exposed as a custom pseudo-element and will take precedence over a class with the same name."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-css",metastring:'title="comp.st.css"',children:"/* available as ::part for this stylesheet\n and preserves the direct child combinator\n when used */\n@custom-selector :--part .root > .part; \n"})}),"\n",(0,o.jsx)(n.admonition,{title:"Native pseudo-element override",type:"caution",children:(0,o.jsxs)(n.p,{children:["Override of native pseudo-elements is possible, however it is ",(0,o.jsx)(n.strong,{children:"strongly discouraged"}),"."]})}),"\n",(0,o.jsx)(n.h3,{id:"element-inheritance",children:"Element inheritance"}),"\n",(0,o.jsxs)(n.p,{children:["An extending ",(0,o.jsx)(n.a,{href:"/docs/references/root",children:"stylesheet root"})," automatically inherits any pseudo-elements from the extended definition, and can then override them by defining its own public parts."]}),"\n",(0,o.jsx)(n.h2,{id:"build-transformation",children:"Build transformation"}),"\n",(0,o.jsx)(n.p,{children:"Custom pseudo-elements are transformed in build-time to target the internal selector they represent."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-css",metastring:'title="comp.st.css"',children:".part {}\n@custom-selector :--directPart .root > .part; \n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-css",metastring:'title="page.st.css"',children:"@st-import Comp from './comp.st.css';\n\n.root {\n -st-extends: Comp;\n}\n\n.root::part {}\n.root::directPart {}\n\n/* OUTPUT */\n.page__root .comp__part {}\n.page__root > .comp__part {}\n"})})]})}function p(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>l});var s=t(6540);const o={},r=s.createContext(o);function a(e){const n=s.useContext(r);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:a(e.components),s.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[8829],{6023:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>i,contentTitle:()=>l,default:()=>p,frontMatter:()=>a,metadata:()=>s,toc:()=>c});const s=JSON.parse('{"id":"references/pseudo-elements","title":"Pseudo-Element","description":"In addition to CSS\'s native pseudo-elements, like ::backdrop, Stylable allow you to define custom pseudo-elements so that you can target and apply styles to inner parts of your components.","source":"@site/docs/references/pseudo-elements.md","sourceDirName":"references","slug":"/references/pseudo-elements","permalink":"/docs/references/pseudo-elements","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/pseudo-elements.md","tags":[],"version":"current","frontMatter":{"id":"pseudo-elements","title":"Pseudo-Element"},"sidebar":"Specification Reference","previous":{"title":"Pseudo-Class","permalink":"/docs/references/pseudo-classes"},"next":{"title":"Type Selector","permalink":"/docs/references/type-selectors"}}');var o=t(4848),r=t(8453);const a={id:"pseudo-elements",title:"Pseudo-Element"},l=void 0,i={},c=[{value:"Syntax",id:"syntax",level:2},{value:"Style a component",id:"style-a-component",level:2},{value:"Style a variant",id:"style-a-variant",level:2},{value:"Define",id:"define",level:2},{value:"Element inheritance",id:"element-inheritance",level:3},{value:"Build transformation",id:"build-transformation",level:2}];function d(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(n.p,{children:["In addition to CSS's native pseudo-elements, like ",(0,o.jsx)(n.code,{children:"::before"})," and ",(0,o.jsx)(n.code,{children:"::backdrop"}),", Stylable allow you to define custom pseudo-elements so that you can target and apply styles to inner parts of your components."]}),"\n",(0,o.jsx)(n.p,{children:"This page goes over how Stylable handles custom pseudo-elements, for more details about the language feature itself, checkout the following resources:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements",children:"MDN pseudo-element"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"https://www.w3.org/TR/CSS22/selector.html#pseudo-element-selectors",children:"pseudo-element in spec"})}),"\n"]}),"\n",(0,o.jsx)(n.h2,{id:"syntax",children:"Syntax"}),"\n",(0,o.jsxs)(n.p,{children:["To target an internal element, Use the pseudo-element prefix ",(0,o.jsx)(n.code,{children:"::"})," with the part name."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-css",children:"Component::firstlevel::secondlevel {}\n"})}),"\n",(0,o.jsx)(n.admonition,{title:"deep pseudo-elements",type:"info",children:(0,o.jsxs)(n.p,{children:["Custom pseudo-elements are not limited to the end of a selector like native pseudo-elements, and can be chained. For example, you can access the label of a navigation button from a gallery: ",(0,o.jsx)(n.code,{children:"Gallery::navBtn::label"})]})}),"\n",(0,o.jsx)(n.h2,{id:"style-a-component",children:"Style a component"}),"\n",(0,o.jsxs)(n.p,{children:["Customizing ",(0,o.jsx)(n.strong,{children:"all component instances"})," nested under a stylesheet using the imported ",(0,o.jsx)(n.a,{href:"/docs/references/type-selectors#component-element",children:"component type selector"}),"."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-css",children:"@st-import Comp from './comp.st.css';\n\n/* target Comp internal part */\n.root Comp::part {/* customize */}\n"})}),"\n",(0,o.jsx)(n.h2,{id:"style-a-variant",children:"Style a variant"}),"\n",(0,o.jsxs)(n.p,{children:["Customizing a variant class of a component by ",(0,o.jsx)(n.a,{href:"/docs/references/extend-stylesheet",children:"extending"})," a class with the component stylesheet."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-css",metastring:'title="page.st.css"',children:"@st-import Comp from './comp.st.css';\n\n.compVariant {\n /* set compVariant to inherit from Comp */\n -st-extends: Comp;\n}\n/* target compVariant internal part (inherited from Comp) */\n.compVariant::part {/* customize */}\n"})}),"\n",(0,o.jsx)(n.p,{children:"Then set the variant class to the component instance."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-jsx",metastring:'title="page.jsx"',children:"import Comp from './comp';\nimport { classes } from './page.st.css';\n\nconst Page = () => {\n return (\n\n \n /* customize Comp with compVariant class */\n\n );\n};\n"})}),"\n",(0,o.jsx)(n.h2,{id:"define",children:"Define"}),"\n",(0,o.jsxs)(n.p,{children:["Any ",(0,o.jsx)(n.a,{href:"/docs/references/class-selectors",children:"CSS class"})," that is exported from a stylesheet is accessible as a pseudo-element."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-css",metastring:'title="comp.st.css"',children:"/* available as ::part for this stylesheet */\n.part {} \n"})}),"\n",(0,o.jsxs)(n.p,{children:["Additionally a ",(0,o.jsx)(n.a,{href:"/docs/references/custom-selectors",children:"custom-selector"})," defined within a stylesheet is exposed as a custom pseudo-element and will take precedence over a class with the same name."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-css",metastring:'title="comp.st.css"',children:"/* available as ::part for this stylesheet\n and preserves the direct child combinator\n when used */\n@custom-selector :--part .root > .part; \n"})}),"\n",(0,o.jsx)(n.admonition,{title:"Native pseudo-element override",type:"caution",children:(0,o.jsxs)(n.p,{children:["Override of native pseudo-elements is possible, however it is ",(0,o.jsx)(n.strong,{children:"strongly discouraged"}),"."]})}),"\n",(0,o.jsx)(n.h3,{id:"element-inheritance",children:"Element inheritance"}),"\n",(0,o.jsxs)(n.p,{children:["An extending ",(0,o.jsx)(n.a,{href:"/docs/references/root",children:"stylesheet root"})," automatically inherits any pseudo-elements from the extended definition, and can then override them by defining its own public parts."]}),"\n",(0,o.jsx)(n.h2,{id:"build-transformation",children:"Build transformation"}),"\n",(0,o.jsx)(n.p,{children:"Custom pseudo-elements are transformed in build-time to target the internal selector they represent."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-css",metastring:'title="comp.st.css"',children:".part {}\n@custom-selector :--directPart .root > .part; \n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-css",metastring:'title="page.st.css"',children:"@st-import Comp from './comp.st.css';\n\n.root {\n -st-extends: Comp;\n}\n\n.root::part {}\n.root::directPart {}\n\n/* OUTPUT */\n.page__root .comp__part {}\n.page__root > .comp__part {}\n"})})]})}function p(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>l});var s=t(6540);const o={},r=s.createContext(o);function a(e){const n=s.useContext(r);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:a(e.components),s.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/f5df1cd5.5e183045.js b/assets/js/f5df1cd5.2cd498a2.js similarity index 98% rename from assets/js/f5df1cd5.5e183045.js rename to assets/js/f5df1cd5.2cd498a2.js index 19b24845..8c3a0af1 100644 --- a/assets/js/f5df1cd5.5e183045.js +++ b/assets/js/f5df1cd5.2cd498a2.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[5619],{8760:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>o,contentTitle:()=>l,default:()=>d,frontMatter:()=>t,metadata:()=>a,toc:()=>c});const a=JSON.parse('{"id":"references/keyframes","title":"Keyframes","description":"The @keyframes CSS at-rule is used to define an animation that can be referenced to animate a DOM element.","source":"@site/docs/references/keyframes.md","sourceDirName":"references","slug":"/references/keyframes","permalink":"/docs/references/keyframes","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/keyframes.md","tags":[],"version":"current","frontMatter":{"id":"keyframes","title":"Keyframes"},"sidebar":"Specification Reference","previous":{"title":"Custom Property","permalink":"/docs/references/css-vars"},"next":{"title":"Layer","permalink":"/docs/references/layer"}}');var r=s(4848),i=s(8453);const t={id:"keyframes",title:"Keyframes"},l=void 0,o={},c=[{value:"Syntax",id:"syntax",level:2},{value:"Import and Export",id:"import-and-export",level:2},{value:"Runtime",id:"runtime",level:2},{value:"Namespace",id:"namespace",level:2},{value:"Disable namespace",id:"disable-namespace",level:3}];function m(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:"@keyframes"})," CSS at-rule is used to define an animation that can be referenced to animate a DOM element."]}),"\n",(0,r.jsxs)(n.p,{children:["This page goes over how Stylable handles ",(0,r.jsx)(n.code,{children:"@keyframes"}),", for more details about the language feature itself, checkout the following resources:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/@keyframes",children:"MDN @keyframes"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://drafts.csswg.org/css-animations/#keyframes",children:"CSS animation spec"})}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"syntax",children:"Syntax"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Keyframes definition"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:"/* empty definition */\n@keyframes slide {}\n\n/* animation definition */\n@keyframes jump {\n from { color: red }\n to { color: green }\n}\n\n/* percentage keyframes */\n@keyframes jump {\n 0% { color: red }\n 50% { color: green }\n 100% { color: blue }\n}\n"})}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Keyframes usage"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:".x {\n /* within animation shorthand */\n animation: slide 3s ease-out infinite;\n}\n.y {\n /* same as above */\n animation-name: slide;\n animation-duration: 3s;\n animation-timing-function: ease-out;\n animation-iteration-count: infinite;\n}\n"})}),"\n",(0,r.jsx)(n.h2,{id:"import-and-export",children:"Import and Export"}),"\n",(0,r.jsxs)(n.p,{children:["An exported keyframes can be imported into another stylesheet with the ",(0,r.jsx)(n.a,{href:"/docs/references/imports",children:"@st-import"})," atrule."]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Insert rules into imported layer"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:"/* get 'slide' keyframes definition from another stylesheet */\n@st-import [keyframes(slide)] from './x.st.css';\n\n.x {\n /* use in animation */\n animation-name: slide;\n}\n"})}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"More import examples"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:"/* map 'slide' keyframes to local name 'x-slide' */\n@st-import [keyframes(slide as x-slide)] from './x.st.css';\n\n/* import multiple keyframes */\n@st-import [keyframes(slide, jump)] from './x.st.css';\n"})}),"\n",(0,r.jsx)(n.h2,{id:"runtime",children:"Runtime"}),"\n",(0,r.jsx)(n.p,{children:"A Keyframes definition can be accessed for dynamic styles using the keyframes mapping on the Stylable runtime stylesheet:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import { keyframes } from './sheet.st.css';\n\n// map to target namespaced keyframes\nkeyframes.jump;\n"})}),"\n",(0,r.jsx)(n.h2,{id:"namespace",children:"Namespace"}),"\n",(0,r.jsx)(n.p,{children:"Stylable automatically namespaces any keyframes name according to the stylesheet it is defined in:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:"@keyframes slide {}\n\n.x {\n animation-name: slide;\n}\n\n/* OUTPUT */\n@keyframes NAMESPACE__slide {}\n\n.x {\n animation-name: NAMESPACE__slide;\n}\n"})}),"\n",(0,r.jsx)(n.h3,{id:"disable-namespace",children:"Disable namespace"}),"\n",(0,r.jsxs)(n.p,{children:["In some cases the default namespace behavior is unwanted. In such cases, ",(0,r.jsx)(n.code,{children:"st-global"})," can be used to mark a keyframes definition as global:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:"@keyframes st-global(slide) {}\n.x {\n animation-name: slide;\n}\n\n/* OUTPUT */\n@keyframes slide {}\n.x {\n animation-name: slide; /* no namespace */\n}\n"})})]})}function d(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(m,{...e})}):m(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>t,x:()=>l});var a=s(6540);const r={},i=a.createContext(r);function t(e){const n=a.useContext(i);return a.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:t(e.components),a.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[5619],{7178:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>o,contentTitle:()=>l,default:()=>d,frontMatter:()=>t,metadata:()=>a,toc:()=>c});const a=JSON.parse('{"id":"references/keyframes","title":"Keyframes","description":"The @keyframes CSS at-rule is used to define an animation that can be referenced to animate a DOM element.","source":"@site/docs/references/keyframes.md","sourceDirName":"references","slug":"/references/keyframes","permalink":"/docs/references/keyframes","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/keyframes.md","tags":[],"version":"current","frontMatter":{"id":"keyframes","title":"Keyframes"},"sidebar":"Specification Reference","previous":{"title":"Custom Property","permalink":"/docs/references/css-vars"},"next":{"title":"Layer","permalink":"/docs/references/layer"}}');var r=s(4848),i=s(8453);const t={id:"keyframes",title:"Keyframes"},l=void 0,o={},c=[{value:"Syntax",id:"syntax",level:2},{value:"Import and Export",id:"import-and-export",level:2},{value:"Runtime",id:"runtime",level:2},{value:"Namespace",id:"namespace",level:2},{value:"Disable namespace",id:"disable-namespace",level:3}];function m(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:"@keyframes"})," CSS at-rule is used to define an animation that can be referenced to animate a DOM element."]}),"\n",(0,r.jsxs)(n.p,{children:["This page goes over how Stylable handles ",(0,r.jsx)(n.code,{children:"@keyframes"}),", for more details about the language feature itself, checkout the following resources:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/@keyframes",children:"MDN @keyframes"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://drafts.csswg.org/css-animations/#keyframes",children:"CSS animation spec"})}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"syntax",children:"Syntax"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Keyframes definition"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:"/* empty definition */\n@keyframes slide {}\n\n/* animation definition */\n@keyframes jump {\n from { color: red }\n to { color: green }\n}\n\n/* percentage keyframes */\n@keyframes jump {\n 0% { color: red }\n 50% { color: green }\n 100% { color: blue }\n}\n"})}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Keyframes usage"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:".x {\n /* within animation shorthand */\n animation: slide 3s ease-out infinite;\n}\n.y {\n /* same as above */\n animation-name: slide;\n animation-duration: 3s;\n animation-timing-function: ease-out;\n animation-iteration-count: infinite;\n}\n"})}),"\n",(0,r.jsx)(n.h2,{id:"import-and-export",children:"Import and Export"}),"\n",(0,r.jsxs)(n.p,{children:["An exported keyframes can be imported into another stylesheet with the ",(0,r.jsx)(n.a,{href:"/docs/references/imports",children:"@st-import"})," atrule."]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Insert rules into imported layer"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:"/* get 'slide' keyframes definition from another stylesheet */\n@st-import [keyframes(slide)] from './x.st.css';\n\n.x {\n /* use in animation */\n animation-name: slide;\n}\n"})}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"More import examples"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:"/* map 'slide' keyframes to local name 'x-slide' */\n@st-import [keyframes(slide as x-slide)] from './x.st.css';\n\n/* import multiple keyframes */\n@st-import [keyframes(slide, jump)] from './x.st.css';\n"})}),"\n",(0,r.jsx)(n.h2,{id:"runtime",children:"Runtime"}),"\n",(0,r.jsx)(n.p,{children:"A Keyframes definition can be accessed for dynamic styles using the keyframes mapping on the Stylable runtime stylesheet:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import { keyframes } from './sheet.st.css';\n\n// map to target namespaced keyframes\nkeyframes.jump;\n"})}),"\n",(0,r.jsx)(n.h2,{id:"namespace",children:"Namespace"}),"\n",(0,r.jsx)(n.p,{children:"Stylable automatically namespaces any keyframes name according to the stylesheet it is defined in:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:"@keyframes slide {}\n\n.x {\n animation-name: slide;\n}\n\n/* OUTPUT */\n@keyframes NAMESPACE__slide {}\n\n.x {\n animation-name: NAMESPACE__slide;\n}\n"})}),"\n",(0,r.jsx)(n.h3,{id:"disable-namespace",children:"Disable namespace"}),"\n",(0,r.jsxs)(n.p,{children:["In some cases the default namespace behavior is unwanted. In such cases, ",(0,r.jsx)(n.code,{children:"st-global"})," can be used to mark a keyframes definition as global:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-css",children:"@keyframes st-global(slide) {}\n.x {\n animation-name: slide;\n}\n\n/* OUTPUT */\n@keyframes slide {}\n.x {\n animation-name: slide; /* no namespace */\n}\n"})})]})}function d(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(m,{...e})}):m(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>t,x:()=>l});var a=s(6540);const r={},i=a.createContext(r);function t(e){const n=a.useContext(i);return a.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:t(e.components),a.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/fde4315e.9ee4e1b1.js b/assets/js/fde4315e.e2e2b344.js similarity index 99% rename from assets/js/fde4315e.9ee4e1b1.js rename to assets/js/fde4315e.e2e2b344.js index 8f68ba3a..670e4a6a 100644 --- a/assets/js/fde4315e.9ee4e1b1.js +++ b/assets/js/fde4315e.e2e2b344.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[1480],{2459:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>i,contentTitle:()=>l,default:()=>m,frontMatter:()=>r,metadata:()=>o,toc:()=>a});const o=JSON.parse('{"id":"references/custom-selectors","title":"Custom Selector","description":"You use custom selectors to define an alias that can match complex selectors.","source":"@site/docs/references/custom-selectors.md","sourceDirName":"references","slug":"/references/custom-selectors","permalink":"/docs/references/custom-selectors","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/custom-selectors.md","tags":[],"version":"current","frontMatter":{"id":"custom-selectors","title":"Custom Selector"},"sidebar":"Specification Reference","previous":{"title":"url()","permalink":"/docs/references/using-external-assets"},"next":{"title":"Extend","permalink":"/docs/references/extend-stylesheet"}}');var t=n(4848),c=n(8453);const r={id:"custom-selectors",title:"Custom Selector"},l=void 0,i={},a=[{value:"Usage",id:"usage",level:2},{value:"Expose pseudo-element",id:"expose-pseudo-element",level:3},{value:"Use cases",id:"use-cases",level:2},{value:"Container and recursive components",id:"container-and-recursive-components",level:3},{value:"Expose inner parts that are deeply defined",id:"expose-inner-parts-that-are-deeply-defined",level:3},{value:"Combination selector",id:"combination-selector",level:3},{value:"Group of selectors",id:"group-of-selectors",level:3},{value:"Issues to consider",id:"issues-to-consider",level:4}];function d(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",p:"p",pre:"pre",strong:"strong",...(0,c.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(s.p,{children:["You use ",(0,t.jsx)(s.a,{href:"https://drafts.csswg.org/css-extensions/#custom-selectors",children:"custom selectors"})," to define an alias that can match complex selectors."]}),"\n",(0,t.jsx)(s.p,{children:"For example, a specific type of button within a form that appears only when hovered can be defined as a custom selector. By defining the button as a custom selector with its own name, the button is exposed in the API and available for use by using just the custom selector name."}),"\n",(0,t.jsx)(s.p,{children:"You could also use custom selectors to define a group of selectors with one name. For example, you can access all the headings on a page as one custom selector. This could be useful if you want to style just their color the same."}),"\n",(0,t.jsx)(s.h2,{id:"usage",children:"Usage"}),"\n",(0,t.jsxs)(s.p,{children:["The following code maps the alias name ",(0,t.jsx)(s.code,{children:"controlBtn"})," that matches any ",(0,t.jsx)(s.code,{children:".btn"})," CSS class nested under the ",(0,t.jsx)(s.code,{children:".controls"})," CSS class."]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",metastring:'title="comp.st.css"',children:"@custom-selector :--controlBtn .controls .btn;\n/* \nselector: .comp__controls .comp__btn \n*/\n:--controlBtn {\n border: 1px solid grey;\n}\n/* \nselector: .comp__controls .comp__btn:hover \n*/\n:--controlBtn:hover {\n border-color: red;\n}\n"})}),"\n",(0,t.jsx)(s.h3,{id:"expose-pseudo-element",children:"Expose pseudo-element"}),"\n",(0,t.jsxs)(s.p,{children:["Custom selectors generate a ",(0,t.jsx)(s.a,{href:"/docs/references/pseudo-elements",children:"pseudo-element"}),". So, for example, ",(0,t.jsx)(s.a,{href:"/docs/references/imports",children:"importing"})," a stylesheet into another stylesheet enables access to the ",(0,t.jsx)(s.code,{children:"controlBtn"})," pseudo-element. In this example, the stylesheet ",(0,t.jsx)(s.code,{children:"comp.st.css"})," from the previous example is imported into this stylesheet."]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",metastring:'title="page.st.css"',children:'@st-import Comp from "./comp.st.css";\n\n/*\nselector: .comp__root .comp__controls .comp__btn\n*/\nComp::controlbtn {\n background: gold;\n}\n'})}),"\n",(0,t.jsx)(s.admonition,{type:"caution",children:(0,t.jsxs)(s.p,{children:["If a ",(0,t.jsx)(s.code,{children:"custom-selector"})," alias conflicts with a local CSS class name, the exposed ",(0,t.jsx)(s.code,{children:"pseudo-element"})," targets the ",(0,t.jsx)(s.code,{children:"custom-selector"}),". However, the exported CSS class is still exported to JavaScript."]})}),"\n",(0,t.jsx)(s.h2,{id:"use-cases",children:"Use cases"}),"\n",(0,t.jsxs)(s.p,{children:["The following examples demonstrate how to effectively use custom selectors in ",(0,t.jsx)(s.strong,{children:"Stylable"}),"."]}),"\n",(0,t.jsx)(s.h3,{id:"container-and-recursive-components",children:"Container and recursive components"}),"\n",(0,t.jsx)(s.p,{children:'Some components might contain nested instances of themselves because they\'re a container or a "recursive" component. For example, a tree component might render itself.'}),"\n",(0,t.jsxs)(s.p,{children:["If the component exposes any ",(0,t.jsx)(s.code,{children:"pseudo-elements"}),", it is a good practice to define them as ",(0,t.jsx)(s.code,{children:"custom selectors"})," with ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/Child_selectors",children:"child selectors"})," to avoid affecting the inner parts of internal instances."]}),"\n",(0,t.jsx)(s.p,{children:"The following example shows how a tree component exposes an icon."}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",metastring:'title="tree.st.css"',children:"@custom-selector :--icon .root > .icon;\n"})}),"\n",(0,t.jsxs)(s.p,{children:["Here you can use the icon ",(0,t.jsx)(s.code,{children:"custom selector"})," from the outside just like you would use any other ",(0,t.jsx)(s.code,{children:"pseudo-element"}),"."]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",metastring:'title="panel.st.css"',children:'@st-import Tree from "./tree.st.css";\n\n/*\nselector: .tree__root > .tree__icon\n*/\nTree::icon {\n background: yellow; /* paints the icons all the way down the tree */\n}\n'})}),"\n",(0,t.jsx)(s.h3,{id:"expose-inner-parts-that-are-deeply-defined",children:"Expose inner parts that are deeply defined"}),"\n",(0,t.jsxs)(s.p,{children:["When you want to make internal parts of your component API more accessible, you can describe ",(0,t.jsx)(s.code,{children:"pseudo-elements"})," using ",(0,t.jsx)(s.code,{children:"custom selectors"}),"."]}),"\n",(0,t.jsxs)(s.p,{children:["For example, you can expose a ",(0,t.jsx)(s.code,{children:"pseudo-element"})," named ",(0,t.jsx)(s.code,{children:"navigationBtn"})," that enables you to style an internal gallery component's ",(0,t.jsx)(s.code,{children:"navBtn"})," element."]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",children:'@st-import Gallery from "./gallery.st.css";\n\n@custom-selector :--navigationBtn Gallery::navbtn;\n'})}),"\n",(0,t.jsx)(s.h3,{id:"combination-selector",children:"Combination selector"}),"\n",(0,t.jsxs)(s.p,{children:["You may have a component with several basic CSS classes and with corresponding ",(0,t.jsx)(s.code,{children:"pseudo-elements"}),". You could expose a combination ",(0,t.jsx)(s.code,{children:"pseudo-element"}),"."]}),"\n",(0,t.jsxs)(s.p,{children:["For example, a ",(0,t.jsx)(s.code,{children:"pseudo-element"})," named ",(0,t.jsx)(s.code,{children:"navBtn"})," matches any ",(0,t.jsx)(s.code,{children:"btn"})," CSS class nested in a ",(0,t.jsx)(s.code,{children:"nav"})," CSS class."]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",metastring:'title="comp.st.css"',children:"@custom-selector :--navBtn .nav .btn;\n"})}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",metastring:'title="page.st.css"',children:'@st-import Comp from "./comp.st.css";\n\n/*\nselector: .comp__root .comp__nav .comp__btn\n*/\nComp::navbtn {\n border: 1px solid grey;\n}\n'})}),"\n",(0,t.jsx)(s.h3,{id:"group-of-selectors",children:"Group of selectors"}),"\n",(0,t.jsx)(s.p,{children:"You could also use custom selectors to gather a collection of selectors into a single selector. For example, you may want to access media that includes both images and videos."}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",metastring:'title="comp.st.css"',children:"@custom-selector :--media .image, .video;\n/*\nselector: \n.comp__image, .comp__video \n*/\n:--media {\n border: 1px solid grey;\n}\n"})}),"\n",(0,t.jsx)(s.h4,{id:"issues-to-consider",children:"Issues to consider"}),"\n",(0,t.jsxs)(s.p,{children:["Aliasing multiple selectors in a ",(0,t.jsx)(s.code,{children:"custom selector"})," may generate lots of CSS that could affect performance."]}),"\n",(0,t.jsxs)(s.p,{children:["For example, when you import the ",(0,t.jsx)(s.code,{children:"Comp"})," stylesheet (the selector described in the previous example) into another stylesheet, in the output the selector is split for each override."]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",metastring:'title="page.st.css"',children:'@st-import Comp from "./comp.st.css";\n\nComp::media {\n border-color: red;\n}\n\n/* OUTPUT */\n.comp__root .comp__image,\n.comp__root .comp__video {\n border-color: red;\n}\n'})})]})}function m(e={}){const{wrapper:s}={...(0,c.R)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},8453:(e,s,n)=>{n.d(s,{R:()=>r,x:()=>l});var o=n(6540);const t={},c=o.createContext(t);function r(e){const s=o.useContext(c);return o.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function l(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:r(e.components),o.createElement(c.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[1480],{4147:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>i,contentTitle:()=>l,default:()=>m,frontMatter:()=>r,metadata:()=>o,toc:()=>a});const o=JSON.parse('{"id":"references/custom-selectors","title":"Custom Selector","description":"You use custom selectors to define an alias that can match complex selectors.","source":"@site/docs/references/custom-selectors.md","sourceDirName":"references","slug":"/references/custom-selectors","permalink":"/docs/references/custom-selectors","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/references/custom-selectors.md","tags":[],"version":"current","frontMatter":{"id":"custom-selectors","title":"Custom Selector"},"sidebar":"Specification Reference","previous":{"title":"url()","permalink":"/docs/references/using-external-assets"},"next":{"title":"Extend","permalink":"/docs/references/extend-stylesheet"}}');var t=n(4848),c=n(8453);const r={id:"custom-selectors",title:"Custom Selector"},l=void 0,i={},a=[{value:"Usage",id:"usage",level:2},{value:"Expose pseudo-element",id:"expose-pseudo-element",level:3},{value:"Use cases",id:"use-cases",level:2},{value:"Container and recursive components",id:"container-and-recursive-components",level:3},{value:"Expose inner parts that are deeply defined",id:"expose-inner-parts-that-are-deeply-defined",level:3},{value:"Combination selector",id:"combination-selector",level:3},{value:"Group of selectors",id:"group-of-selectors",level:3},{value:"Issues to consider",id:"issues-to-consider",level:4}];function d(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",p:"p",pre:"pre",strong:"strong",...(0,c.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(s.p,{children:["You use ",(0,t.jsx)(s.a,{href:"https://drafts.csswg.org/css-extensions/#custom-selectors",children:"custom selectors"})," to define an alias that can match complex selectors."]}),"\n",(0,t.jsx)(s.p,{children:"For example, a specific type of button within a form that appears only when hovered can be defined as a custom selector. By defining the button as a custom selector with its own name, the button is exposed in the API and available for use by using just the custom selector name."}),"\n",(0,t.jsx)(s.p,{children:"You could also use custom selectors to define a group of selectors with one name. For example, you can access all the headings on a page as one custom selector. This could be useful if you want to style just their color the same."}),"\n",(0,t.jsx)(s.h2,{id:"usage",children:"Usage"}),"\n",(0,t.jsxs)(s.p,{children:["The following code maps the alias name ",(0,t.jsx)(s.code,{children:"controlBtn"})," that matches any ",(0,t.jsx)(s.code,{children:".btn"})," CSS class nested under the ",(0,t.jsx)(s.code,{children:".controls"})," CSS class."]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",metastring:'title="comp.st.css"',children:"@custom-selector :--controlBtn .controls .btn;\n/* \nselector: .comp__controls .comp__btn \n*/\n:--controlBtn {\n border: 1px solid grey;\n}\n/* \nselector: .comp__controls .comp__btn:hover \n*/\n:--controlBtn:hover {\n border-color: red;\n}\n"})}),"\n",(0,t.jsx)(s.h3,{id:"expose-pseudo-element",children:"Expose pseudo-element"}),"\n",(0,t.jsxs)(s.p,{children:["Custom selectors generate a ",(0,t.jsx)(s.a,{href:"/docs/references/pseudo-elements",children:"pseudo-element"}),". So, for example, ",(0,t.jsx)(s.a,{href:"/docs/references/imports",children:"importing"})," a stylesheet into another stylesheet enables access to the ",(0,t.jsx)(s.code,{children:"controlBtn"})," pseudo-element. In this example, the stylesheet ",(0,t.jsx)(s.code,{children:"comp.st.css"})," from the previous example is imported into this stylesheet."]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",metastring:'title="page.st.css"',children:'@st-import Comp from "./comp.st.css";\n\n/*\nselector: .comp__root .comp__controls .comp__btn\n*/\nComp::controlbtn {\n background: gold;\n}\n'})}),"\n",(0,t.jsx)(s.admonition,{type:"caution",children:(0,t.jsxs)(s.p,{children:["If a ",(0,t.jsx)(s.code,{children:"custom-selector"})," alias conflicts with a local CSS class name, the exposed ",(0,t.jsx)(s.code,{children:"pseudo-element"})," targets the ",(0,t.jsx)(s.code,{children:"custom-selector"}),". However, the exported CSS class is still exported to JavaScript."]})}),"\n",(0,t.jsx)(s.h2,{id:"use-cases",children:"Use cases"}),"\n",(0,t.jsxs)(s.p,{children:["The following examples demonstrate how to effectively use custom selectors in ",(0,t.jsx)(s.strong,{children:"Stylable"}),"."]}),"\n",(0,t.jsx)(s.h3,{id:"container-and-recursive-components",children:"Container and recursive components"}),"\n",(0,t.jsx)(s.p,{children:'Some components might contain nested instances of themselves because they\'re a container or a "recursive" component. For example, a tree component might render itself.'}),"\n",(0,t.jsxs)(s.p,{children:["If the component exposes any ",(0,t.jsx)(s.code,{children:"pseudo-elements"}),", it is a good practice to define them as ",(0,t.jsx)(s.code,{children:"custom selectors"})," with ",(0,t.jsx)(s.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/Child_selectors",children:"child selectors"})," to avoid affecting the inner parts of internal instances."]}),"\n",(0,t.jsx)(s.p,{children:"The following example shows how a tree component exposes an icon."}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",metastring:'title="tree.st.css"',children:"@custom-selector :--icon .root > .icon;\n"})}),"\n",(0,t.jsxs)(s.p,{children:["Here you can use the icon ",(0,t.jsx)(s.code,{children:"custom selector"})," from the outside just like you would use any other ",(0,t.jsx)(s.code,{children:"pseudo-element"}),"."]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",metastring:'title="panel.st.css"',children:'@st-import Tree from "./tree.st.css";\n\n/*\nselector: .tree__root > .tree__icon\n*/\nTree::icon {\n background: yellow; /* paints the icons all the way down the tree */\n}\n'})}),"\n",(0,t.jsx)(s.h3,{id:"expose-inner-parts-that-are-deeply-defined",children:"Expose inner parts that are deeply defined"}),"\n",(0,t.jsxs)(s.p,{children:["When you want to make internal parts of your component API more accessible, you can describe ",(0,t.jsx)(s.code,{children:"pseudo-elements"})," using ",(0,t.jsx)(s.code,{children:"custom selectors"}),"."]}),"\n",(0,t.jsxs)(s.p,{children:["For example, you can expose a ",(0,t.jsx)(s.code,{children:"pseudo-element"})," named ",(0,t.jsx)(s.code,{children:"navigationBtn"})," that enables you to style an internal gallery component's ",(0,t.jsx)(s.code,{children:"navBtn"})," element."]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",children:'@st-import Gallery from "./gallery.st.css";\n\n@custom-selector :--navigationBtn Gallery::navbtn;\n'})}),"\n",(0,t.jsx)(s.h3,{id:"combination-selector",children:"Combination selector"}),"\n",(0,t.jsxs)(s.p,{children:["You may have a component with several basic CSS classes and with corresponding ",(0,t.jsx)(s.code,{children:"pseudo-elements"}),". You could expose a combination ",(0,t.jsx)(s.code,{children:"pseudo-element"}),"."]}),"\n",(0,t.jsxs)(s.p,{children:["For example, a ",(0,t.jsx)(s.code,{children:"pseudo-element"})," named ",(0,t.jsx)(s.code,{children:"navBtn"})," matches any ",(0,t.jsx)(s.code,{children:"btn"})," CSS class nested in a ",(0,t.jsx)(s.code,{children:"nav"})," CSS class."]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",metastring:'title="comp.st.css"',children:"@custom-selector :--navBtn .nav .btn;\n"})}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",metastring:'title="page.st.css"',children:'@st-import Comp from "./comp.st.css";\n\n/*\nselector: .comp__root .comp__nav .comp__btn\n*/\nComp::navbtn {\n border: 1px solid grey;\n}\n'})}),"\n",(0,t.jsx)(s.h3,{id:"group-of-selectors",children:"Group of selectors"}),"\n",(0,t.jsx)(s.p,{children:"You could also use custom selectors to gather a collection of selectors into a single selector. For example, you may want to access media that includes both images and videos."}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",metastring:'title="comp.st.css"',children:"@custom-selector :--media .image, .video;\n/*\nselector: \n.comp__image, .comp__video \n*/\n:--media {\n border: 1px solid grey;\n}\n"})}),"\n",(0,t.jsx)(s.h4,{id:"issues-to-consider",children:"Issues to consider"}),"\n",(0,t.jsxs)(s.p,{children:["Aliasing multiple selectors in a ",(0,t.jsx)(s.code,{children:"custom selector"})," may generate lots of CSS that could affect performance."]}),"\n",(0,t.jsxs)(s.p,{children:["For example, when you import the ",(0,t.jsx)(s.code,{children:"Comp"})," stylesheet (the selector described in the previous example) into another stylesheet, in the output the selector is split for each override."]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-css",metastring:'title="page.st.css"',children:'@st-import Comp from "./comp.st.css";\n\nComp::media {\n border-color: red;\n}\n\n/* OUTPUT */\n.comp__root .comp__image,\n.comp__root .comp__video {\n border-color: red;\n}\n'})})]})}function m(e={}){const{wrapper:s}={...(0,c.R)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},8453:(e,s,n)=>{n.d(s,{R:()=>r,x:()=>l});var o=n(6540);const t={},c=o.createContext(t);function r(e){const s=o.useContext(c);return o.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function l(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:r(e.components),o.createElement(c.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/fe460ebe.1e1a4478.js b/assets/js/fe460ebe.3c13ec03.js similarity index 98% rename from assets/js/fe460ebe.1e1a4478.js rename to assets/js/fe460ebe.3c13ec03.js index 2e3a42b8..5999d552 100644 --- a/assets/js/fe460ebe.1e1a4478.js +++ b/assets/js/fe460ebe.3c13ec03.js @@ -1 +1 @@ -"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[420],{5836:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>a,contentTitle:()=>r,default:()=>g,frontMatter:()=>o,metadata:()=>i,toc:()=>c});const i=JSON.parse('{"id":"getting-started/tooling/stylable-intelligence","title":"Stylable Intelligence","description":"Stylable Intelligence is an extension implementing the Language Server Protocol that provides IDE support for Stylable. It currently includes:","source":"@site/docs/getting-started/tooling/stylable-intelligence.md","sourceDirName":"getting-started/tooling","slug":"/getting-started/tooling/stylable-intelligence","permalink":"/docs/getting-started/tooling/stylable-intelligence","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/getting-started/tooling/stylable-intelligence.md","tags":[],"version":"current","frontMatter":{"id":"stylable-intelligence","title":"Stylable Intelligence","sidebar_label":"VSCode Extension"},"sidebar":"Discover","previous":{"title":"stylable.config.js","permalink":"/docs/getting-started/stylable-config"},"next":{"title":"CLI","permalink":"/docs/getting-started/tooling/cli"}}');var l=n(4848),s=n(8453);const o={id:"stylable-intelligence",title:"Stylable Intelligence",sidebar_label:"VSCode Extension"},r=void 0,a={},c=[{value:"Installation",id:"installation",level:2},{value:"IDE extensions",id:"ide-extensions",level:2},{value:"CSS functionality",id:"css-functionality",level:2}];function d(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(t.p,{children:[(0,l.jsx)(t.strong,{children:"Stylable Intelligence"})," is an extension implementing the ",(0,l.jsx)(t.a,{href:"https://microsoft.github.io/language-server-protocol/",children:"Language Server Protocol"})," that provides IDE support for ",(0,l.jsx)(t.strong,{children:"Stylable"}),". It currently includes:"]}),"\n",(0,l.jsxs)(t.ul,{children:["\n",(0,l.jsx)(t.li,{children:"Syntax highlighting"}),"\n",(0,l.jsx)(t.li,{children:"Code completion"}),"\n",(0,l.jsx)(t.li,{children:"Go to definition"}),"\n",(0,l.jsx)(t.li,{children:"Diagnostics"}),"\n"]}),"\n",(0,l.jsx)(t.h2,{id:"installation",children:"Installation"}),"\n",(0,l.jsxs)(t.p,{children:["You can install ",(0,l.jsx)(t.strong,{children:"Stylable Intelligence"})," from the ",(0,l.jsx)(t.a,{href:"https://marketplace.visualstudio.com/items?itemName=wix.stylable-intelligence",children:"Visual Studio Code market"}),":"]}),"\n",(0,l.jsxs)(t.ul,{children:["\n",(0,l.jsxs)(t.li,{children:["In Visual Studio Code, click the ",(0,l.jsx)(t.strong,{children:"Extensions"})," icon to open the market."]}),"\n",(0,l.jsxs)(t.li,{children:["In the search field, enter ",(0,l.jsx)(t.strong,{children:"Stylable Intelligence"}),"."]}),"\n",(0,l.jsx)(t.li,{children:"Install the extension and reload the window when prompted."}),"\n"]}),"\n",(0,l.jsx)(t.h2,{id:"ide-extensions",children:"IDE extensions"}),"\n",(0,l.jsxs)(t.p,{children:["Because stylable-intelligence registers ",(0,l.jsx)(t.code,{children:".st.css"})," files as Stylable and not CSS, certain CSS extensions may not work until they explicitly add Stylable support. The stylable-intelligence extension for VSCode is compatible with the following CSS extensions:"]}),"\n",(0,l.jsxs)(t.ol,{children:["\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.a,{href:"https://github.com/kisstkondoros/csstriggers",children:"CssTriggers"}),"(^0.4.0) - A VSCode extension that adds inline decoration to CSS properties to indicate their costs."]}),"\n"]}),"\n",(0,l.jsx)(t.p,{children:"If you are using an extension that you would like to add to this list, let us know and we'd be happy to help."}),"\n",(0,l.jsx)(t.h2,{id:"css-functionality",children:"CSS functionality"}),"\n",(0,l.jsx)(t.p,{children:"Because Stylable files are not recognized as CSS, we proxy the CSS Language Server through stylable-intelligence. Most basic features are already supported, but if you notice anything strange, let us know."}),"\n",(0,l.jsxs)(t.admonition,{type:"note",children:[(0,l.jsx)(t.p,{children:"Future plans include:"}),(0,l.jsxs)(t.ul,{children:["\n",(0,l.jsx)(t.li,{children:"More Language Server features."}),"\n",(0,l.jsx)(t.li,{children:"Support for JetBrains IDEs (WebStorm, IntelliJ). Currently supported only in VSCode."}),"\n"]})]})]})}function g(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,l.jsx)(t,{...e,children:(0,l.jsx)(d,{...e})}):d(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>o,x:()=>r});var i=n(6540);const l={},s=i.createContext(l);function o(e){const t=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:o(e.components),i.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[420],{3988:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>a,contentTitle:()=>r,default:()=>g,frontMatter:()=>o,metadata:()=>i,toc:()=>c});const i=JSON.parse('{"id":"getting-started/tooling/stylable-intelligence","title":"Stylable Intelligence","description":"Stylable Intelligence is an extension implementing the Language Server Protocol that provides IDE support for Stylable. It currently includes:","source":"@site/docs/getting-started/tooling/stylable-intelligence.md","sourceDirName":"getting-started/tooling","slug":"/getting-started/tooling/stylable-intelligence","permalink":"/docs/getting-started/tooling/stylable-intelligence","draft":false,"unlisted":false,"editUrl":"https://github.com/wixplosives/stylable.io/edit/master/docs/getting-started/tooling/stylable-intelligence.md","tags":[],"version":"current","frontMatter":{"id":"stylable-intelligence","title":"Stylable Intelligence","sidebar_label":"VSCode Extension"},"sidebar":"Discover","previous":{"title":"stylable.config.js","permalink":"/docs/getting-started/stylable-config"},"next":{"title":"CLI","permalink":"/docs/getting-started/tooling/cli"}}');var l=n(4848),s=n(8453);const o={id:"stylable-intelligence",title:"Stylable Intelligence",sidebar_label:"VSCode Extension"},r=void 0,a={},c=[{value:"Installation",id:"installation",level:2},{value:"IDE extensions",id:"ide-extensions",level:2},{value:"CSS functionality",id:"css-functionality",level:2}];function d(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(t.p,{children:[(0,l.jsx)(t.strong,{children:"Stylable Intelligence"})," is an extension implementing the ",(0,l.jsx)(t.a,{href:"https://microsoft.github.io/language-server-protocol/",children:"Language Server Protocol"})," that provides IDE support for ",(0,l.jsx)(t.strong,{children:"Stylable"}),". It currently includes:"]}),"\n",(0,l.jsxs)(t.ul,{children:["\n",(0,l.jsx)(t.li,{children:"Syntax highlighting"}),"\n",(0,l.jsx)(t.li,{children:"Code completion"}),"\n",(0,l.jsx)(t.li,{children:"Go to definition"}),"\n",(0,l.jsx)(t.li,{children:"Diagnostics"}),"\n"]}),"\n",(0,l.jsx)(t.h2,{id:"installation",children:"Installation"}),"\n",(0,l.jsxs)(t.p,{children:["You can install ",(0,l.jsx)(t.strong,{children:"Stylable Intelligence"})," from the ",(0,l.jsx)(t.a,{href:"https://marketplace.visualstudio.com/items?itemName=wix.stylable-intelligence",children:"Visual Studio Code market"}),":"]}),"\n",(0,l.jsxs)(t.ul,{children:["\n",(0,l.jsxs)(t.li,{children:["In Visual Studio Code, click the ",(0,l.jsx)(t.strong,{children:"Extensions"})," icon to open the market."]}),"\n",(0,l.jsxs)(t.li,{children:["In the search field, enter ",(0,l.jsx)(t.strong,{children:"Stylable Intelligence"}),"."]}),"\n",(0,l.jsx)(t.li,{children:"Install the extension and reload the window when prompted."}),"\n"]}),"\n",(0,l.jsx)(t.h2,{id:"ide-extensions",children:"IDE extensions"}),"\n",(0,l.jsxs)(t.p,{children:["Because stylable-intelligence registers ",(0,l.jsx)(t.code,{children:".st.css"})," files as Stylable and not CSS, certain CSS extensions may not work until they explicitly add Stylable support. The stylable-intelligence extension for VSCode is compatible with the following CSS extensions:"]}),"\n",(0,l.jsxs)(t.ol,{children:["\n",(0,l.jsxs)(t.li,{children:[(0,l.jsx)(t.a,{href:"https://github.com/kisstkondoros/csstriggers",children:"CssTriggers"}),"(^0.4.0) - A VSCode extension that adds inline decoration to CSS properties to indicate their costs."]}),"\n"]}),"\n",(0,l.jsx)(t.p,{children:"If you are using an extension that you would like to add to this list, let us know and we'd be happy to help."}),"\n",(0,l.jsx)(t.h2,{id:"css-functionality",children:"CSS functionality"}),"\n",(0,l.jsx)(t.p,{children:"Because Stylable files are not recognized as CSS, we proxy the CSS Language Server through stylable-intelligence. Most basic features are already supported, but if you notice anything strange, let us know."}),"\n",(0,l.jsxs)(t.admonition,{type:"note",children:[(0,l.jsx)(t.p,{children:"Future plans include:"}),(0,l.jsxs)(t.ul,{children:["\n",(0,l.jsx)(t.li,{children:"More Language Server features."}),"\n",(0,l.jsx)(t.li,{children:"Support for JetBrains IDEs (WebStorm, IntelliJ). Currently supported only in VSCode."}),"\n"]})]})]})}function g(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,l.jsx)(t,{...e,children:(0,l.jsx)(d,{...e})}):d(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>o,x:()=>r});var i=n(6540);const l={},s=i.createContext(l);function o(e){const t=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:o(e.components),i.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/main.43fac053.js b/assets/js/main.43fac053.js new file mode 100644 index 00000000..08f54f42 --- /dev/null +++ b/assets/js/main.43fac053.js @@ -0,0 +1,2 @@ +/*! For license information please see main.43fac053.js.LICENSE.txt */ +(self.webpackChunkstylable_io=self.webpackChunkstylable_io||[]).push([[8792],{4081:(e,t,n)=>{"use strict";n.d(t,{CU:()=>r,Hg:()=>d,I$:()=>u,O6:()=>p,UB:()=>c,WW:()=>i,ZG:()=>l,dz:()=>f,pk:()=>s,rG:()=>o,tb:()=>a});const r=null,o=50,a=!1,i=!0,s=!0,l="right",c=void 0,u=!0,d=null,p=!1,f=!1},8328:(e,t,n)=>{"use strict";n.d(t,{A:()=>p});n(6540);var r=n(3259),o=n.n(r),a=n(4054);const i={"0058b4c6":[()=>n.e(849).then(n.t.bind(n,6164,19)),"@generated/docusaurus-plugin-content-docs/default/p/docs-175.json",6164],"01a85c17":[()=>Promise.all([n.e(1869),n.e(8209)]).then(n.bind(n,9158)),"@theme/BlogTagsListPage",9158],"084229dc":[()=>n.e(1701).then(n.bind(n,1338)),"@site/docs/references/global-selectors.md",1338],"0a256791":[()=>n.e(2110).then(n.bind(n,598)),"@site/docs/references/tag-selectors.md",598],"0ce74438":[()=>n.e(3365).then(n.bind(n,5427)),"@site/src/pages/playground.tsx",5427],"138e0e15":[()=>n.e(4921).then(n.t.bind(n,1597,19)),"@generated/@easyops-cn/docusaurus-search-local/default/__plugin.json",1597],"14eb3368":[()=>Promise.all([n.e(1869),n.e(6969)]).then(n.bind(n,4136)),"@theme/DocCategoryGeneratedIndexPage",4136],"17347b34":[()=>n.e(6468).then(n.bind(n,720)),"@site/docs/getting-started/nextjs-integration.md",720],17896441:[()=>Promise.all([n.e(1869),n.e(5394),n.e(6369),n.e(8401)]).then(n.bind(n,833)),"@theme/DocItem",833],"1a4e3797":[()=>Promise.all([n.e(1869),n.e(2138)]).then(n.bind(n,1283)),"@theme/SearchPage",1283],"1a5eac39":[()=>n.e(4215).then(n.bind(n,7189)),"@site/docs/guides/handbook/namespace.md",7189],"1df93b7f":[()=>n.e(4583).then(n.bind(n,8421)),"@site/src/pages/index.tsx",8421],"1f7dc951":[()=>n.e(9597).then(n.bind(n,1459)),"@site/docs/guides/shared-classes.md",1459],24352365:[()=>n.e(5395).then(n.bind(n,8033)),"@site/docs/getting-started/storybook-integration.md",8033],"24ff752b":[()=>n.e(825).then(n.bind(n,3701)),"@site/docs/guides/migration-v5.md",3701],"26a8bbe9":[()=>n.e(5666).then(n.bind(n,8090)),"@site/blog/2022-08-04-welcome-to-stylable-v5.md?truncated=true",8090],"2ce01146":[()=>n.e(9169).then(n.bind(n,7214)),"@site/docs/references/formatters.md",7214],"2de44985":[()=>n.e(7678).then(n.bind(n,5397)),"@site/docs/guides/migration-v3.md",5397],"32382f69":[()=>n.e(1858).then(n.bind(n,7370)),"@site/docs/references/namespace.md",7370],35811679:[()=>n.e(7135).then(n.bind(n,2998)),"@site/docs/guides/handbook/intro.md",2998],"36994c47":[()=>n.e(9858).then(n.t.bind(n,5516,19)),"@generated/docusaurus-plugin-content-blog/default/__plugin.json",5516],"371f5dc2":[()=>Promise.all([n.e(1869),n.e(5394),n.e(5184)]).then(n.bind(n,6590)),"@site/docs/getting-started/boilerplate.mdx",6590],"3a2db09e":[()=>n.e(8121).then(n.t.bind(n,8070,19)),"@generated/docusaurus-plugin-content-blog/default/p/blog-tags-df9.json",8070],"46d93a8f":[()=>n.e(734).then(n.bind(n,3691)),"@site/docs/guides/server-side-rendering.md",3691],"49b68603":[()=>n.e(2679).then(n.t.bind(n,6825,19)),"@generated/docusaurus-plugin-content-docs/default/p/docs-getting-started-integrations-379.json",6825],"57b59cd4":[()=>n.e(8880).then(n.bind(n,2403)),"@site/src/pages/community.tsx",2403],"587a03c1":[()=>n.e(7395).then(n.bind(n,7813)),"@site/docs/guides/handbook/runtime.md",7813],"5e66eab8":[()=>n.e(4293).then(n.bind(n,8343)),"@site/docs/references/extend-stylesheet.md",8343],"5e95c892":[()=>n.e(9647).then(n.bind(n,7121)),"@theme/DocsRoot",7121],"5e9f5e1a":[()=>Promise.resolve().then(n.bind(n,4784)),"@generated/docusaurus.config",4784],"5ec46957":[()=>n.e(4947).then(n.bind(n,6051)),"@site/docs/references/imports.md",6051],"6875c492":[()=>Promise.all([n.e(1869),n.e(5394),n.e(6369),n.e(6321),n.e(4813)]).then(n.bind(n,1086)),"@theme/BlogTagsPostsPage",1086],"6e96288b":[()=>n.e(5457).then(n.bind(n,9866)),"@site/docs/guides/component-variants.md",9866],"705f3d56":[()=>n.e(9183).then(n.bind(n,3239)),"@site/docs/references/using-external-assets.md",3239],"79455fbf":[()=>n.e(3879).then(n.bind(n,1819)),"@site/docs/references/class-selectors.md",1819],"7df4dfbf":[()=>n.e(2670).then(n.bind(n,1564)),"@site/docs/attributions.md",1564],"814f3328":[()=>n.e(7472).then(n.t.bind(n,5513,19)),"~blog/default/blog-post-list-prop-default.json",5513],"825e4603":[()=>n.e(1026).then(n.bind(n,1179)),"@site/docs/references/runtime.md",1179],"866f0f84":[()=>n.e(2619).then(n.bind(n,1872)),"@site/docs/guides/project-commons.md",1872],"89bbbeae":[()=>n.e(4715).then(n.bind(n,7983)),"@site/docs/references/mixins.md",7983],"8abe6768":[()=>Promise.all([n.e(1869),n.e(5394),n.e(7774)]).then(n.bind(n,7062)),"@site/docs/getting-started/stylable-config.mdx",7062],"922647ed":[()=>n.e(1274).then(n.bind(n,6059)),"@site/docs/getting-started/webpack-integration.md",6059],"945a8992":[()=>n.e(9729).then(n.bind(n,3735)),"@site/docs/references/variables.md",3735],"9e4087bc":[()=>n.e(2711).then(n.bind(n,9331)),"@theme/BlogArchivePage",9331],a2b316bf:[()=>n.e(150).then(n.bind(n,7518)),"@site/docs/guides/handbook/class.mdx",7518],a2cbecc3:[()=>n.e(5299).then(n.bind(n,665)),"@site/docs/getting-started/manual-integration.mdx",665],a399b375:[()=>n.e(5076).then(n.bind(n,5961)),"@site/docs/getting-started/typescript-integration.md",5961],a6aa9e1f:[()=>Promise.all([n.e(1869),n.e(5394),n.e(6369),n.e(6321),n.e(7643)]).then(n.bind(n,5124)),"@theme/BlogListPage",5124],a7456010:[()=>n.e(1235).then(n.t.bind(n,8552,19)),"@generated/docusaurus-plugin-content-pages/default/__plugin.json",8552],a7bd4aaa:[()=>n.e(7098).then(n.bind(n,4532)),"@theme/DocVersionRoot",4532],a94703ab:[()=>Promise.all([n.e(1869),n.e(9048)]).then(n.bind(n,1377)),"@theme/DocRoot",1377],ab324915:[()=>n.e(6722).then(n.bind(n,4454)),"@site/blog/2022-08-04-welcome-to-stylable-v5.md",4454],aba21aa0:[()=>n.e(5742).then(n.t.bind(n,7093,19)),"@generated/docusaurus-plugin-content-docs/default/__plugin.json",7093],acecf23e:[()=>n.e(1903).then(n.t.bind(n,1912,19)),"~blog/default/blogMetadata-default.json",1912],acfb8e34:[()=>Promise.all([n.e(1869),n.e(6223)]).then(n.bind(n,5140)),"@site/docs/getting-started/tooling/cli.mdx",5140],b10d9af9:[()=>n.e(9849).then(n.bind(n,8101)),"@site/docs/guides/handbook/state.md",8101],b1a4f681:[()=>Promise.all([n.e(1869),n.e(5394),n.e(7514)]).then(n.bind(n,4670)),"@site/docs/guides/handbook/extend.mdx",4670],baf0d4a2:[()=>n.e(6827).then(n.bind(n,5895)),"@site/docs/style-guide.md",5895],bc80c935:[()=>Promise.all([n.e(1869),n.e(5394),n.e(2346)]).then(n.bind(n,4719)),"@site/docs/references/cheatsheet.mdx",4719],bfefe422:[()=>n.e(693).then(n.bind(n,5967)),"@site/docs/references/css-vars.md",5967],c0d90f50:[()=>n.e(7394).then(n.bind(n,4707)),"@site/docs/references/root.md",4707],c15d9823:[()=>n.e(8146).then(n.t.bind(n,9328,19)),"@generated/docusaurus-plugin-content-blog/default/p/blog-bd9.json",9328],c8df2e0f:[()=>n.e(9101).then(n.t.bind(n,8896,19)),"@generated/docusaurus-plugin-content-blog/default/p/blog-tags-intro-d57.json",8896],c9cac9d9:[()=>n.e(4918).then(n.t.bind(n,371,19)),"@generated/docusaurus-plugin-content-blog/default/p/blog-tags-release-6bd.json",371],cb737cc7:[()=>Promise.all([n.e(1869),n.e(5394),n.e(242)]).then(n.bind(n,3)),"@site/docs/guides/handbook/import.mdx",3],ccc49370:[()=>Promise.all([n.e(1869),n.e(5394),n.e(6369),n.e(6321),n.e(3249)]).then(n.bind(n,3858)),"@theme/BlogPostPage",3858],d879f3fa:[()=>n.e(7381).then(n.bind(n,8514)),"@site/docs/references/layer.md",8514],de106496:[()=>n.e(614).then(n.bind(n,4059)),"@site/docs/references/st-scope.md",4059],de714d10:[()=>n.e(4729).then(n.bind(n,7415)),"@site/docs/guides/component-best-practices.md",7415],e19b9990:[()=>Promise.all([n.e(1869),n.e(5394),n.e(7377)]).then(n.bind(n,6817)),"@site/docs/references/programmatic-api.mdx",6817],e74825b7:[()=>n.e(2765).then(n.bind(n,4284)),"@site/docs/references/pseudo-classes.md",4284],e8f63a9c:[()=>n.e(4412).then(n.bind(n,7043)),"@site/docs/getting-started/rollup-integration.md",7043],ebfcd236:[()=>n.e(3746).then(n.bind(n,5450)),"@site/docs/getting-started/get-started.md",5450],ef20d218:[()=>n.e(8065).then(n.bind(n,5417)),"@site/docs/guides/handbook/structure.md",5417],f0dcc6ac:[()=>n.e(7001).then(n.bind(n,6048)),"@site/docs/references/contains.md",6048],f242c874:[()=>n.e(8829).then(n.bind(n,6023)),"@site/docs/references/pseudo-elements.md",6023],f5df1cd5:[()=>n.e(5619).then(n.bind(n,7178)),"@site/docs/references/keyframes.md",7178],f81c1134:[()=>n.e(8130).then(n.t.bind(n,7735,19)),"@generated/docusaurus-plugin-content-blog/default/p/blog-archive-f05.json",7735],fde4315e:[()=>n.e(1480).then(n.bind(n,4147)),"@site/docs/references/custom-selectors.md",4147],fe460ebe:[()=>n.e(420).then(n.bind(n,3988)),"@site/docs/getting-started/tooling/stylable-intelligence.md",3988]};var s=n(4848);function l(e){let{error:t,retry:n,pastDelay:r}=e;return t?(0,s.jsxs)("div",{style:{textAlign:"center",color:"#fff",backgroundColor:"#fa383e",borderColor:"#fa383e",borderStyle:"solid",borderRadius:"0.25rem",borderWidth:"1px",boxSizing:"border-box",display:"block",padding:"1rem",flex:"0 0 50%",marginLeft:"25%",marginRight:"25%",marginTop:"5rem",maxWidth:"50%",width:"100%"},children:[(0,s.jsx)("p",{children:String(t)}),(0,s.jsx)("div",{children:(0,s.jsx)("button",{type:"button",onClick:n,children:"Retry"})})]}):r?(0,s.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"},children:(0,s.jsx)("svg",{id:"loader",style:{width:128,height:110,position:"absolute",top:"calc(100vh - 64%)"},viewBox:"0 0 45 45",xmlns:"http://www.w3.org/2000/svg",stroke:"#61dafb",children:(0,s.jsxs)("g",{fill:"none",fillRule:"evenodd",transform:"translate(1 1)",strokeWidth:"2",children:[(0,s.jsxs)("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0",children:[(0,s.jsx)("animate",{attributeName:"r",begin:"1.5s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),(0,s.jsx)("animate",{attributeName:"stroke-opacity",begin:"1.5s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),(0,s.jsx)("animate",{attributeName:"stroke-width",begin:"1.5s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})]}),(0,s.jsxs)("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0",children:[(0,s.jsx)("animate",{attributeName:"r",begin:"3s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),(0,s.jsx)("animate",{attributeName:"stroke-opacity",begin:"3s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),(0,s.jsx)("animate",{attributeName:"stroke-width",begin:"3s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})]}),(0,s.jsx)("circle",{cx:"22",cy:"22",r:"8",children:(0,s.jsx)("animate",{attributeName:"r",begin:"0s",dur:"1.5s",values:"6;1;2;3;4;5;6",calcMode:"linear",repeatCount:"indefinite"})})]})})}):null}var c=n(6921),u=n(3102);function d(e,t){if("*"===e)return o()({loading:l,loader:()=>n.e(2237).then(n.bind(n,2237)),modules:["@theme/NotFound"],webpack:()=>[2237],render(e,t){const n=e.default;return(0,s.jsx)(u.W,{value:{plugin:{name:"native",id:"default"}},children:(0,s.jsx)(n,{...t})})}});const r=a[`${e}-${t}`],d={},p=[],f=[],g=(0,c.A)(r);return Object.entries(g).forEach((e=>{let[t,n]=e;const r=i[n];r&&(d[t]=r[0],p.push(r[1]),f.push(r[2]))})),o().Map({loading:l,loader:d,modules:p,webpack:()=>f,render(t,n){const o=JSON.parse(JSON.stringify(r));Object.entries(t).forEach((t=>{let[n,r]=t;const a=r.default;if(!a)throw new Error(`The page component at ${e} doesn't have a default export. This makes it impossible to render anything. Consider default-exporting a React component.`);"object"!=typeof a&&"function"!=typeof a||Object.keys(r).filter((e=>"default"!==e)).forEach((e=>{a[e]=r[e]}));let i=o;const s=n.split(".");s.slice(0,-1).forEach((e=>{i=i[e]})),i[s[s.length-1]]=a}));const a=o.__comp;delete o.__comp;const i=o.__context;delete o.__context;const l=o.__props;return delete o.__props,(0,s.jsx)(u.W,{value:i,children:(0,s.jsx)(a,{...o,...l,...n})})}})}const p=[{path:"/blog",component:d("/blog","5c5"),exact:!0},{path:"/blog/archive",component:d("/blog/archive","182"),exact:!0},{path:"/blog/tags",component:d("/blog/tags","287"),exact:!0},{path:"/blog/tags/intro",component:d("/blog/tags/intro","7de"),exact:!0},{path:"/blog/tags/release",component:d("/blog/tags/release","74e"),exact:!0},{path:"/blog/welcome-to-stylable-v5",component:d("/blog/welcome-to-stylable-v5","715"),exact:!0},{path:"/community",component:d("/community","adf"),exact:!0},{path:"/playground",component:d("/playground","859"),exact:!0},{path:"/search",component:d("/search","822"),exact:!0},{path:"/docs",component:d("/docs","72c"),routes:[{path:"/docs",component:d("/docs","9e7"),routes:[{path:"/docs",component:d("/docs","b3f"),routes:[{path:"/docs/attributions",component:d("/docs/attributions","554"),exact:!0},{path:"/docs/getting-started/boilerplate",component:d("/docs/getting-started/boilerplate","1d3"),exact:!0,sidebar:"Discover"},{path:"/docs/getting-started/integrations",component:d("/docs/getting-started/integrations","0e5"),exact:!0,sidebar:"Discover"},{path:"/docs/getting-started/intro",component:d("/docs/getting-started/intro","b87"),exact:!0,sidebar:"Discover"},{path:"/docs/getting-started/manual-integration",component:d("/docs/getting-started/manual-integration","5ef"),exact:!0,sidebar:"Discover"},{path:"/docs/getting-started/nextjs-integration",component:d("/docs/getting-started/nextjs-integration","8c2"),exact:!0,sidebar:"Discover"},{path:"/docs/getting-started/rollup-integration",component:d("/docs/getting-started/rollup-integration","c52"),exact:!0,sidebar:"Discover"},{path:"/docs/getting-started/storybook-integration",component:d("/docs/getting-started/storybook-integration","002"),exact:!0,sidebar:"Discover"},{path:"/docs/getting-started/stylable-config",component:d("/docs/getting-started/stylable-config","4d9"),exact:!0,sidebar:"Discover"},{path:"/docs/getting-started/tooling/cli",component:d("/docs/getting-started/tooling/cli","aa5"),exact:!0,sidebar:"Discover"},{path:"/docs/getting-started/tooling/stylable-intelligence",component:d("/docs/getting-started/tooling/stylable-intelligence","bf3"),exact:!0,sidebar:"Discover"},{path:"/docs/getting-started/typescript-integration",component:d("/docs/getting-started/typescript-integration","c5e"),exact:!0,sidebar:"Discover"},{path:"/docs/getting-started/webpack-integration",component:d("/docs/getting-started/webpack-integration","f5d"),exact:!0,sidebar:"Discover"},{path:"/docs/guides/component-best-practices",component:d("/docs/guides/component-best-practices","ea7"),exact:!0,sidebar:"Guides"},{path:"/docs/guides/component-variants",component:d("/docs/guides/component-variants","90b"),exact:!0,sidebar:"Guides"},{path:"/docs/guides/handbook/class",component:d("/docs/guides/handbook/class","35f"),exact:!0,sidebar:"Guides"},{path:"/docs/guides/handbook/classes",component:d("/docs/guides/handbook/classes","a99"),exact:!0},{path:"/docs/guides/handbook/custom-state",component:d("/docs/guides/handbook/custom-state","1fe"),exact:!0,sidebar:"Guides"},{path:"/docs/guides/handbook/extend",component:d("/docs/guides/handbook/extend","510"),exact:!0,sidebar:"Guides"},{path:"/docs/guides/handbook/import-class",component:d("/docs/guides/handbook/import-class","e56"),exact:!0,sidebar:"Guides"},{path:"/docs/guides/handbook/intro",component:d("/docs/guides/handbook/intro","3a8"),exact:!0,sidebar:"Guides"},{path:"/docs/guides/handbook/namespacing",component:d("/docs/guides/handbook/namespacing","93a"),exact:!0,sidebar:"Guides"},{path:"/docs/guides/handbook/runtime",component:d("/docs/guides/handbook/runtime","4db"),exact:!0,sidebar:"Guides"},{path:"/docs/guides/migration-v3",component:d("/docs/guides/migration-v3","620"),exact:!0,sidebar:"Guides"},{path:"/docs/guides/migration-v5",component:d("/docs/guides/migration-v5","217"),exact:!0,sidebar:"Guides"},{path:"/docs/guides/project-commons",component:d("/docs/guides/project-commons","9bf"),exact:!0,sidebar:"Guides"},{path:"/docs/guides/shared-classes",component:d("/docs/guides/shared-classes","5ec"),exact:!0,sidebar:"Guides"},{path:"/docs/guides/ssr",component:d("/docs/guides/ssr","728"),exact:!0,sidebar:"Guides"},{path:"/docs/references/cheatsheet",component:d("/docs/references/cheatsheet","3be"),exact:!0,sidebar:"Specification Reference"},{path:"/docs/references/class-selectors",component:d("/docs/references/class-selectors","856"),exact:!0,sidebar:"Specification Reference"},{path:"/docs/references/contains",component:d("/docs/references/contains","39b"),exact:!0,sidebar:"Specification Reference"},{path:"/docs/references/css-vars",component:d("/docs/references/css-vars","571"),exact:!0,sidebar:"Specification Reference"},{path:"/docs/references/custom-selectors",component:d("/docs/references/custom-selectors","4f8"),exact:!0,sidebar:"Specification Reference"},{path:"/docs/references/extend-stylesheet",component:d("/docs/references/extend-stylesheet","472"),exact:!0,sidebar:"Specification Reference"},{path:"/docs/references/formatters",component:d("/docs/references/formatters","c0d"),exact:!0,sidebar:"Specification Reference"},{path:"/docs/references/global-selectors",component:d("/docs/references/global-selectors","04c"),exact:!0,sidebar:"Specification Reference"},{path:"/docs/references/imports",component:d("/docs/references/imports","a46"),exact:!0,sidebar:"Specification Reference"},{path:"/docs/references/keyframes",component:d("/docs/references/keyframes","4d3"),exact:!0,sidebar:"Specification Reference"},{path:"/docs/references/layer",component:d("/docs/references/layer","5cb"),exact:!0,sidebar:"Specification Reference"},{path:"/docs/references/mixins",component:d("/docs/references/mixins","9cd"),exact:!0,sidebar:"Specification Reference"},{path:"/docs/references/namespace",component:d("/docs/references/namespace","686"),exact:!0,sidebar:"Specification Reference"},{path:"/docs/references/programmatic-api",component:d("/docs/references/programmatic-api","143"),exact:!0,sidebar:"Specification Reference"},{path:"/docs/references/pseudo-classes",component:d("/docs/references/pseudo-classes","380"),exact:!0,sidebar:"Specification Reference"},{path:"/docs/references/pseudo-elements",component:d("/docs/references/pseudo-elements","cd5"),exact:!0,sidebar:"Specification Reference"},{path:"/docs/references/root",component:d("/docs/references/root","f2e"),exact:!0,sidebar:"Specification Reference"},{path:"/docs/references/runtime",component:d("/docs/references/runtime","a1c"),exact:!0,sidebar:"Specification Reference"},{path:"/docs/references/st-scope",component:d("/docs/references/st-scope","b75"),exact:!0,sidebar:"Specification Reference"},{path:"/docs/references/st-variables",component:d("/docs/references/st-variables","7ce"),exact:!0,sidebar:"Specification Reference"},{path:"/docs/references/type-selectors",component:d("/docs/references/type-selectors","11d"),exact:!0,sidebar:"Specification Reference"},{path:"/docs/references/using-external-assets",component:d("/docs/references/using-external-assets","78d"),exact:!0,sidebar:"Specification Reference"},{path:"/docs/style-guide",component:d("/docs/style-guide","51c"),exact:!0}]}]}]},{path:"/",component:d("/","e5f"),exact:!0},{path:"*",component:d("*")}]},6125:(e,t,n)=>{"use strict";n.d(t,{o:()=>a,x:()=>i});var r=n(6540),o=n(4848);const a=r.createContext(!1);function i(e){let{children:t}=e;const[n,i]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{i(!0)}),[]),(0,o.jsx)(a.Provider,{value:n,children:t})}},7815:(e,t,n)=>{"use strict";var r=n(6540),o=n(5338),a=n(545),i=n(4625),s=n(4784),l=n(8193);const c=[n(7651),n(119),n(6134),n(6294)];var u=n(8328),d=n(6347),p=n(2831),f=n(4848);function g(e){let{children:t}=e;return(0,f.jsx)(f.Fragment,{children:t})}var m=n(5260),h=n(4586),y=n(6025),b=n(6342),v=n(1213),w=n(2131),k=n(4090);var x=n(440),S=n(1463);function _(){const{i18n:{currentLocale:e,defaultLocale:t,localeConfigs:n}}=(0,h.A)(),r=(0,w.o)(),o=n[e].htmlLang,a=e=>e.replace("-","_");return(0,f.jsxs)(m.A,{children:[Object.entries(n).map((e=>{let[t,{htmlLang:n}]=e;return(0,f.jsx)("link",{rel:"alternate",href:r.createUrl({locale:t,fullyQualified:!0}),hrefLang:n},t)})),(0,f.jsx)("link",{rel:"alternate",href:r.createUrl({locale:t,fullyQualified:!0}),hrefLang:"x-default"}),(0,f.jsx)("meta",{property:"og:locale",content:a(o)}),Object.values(n).filter((e=>o!==e.htmlLang)).map((e=>(0,f.jsx)("meta",{property:"og:locale:alternate",content:a(e.htmlLang)},`meta-og-${e.htmlLang}`)))]})}function E(e){let{permalink:t}=e;const{siteConfig:{url:n}}=(0,h.A)(),r=function(){const{siteConfig:{url:e,baseUrl:t,trailingSlash:n}}=(0,h.A)(),{pathname:r}=(0,d.zy)();return e+(0,x.Ks)((0,y.Ay)(r),{trailingSlash:n,baseUrl:t})}(),o=t?`${n}${t}`:r;return(0,f.jsxs)(m.A,{children:[(0,f.jsx)("meta",{property:"og:url",content:o}),(0,f.jsx)("link",{rel:"canonical",href:o})]})}function C(){const{i18n:{currentLocale:e}}=(0,h.A)(),{metadata:t,image:n}=(0,b.p)();return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(m.A,{children:[(0,f.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,f.jsx)("body",{className:k.w})]}),n&&(0,f.jsx)(v.be,{image:n}),(0,f.jsx)(E,{}),(0,f.jsx)(_,{}),(0,f.jsx)(S.A,{tag:"default",locale:e}),(0,f.jsx)(m.A,{children:t.map(((e,t)=>(0,f.jsx)("meta",{...e},t)))})]})}const A=new Map;var T=n(6125),j=n(6988),R=n(205);function P(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r\n {const r=t.default?.[e]??t[e];return r?.(...n)}));return()=>o.forEach((e=>e?.()))}const L=function(e){let{children:t,location:n,previousLocation:r}=e;return(0,R.A)((()=>{r!==n&&(!function(e){let{location:t,previousLocation:n}=e;if(!n)return;const r=t.pathname===n.pathname,o=t.hash===n.hash,a=t.search===n.search;if(r&&o&&!a)return;const{hash:i}=t;if(i){const e=decodeURIComponent(i.substring(1)),t=document.getElementById(e);t?.scrollIntoView()}else window.scrollTo(0,0)}({location:n,previousLocation:r}),P("onRouteDidUpdate",{previousLocation:r,location:n}))}),[r,n]),t};function N(e){const t=Array.from(new Set([e,decodeURI(e)])).map((e=>(0,p.u)(u.A,e))).flat();return Promise.all(t.map((e=>e.route.component.preload?.())))}class O extends r.Component{previousLocation;routeUpdateCleanupCb;constructor(e){super(e),this.previousLocation=null,this.routeUpdateCleanupCb=l.A.canUseDOM?P("onRouteUpdate",{previousLocation:null,location:this.props.location}):()=>{},this.state={nextRouteHasLoaded:!0}}shouldComponentUpdate(e,t){if(e.location===this.props.location)return t.nextRouteHasLoaded;const n=e.location;return this.previousLocation=this.props.location,this.setState({nextRouteHasLoaded:!1}),this.routeUpdateCleanupCb=P("onRouteUpdate",{previousLocation:this.previousLocation,location:n}),N(n.pathname).then((()=>{this.routeUpdateCleanupCb(),this.setState({nextRouteHasLoaded:!0})})).catch((e=>{console.warn(e),window.location.reload()})),!1}render(){const{children:e,location:t}=this.props;return(0,f.jsx)(L,{previousLocation:this.previousLocation,location:t,children:(0,f.jsx)(d.qh,{location:t,render:()=>e})})}}const D=O,I="__docusaurus-base-url-issue-banner-suggestion-container";function M(e){return`\ndocument.addEventListener('DOMContentLoaded', function maybeInsertBanner() {\n var shouldInsert = typeof window['docusaurus'] === 'undefined';\n shouldInsert && insertBanner();\n});\n\nfunction insertBanner() {\n var bannerContainer = document.createElement('div');\n bannerContainer.id = '__docusaurus-base-url-issue-banner-container';\n var bannerHtml = ${JSON.stringify(function(e){return`\n \n`}(e)).replace(/{let{route:t}=e;return!0===t.exact})))return A.set(e.pathname,e.pathname),e;const t=e.pathname.trim().replace(/(?:\/index)?\.html$/,"")||"/";return A.set(e.pathname,t),{...e,pathname:t}}((0,d.zy)());return(0,f.jsx)(D,{location:e,children:G})}function V(){return(0,f.jsx)($.A,{children:(0,f.jsx)(j.l,{children:(0,f.jsxs)(T.x,{children:[(0,f.jsxs)(g,{children:[(0,f.jsx)(B,{}),(0,f.jsx)(C,{}),(0,f.jsx)(z,{}),(0,f.jsx)(H,{})]}),(0,f.jsx)(q,{})]})})})}var W=n(4054);const K=function(e){try{return document.createElement("link").relList.supports(e)}catch{return!1}}("prefetch")?function(e){return new Promise(((t,n)=>{if("undefined"==typeof document)return void n();const r=document.createElement("link");r.setAttribute("rel","prefetch"),r.setAttribute("href",e),r.onload=()=>t(),r.onerror=()=>n();const o=document.getElementsByTagName("head")[0]??document.getElementsByName("script")[0]?.parentNode;o?.appendChild(r)}))}:function(e){return new Promise(((t,n)=>{const r=new XMLHttpRequest;r.open("GET",e,!0),r.withCredentials=!0,r.onload=()=>{200===r.status?t():n()},r.send(null)}))};var Q=n(6921);const Y=new Set,Z=new Set,X=()=>navigator.connection?.effectiveType.includes("2g")||navigator.connection?.saveData,J={prefetch:e=>{if(!(e=>!X()&&!Z.has(e)&&!Y.has(e))(e))return!1;Y.add(e);const t=(0,p.u)(u.A,e).flatMap((e=>{return t=e.route.path,Object.entries(W).filter((e=>{let[n]=e;return n.replace(/-[^-]+$/,"")===t})).flatMap((e=>{let[,t]=e;return Object.values((0,Q.A)(t))}));var t}));return Promise.all(t.map((e=>{const t=n.gca(e);return t&&!t.includes("undefined")?K(t).catch((()=>{})):Promise.resolve()})))},preload:e=>!!(e=>!X()&&!Z.has(e))(e)&&(Z.add(e),N(e))},ee=Object.freeze(J);function te(e){let{children:t}=e;return"hash"===s.default.future.experimental_router?(0,f.jsx)(i.I9,{children:t}):(0,f.jsx)(i.Kd,{children:t})}const ne=Boolean(!0);if(l.A.canUseDOM){window.docusaurus=ee;const e=document.getElementById("__docusaurus"),t=(0,f.jsx)(a.vd,{children:(0,f.jsx)(te,{children:(0,f.jsx)(V,{})})}),n=(e,t)=>{console.error("Docusaurus React Root onRecoverableError:",e,t)},i=()=>{if(window.docusaurusRoot)window.docusaurusRoot.render(t);else if(ne)window.docusaurusRoot=o.hydrateRoot(e,t,{onRecoverableError:n});else{const r=o.createRoot(e,{onRecoverableError:n});r.render(t),window.docusaurusRoot=r}};N(window.location.pathname).then((()=>{(0,r.startTransition)(i)}))}},6988:(e,t,n)=>{"use strict";n.d(t,{o:()=>d,l:()=>p});var r=n(6540),o=n(4784);const a=JSON.parse('{"docusaurus-plugin-content-docs":{"default":{"path":"/docs","versions":[{"name":"current","label":"Next","isLast":true,"path":"/docs","mainDocId":"getting-started/intro","docs":[{"id":"attributions","path":"/docs/attributions"},{"id":"getting-started/boilerplate","path":"/docs/getting-started/boilerplate","sidebar":"Discover"},{"id":"getting-started/intro","path":"/docs/getting-started/intro","sidebar":"Discover"},{"id":"getting-started/manual-integration","path":"/docs/getting-started/manual-integration","sidebar":"Discover"},{"id":"getting-started/nextjs-integration","path":"/docs/getting-started/nextjs-integration","sidebar":"Discover"},{"id":"getting-started/rollup-integration","path":"/docs/getting-started/rollup-integration","sidebar":"Discover"},{"id":"getting-started/storybook-integration","path":"/docs/getting-started/storybook-integration","sidebar":"Discover"},{"id":"getting-started/stylable-config","path":"/docs/getting-started/stylable-config","sidebar":"Discover"},{"id":"getting-started/tooling/cli","path":"/docs/getting-started/tooling/cli","sidebar":"Discover"},{"id":"getting-started/tooling/stylable-intelligence","path":"/docs/getting-started/tooling/stylable-intelligence","sidebar":"Discover"},{"id":"getting-started/typescript-integration","path":"/docs/getting-started/typescript-integration","sidebar":"Discover"},{"id":"getting-started/webpack-integration","path":"/docs/getting-started/webpack-integration","sidebar":"Discover"},{"id":"guides/component-best-practices","path":"/docs/guides/component-best-practices","sidebar":"Guides"},{"id":"guides/component-variants","path":"/docs/guides/component-variants","sidebar":"Guides"},{"id":"guides/handbook/class","path":"/docs/guides/handbook/class","sidebar":"Guides"},{"id":"guides/handbook/classes","path":"/docs/guides/handbook/classes"},{"id":"guides/handbook/custom-state","path":"/docs/guides/handbook/custom-state","sidebar":"Guides"},{"id":"guides/handbook/extend","path":"/docs/guides/handbook/extend","sidebar":"Guides"},{"id":"guides/handbook/import-class","path":"/docs/guides/handbook/import-class","sidebar":"Guides"},{"id":"guides/handbook/intro","path":"/docs/guides/handbook/intro","sidebar":"Guides"},{"id":"guides/handbook/namespacing","path":"/docs/guides/handbook/namespacing","sidebar":"Guides"},{"id":"guides/handbook/runtime","path":"/docs/guides/handbook/runtime","sidebar":"Guides"},{"id":"guides/migration-v3","path":"/docs/guides/migration-v3","sidebar":"Guides"},{"id":"guides/migration-v5","path":"/docs/guides/migration-v5","sidebar":"Guides"},{"id":"guides/project-commons","path":"/docs/guides/project-commons","sidebar":"Guides"},{"id":"guides/shared-classes","path":"/docs/guides/shared-classes","sidebar":"Guides"},{"id":"guides/ssr","path":"/docs/guides/ssr","sidebar":"Guides"},{"id":"references/cheatsheet","path":"/docs/references/cheatsheet","sidebar":"Specification Reference"},{"id":"references/class-selectors","path":"/docs/references/class-selectors","sidebar":"Specification Reference"},{"id":"references/contains","path":"/docs/references/contains","sidebar":"Specification Reference"},{"id":"references/css-vars","path":"/docs/references/css-vars","sidebar":"Specification Reference"},{"id":"references/custom-selectors","path":"/docs/references/custom-selectors","sidebar":"Specification Reference"},{"id":"references/extend-stylesheet","path":"/docs/references/extend-stylesheet","sidebar":"Specification Reference"},{"id":"references/formatters","path":"/docs/references/formatters","sidebar":"Specification Reference"},{"id":"references/global-selectors","path":"/docs/references/global-selectors","sidebar":"Specification Reference"},{"id":"references/imports","path":"/docs/references/imports","sidebar":"Specification Reference"},{"id":"references/keyframes","path":"/docs/references/keyframes","sidebar":"Specification Reference"},{"id":"references/layer","path":"/docs/references/layer","sidebar":"Specification Reference"},{"id":"references/mixins","path":"/docs/references/mixins","sidebar":"Specification Reference"},{"id":"references/namespace","path":"/docs/references/namespace","sidebar":"Specification Reference"},{"id":"references/programmatic-api","path":"/docs/references/programmatic-api","sidebar":"Specification Reference"},{"id":"references/pseudo-classes","path":"/docs/references/pseudo-classes","sidebar":"Specification Reference"},{"id":"references/pseudo-elements","path":"/docs/references/pseudo-elements","sidebar":"Specification Reference"},{"id":"references/root","path":"/docs/references/root","sidebar":"Specification Reference"},{"id":"references/runtime","path":"/docs/references/runtime","sidebar":"Specification Reference"},{"id":"references/st-scope","path":"/docs/references/st-scope","sidebar":"Specification Reference"},{"id":"references/st-variables","path":"/docs/references/st-variables","sidebar":"Specification Reference"},{"id":"references/type-selectors","path":"/docs/references/type-selectors","sidebar":"Specification Reference"},{"id":"references/using-external-assets","path":"/docs/references/using-external-assets","sidebar":"Specification Reference"},{"id":"style-guide","path":"/docs/style-guide"},{"id":"/getting-started/integrations","path":"/docs/getting-started/integrations","sidebar":"Discover"}],"draftIds":[],"sidebars":{"Discover":{"link":{"path":"/docs/getting-started/intro","label":"getting-started/intro"}},"Guides":{"link":{"path":"/docs/guides/handbook/intro","label":"guides/handbook/intro"}},"Specification Reference":{"link":{"path":"/docs/references/cheatsheet","label":"references/cheatsheet"}}}}],"breadcrumbs":true}}}'),i=JSON.parse('{"defaultLocale":"en","locales":["en"],"path":"i18n","currentLocale":"en","localeConfigs":{"en":{"label":"English","direction":"ltr","htmlLang":"en","calendar":"gregory","path":"en"}}}');var s=n(2654);const l=JSON.parse('{"docusaurusVersion":"3.7.0","siteVersion":"0.0.1","pluginVersions":{"docusaurus-plugin-content-docs":{"type":"package","name":"@docusaurus/plugin-content-docs","version":"3.7.0"},"docusaurus-plugin-content-blog":{"type":"package","name":"@docusaurus/plugin-content-blog","version":"3.7.0"},"docusaurus-plugin-content-pages":{"type":"package","name":"@docusaurus/plugin-content-pages","version":"3.7.0"},"docusaurus-plugin-google-analytics":{"type":"package","name":"@docusaurus/plugin-google-analytics","version":"3.7.0"},"docusaurus-plugin-sitemap":{"type":"package","name":"@docusaurus/plugin-sitemap","version":"3.7.0"},"docusaurus-plugin-svgr":{"type":"package","name":"@docusaurus/plugin-svgr","version":"3.7.0"},"docusaurus-theme-classic":{"type":"package","name":"@docusaurus/theme-classic","version":"3.7.0"},"@easyops-cn/docusaurus-search-local":{"type":"package","name":"@easyops-cn/docusaurus-search-local","version":"0.47.0"},"stylable-docusaurus-plugin":{"type":"project"}}}');var c=n(4848);const u={siteConfig:o.default,siteMetadata:l,globalData:a,i18n:i,codeTranslations:s},d=r.createContext(u);function p(e){let{children:t}=e;return(0,c.jsx)(d.Provider,{value:u,children:t})}},7489:(e,t,n)=>{"use strict";n.d(t,{A:()=>m});var r=n(6540),o=n(8193),a=n(5260),i=n(440),s=n(7823),l=n(3102),c=n(4848);function u(e){let{error:t,tryAgain:n}=e;return(0,c.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",minHeight:"100vh",width:"100%",maxWidth:"80ch",fontSize:"20px",margin:"0 auto",padding:"1rem"},children:[(0,c.jsx)("h1",{style:{fontSize:"3rem"},children:"This page crashed"}),(0,c.jsx)("button",{type:"button",onClick:n,style:{margin:"1rem 0",fontSize:"2rem",cursor:"pointer",borderRadius:20,padding:"1rem"},children:"Try again"}),(0,c.jsx)(d,{error:t})]})}function d(e){let{error:t}=e;const n=(0,i.rA)(t).map((e=>e.message)).join("\n\nCause:\n");return(0,c.jsx)("p",{style:{whiteSpace:"pre-wrap"},children:n})}function p(e){let{children:t}=e;return(0,c.jsx)(l.W,{value:{plugin:{name:"docusaurus-core-error-boundary",id:"default"}},children:t})}function f(e){let{error:t,tryAgain:n}=e;return(0,c.jsx)(p,{children:(0,c.jsxs)(m,{fallback:()=>(0,c.jsx)(u,{error:t,tryAgain:n}),children:[(0,c.jsx)(a.A,{children:(0,c.jsx)("title",{children:"Page Error"})}),(0,c.jsx)(s.A,{children:(0,c.jsx)(u,{error:t,tryAgain:n})})]})})}const g=e=>(0,c.jsx)(f,{...e});class m extends r.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){o.A.canUseDOM&&this.setState({error:e})}render(){const{children:e}=this.props,{error:t}=this.state;if(t){const e={error:t,tryAgain:()=>this.setState({error:null})};return(this.props.fallback??g)(e)}return e??null}}},8193:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});const r="undefined"!=typeof window&&"document"in window&&"createElement"in window.document,o={canUseDOM:r,canUseEventListeners:r&&("addEventListener"in window||"attachEvent"in window),canUseIntersectionObserver:r&&"IntersectionObserver"in window,canUseViewport:r&&"screen"in window}},5260:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});n(6540);var r=n(545),o=n(4848);function a(e){return(0,o.jsx)(r.mg,{...e})}},8774:(e,t,n)=>{"use strict";n.d(t,{A:()=>f});var r=n(6540),o=n(4625),a=n(440),i=n(4586),s=n(6654),l=n(8193),c=n(3427),u=n(6025),d=n(4848);function p(e,t){let{isNavLink:n,to:p,href:f,activeClassName:g,isActive:m,"data-noBrokenLinkCheck":h,autoAddBaseUrl:y=!0,...b}=e;const{siteConfig:v}=(0,i.A)(),{trailingSlash:w,baseUrl:k}=v,x=v.future.experimental_router,{withBaseUrl:S}=(0,u.hH)(),_=(0,c.A)(),E=(0,r.useRef)(null);(0,r.useImperativeHandle)(t,(()=>E.current));const C=p||f;const A=(0,s.A)(C),T=C?.replace("pathname://","");let j=void 0!==T?(R=T,y&&(e=>e.startsWith("/"))(R)?S(R):R):void 0;var R;"hash"===x&&j?.startsWith("./")&&(j=j?.slice(1)),j&&A&&(j=(0,a.Ks)(j,{trailingSlash:w,baseUrl:k}));const P=(0,r.useRef)(!1),L=n?o.k2:o.N_,N=l.A.canUseIntersectionObserver,O=(0,r.useRef)(),D=()=>{P.current||null==j||(window.docusaurus.preload(j),P.current=!0)};(0,r.useEffect)((()=>(!N&&A&&l.A.canUseDOM&&null!=j&&window.docusaurus.prefetch(j),()=>{N&&O.current&&O.current.disconnect()})),[O,j,N,A]);const I=j?.startsWith("#")??!1,M=!b.target||"_self"===b.target,F=!j||!A||!M||I&&"hash"!==x;h||!I&&F||_.collectLink(j),b.id&&_.collectAnchor(b.id);const z={};return F?(0,d.jsx)("a",{ref:E,href:j,...C&&!A&&{target:"_blank",rel:"noopener noreferrer"},...b,...z}):(0,d.jsx)(L,{...b,onMouseEnter:D,onTouchStart:D,innerRef:e=>{E.current=e,N&&e&&A&&(O.current=new window.IntersectionObserver((t=>{t.forEach((t=>{e===t.target&&(t.isIntersecting||t.intersectionRatio>0)&&(O.current.unobserve(e),O.current.disconnect(),null!=j&&window.docusaurus.prefetch(j))}))})),O.current.observe(e))},to:j,...n&&{isActive:m,activeClassName:g},...z})}const f=r.forwardRef(p)},1312:(e,t,n)=>{"use strict";n.d(t,{A:()=>c,T:()=>l});var r=n(6540),o=n(4848);function a(e,t){const n=e.split(/(\{\w+\})/).map(((e,n)=>{if(n%2==1){const n=t?.[e.slice(1,-1)];if(void 0!==n)return n}return e}));return n.some((e=>(0,r.isValidElement)(e)))?n.map(((e,t)=>(0,r.isValidElement)(e)?r.cloneElement(e,{key:t}):e)).filter((e=>""!==e)):n.join("")}var i=n(2654);function s(e){let{id:t,message:n}=e;if(void 0===t&&void 0===n)throw new Error("Docusaurus translation declarations must have at least a translation id or a default translation message");return i[t??n]??n??t}function l(e,t){let{message:n,id:r}=e;return a(s({message:n,id:r}),t)}function c(e){let{children:t,id:n,values:r}=e;if(t&&"string"!=typeof t)throw console.warn("Illegalchildren",t),new Error("The Docusaurus component only accept simple string values");const i=s({message:t,id:n});return(0,o.jsx)(o.Fragment,{children:a(i,r)})}},7065:(e,t,n)=>{"use strict";n.d(t,{W:()=>r});const r="default"},6654:(e,t,n)=>{"use strict";function r(e){return/^(?:\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!r(e)}n.d(t,{A:()=>o,z:()=>r})},6025:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>s,hH:()=>i});var r=n(6540),o=n(4586),a=n(6654);function i(){const{siteConfig:e}=(0,o.A)(),{baseUrl:t,url:n}=e,i=e.future.experimental_router,s=(0,r.useCallback)(((e,r)=>function(e){let{siteUrl:t,baseUrl:n,url:r,options:{forcePrependBaseUrl:o=!1,absolute:i=!1}={},router:s}=e;if(!r||r.startsWith("#")||(0,a.z)(r))return r;if("hash"===s)return r.startsWith("/")?`.${r}`:`./${r}`;if(o)return n+r.replace(/^\//,"");if(r===n.replace(/\/$/,""))return n;const l=r.startsWith(n)?r:n+r.replace(/^\//,"");return i?t+l:l}({siteUrl:n,baseUrl:t,url:e,options:r,router:i})),[n,t,i]);return{withBaseUrl:s}}function s(e,t){void 0===t&&(t={});const{withBaseUrl:n}=i();return n(e,t)}},3427:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(6540);n(4848);const o=r.createContext({collectAnchor:()=>{},collectLink:()=>{}}),a=()=>(0,r.useContext)(o);function i(){return a()}},4586:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(6540),o=n(6988);function a(){return(0,r.useContext)(o.o)}},2303:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(6540),o=n(6125);function a(){return(0,r.useContext)(o.o)}},205:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(6540);const o=n(8193).A.canUseDOM?r.useLayoutEffect:r.useEffect},6803:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(6540),o=n(3102);function a(){const e=r.useContext(o.o);if(!e)throw new Error("Unexpected: no Docusaurus route context found");return e}},6921:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});const r=e=>"object"==typeof e&&!!e&&Object.keys(e).length>0;function o(e){const t={};return function e(n,o){Object.entries(n).forEach((n=>{let[a,i]=n;const s=o?`${o}.${a}`:a;r(i)?e(i,s):t[s]=i}))}(e),t}},3102:(e,t,n)=>{"use strict";n.d(t,{W:()=>i,o:()=>a});var r=n(6540),o=n(4848);const a=r.createContext(null);function i(e){let{children:t,value:n}=e;const i=r.useContext(a),s=(0,r.useMemo)((()=>function(e){let{parent:t,value:n}=e;if(!t){if(!n)throw new Error("Unexpected: no Docusaurus route context found");if(!("plugin"in n))throw new Error("Unexpected: Docusaurus topmost route context has no `plugin` attribute");return n}const r={...t.data,...n?.data};return{plugin:t.plugin,data:r}}({parent:i,value:n})),[i,n]);return(0,o.jsx)(a.Provider,{value:s,children:t})}},3886:(e,t,n)=>{"use strict";n.d(t,{VQ:()=>h,XK:()=>v,g1:()=>b});var r=n(6540),o=n(4070),a=n(7065),i=n(6342),s=n(679),l=n(9532),c=n(4848);const u=e=>`docs-preferred-version-${e}`,d={save:(e,t,n)=>{(0,s.Wf)(u(e),{persistence:t}).set(n)},read:(e,t)=>(0,s.Wf)(u(e),{persistence:t}).get(),clear:(e,t)=>{(0,s.Wf)(u(e),{persistence:t}).del()}},p=e=>Object.fromEntries(e.map((e=>[e,{preferredVersionName:null}])));const f=r.createContext(null);function g(){const e=(0,o.Gy)(),t=(0,i.p)().docs.versionPersistence,n=(0,r.useMemo)((()=>Object.keys(e)),[e]),[a,s]=(0,r.useState)((()=>p(n)));(0,r.useEffect)((()=>{s(function(e){let{pluginIds:t,versionPersistence:n,allDocsData:r}=e;function o(e){const t=d.read(e,n);return r[e].versions.some((e=>e.name===t))?{preferredVersionName:t}:(d.clear(e,n),{preferredVersionName:null})}return Object.fromEntries(t.map((e=>[e,o(e)])))}({allDocsData:e,versionPersistence:t,pluginIds:n}))}),[e,t,n]);return[a,(0,r.useMemo)((()=>({savePreferredVersion:function(e,n){d.save(e,t,n),s((t=>({...t,[e]:{preferredVersionName:n}})))}})),[t])]}function m(e){let{children:t}=e;const n=g();return(0,c.jsx)(f.Provider,{value:n,children:t})}function h(e){let{children:t}=e;return(0,c.jsx)(m,{children:t})}function y(){const e=(0,r.useContext)(f);if(!e)throw new l.dV("DocsPreferredVersionContextProvider");return e}function b(e){void 0===e&&(e=a.W);const t=(0,o.ht)(e),[n,i]=y(),{preferredVersionName:s}=n[e];return{preferredVersion:t.versions.find((e=>e.name===s))??null,savePreferredVersionName:(0,r.useCallback)((t=>{i.savePreferredVersion(e,t)}),[i,e])}}function v(){const e=(0,o.Gy)(),[t]=y();function n(n){const r=e[n],{preferredVersionName:o}=t[n];return r.versions.find((e=>e.name===o))??null}const r=Object.keys(e);return Object.fromEntries(r.map((e=>[e,n(e)])))}},2565:(e,t,n)=>{"use strict";n.d(t,{k:()=>a,v:()=>i});var r=n(4070),o=n(3886);function a(e,t){return`docs-${e}-${t}`}function i(){const e=(0,r.Gy)(),t=(0,r.gk)(),n=(0,o.XK)();return[...Object.keys(e).map((function(r){const o=t?.activePlugin.pluginId===r?t.activeVersion:void 0,i=n[r],s=e[r].versions.find((e=>e.isLast));return a(r,(o??i??s).name)}))]}},609:(e,t,n)=>{"use strict";n.d(t,{V:()=>l,t:()=>c});var r=n(6540),o=n(9532),a=n(4848);const i=Symbol("EmptyContext"),s=r.createContext(i);function l(e){let{children:t,name:n,items:o}=e;const i=(0,r.useMemo)((()=>n&&o?{name:n,items:o}:null),[n,o]);return(0,a.jsx)(s.Provider,{value:i,children:t})}function c(){const e=(0,r.useContext)(s);if(e===i)throw new o.dV("DocsSidebarProvider");return e}},6972:(e,t,n)=>{"use strict";n.d(t,{$S:()=>g,B5:()=>E,Nr:()=>f,OF:()=>k,QB:()=>_,Vd:()=>x,Y:()=>v,cC:()=>p,d1:()=>C,fW:()=>S,w8:()=>y});var r=n(6540),o=n(6347),a=n(2831),i=n(4070),s=n(9169),l=n(1682),c=n(3886),u=n(3025),d=n(609);function p(e){const t=(0,u.r)();if(!e)return;const n=t.docs[e];if(!n)throw new Error(`no version doc found by id=${e}`);return n}function f(e){return"link"!==e.type||e.unlisted?"category"===e.type?function(e){if(e.href&&!e.linkUnlisted)return e.href;for(const t of e.items){const e=f(t);if(e)return e}}(e):void 0:e.href}function g(){const{pathname:e}=(0,o.zy)(),t=(0,d.t)();if(!t)throw new Error("Unexpected: cant find current sidebar in context");const n=w({sidebarItems:t.items,pathname:e,onlyCategories:!0}).slice(-1)[0];if(!n)throw new Error(`${e} is not associated with a category. useCurrentSidebarCategory() should only be used on category index pages.`);return n}const m=(e,t)=>void 0!==e&&(0,s.ys)(e,t),h=(e,t)=>e.some((e=>y(e,t)));function y(e,t){return"link"===e.type?m(e.href,t):"category"===e.type&&(m(e.href,t)||h(e.items,t))}function b(e,t){switch(e.type){case"category":return y(e,t)||void 0!==e.href&&!e.linkUnlisted||e.items.some((e=>b(e,t)));case"link":return!e.unlisted||y(e,t);default:return!0}}function v(e,t){return(0,r.useMemo)((()=>e.filter((e=>b(e,t)))),[e,t])}function w(e){let{sidebarItems:t,pathname:n,onlyCategories:r=!1}=e;const o=[];return function e(t){for(const a of t)if("category"===a.type&&((0,s.ys)(a.href,n)||e(a.items))||"link"===a.type&&(0,s.ys)(a.href,n)){return r&&"category"!==a.type||o.unshift(a),!0}return!1}(t),o}function k(){const e=(0,d.t)(),{pathname:t}=(0,o.zy)(),n=(0,i.vT)()?.pluginData.breadcrumbs;return!1!==n&&e?w({sidebarItems:e.items,pathname:t}):null}function x(e){const{activeVersion:t}=(0,i.zK)(e),{preferredVersion:n}=(0,c.g1)(e),o=(0,i.r7)(e);return(0,r.useMemo)((()=>(0,l.sb)([t,n,o].filter(Boolean))),[t,n,o])}function S(e,t){const n=x(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.sidebars?Object.entries(e.sidebars):[])),r=t.find((t=>t[0]===e));if(!r)throw new Error(`Can't find any sidebar with id "${e}" in version${n.length>1?"s":""} ${n.map((e=>e.name)).join(", ")}".\nAvailable sidebar ids are:\n- ${t.map((e=>e[0])).join("\n- ")}`);return r[1]}),[e,n])}function _(e,t){const n=x(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.docs)),r=t.find((t=>t.id===e));if(!r){if(n.flatMap((e=>e.draftIds)).includes(e))return null;throw new Error(`Couldn't find any doc with id "${e}" in version${n.length>1?"s":""} "${n.map((e=>e.name)).join(", ")}".\nAvailable doc ids are:\n- ${(0,l.sb)(t.map((e=>e.id))).join("\n- ")}`)}return r}),[e,n])}function E(e){let{route:t}=e;const n=(0,o.zy)(),r=(0,u.r)(),i=t.routes,s=i.find((e=>(0,o.B6)(n.pathname,e)));if(!s)return null;const l=s.sidebar,c=l?r.docsSidebars[l]:void 0;return{docElement:(0,a.v)(i),sidebarName:l,sidebarItems:c}}function C(e){return e.filter((e=>!("category"===e.type||"link"===e.type)||!!f(e)))}},3025:(e,t,n)=>{"use strict";n.d(t,{n:()=>s,r:()=>l});var r=n(6540),o=n(9532),a=n(4848);const i=r.createContext(null);function s(e){let{children:t,version:n}=e;return(0,a.jsx)(i.Provider,{value:n,children:t})}function l(){const e=(0,r.useContext)(i);if(null===e)throw new o.dV("DocsVersionProvider");return e}},4070:(e,t,n)=>{"use strict";n.d(t,{d1:()=>u.d1,zK:()=>w,vT:()=>h,gk:()=>y,Gy:()=>g,$S:()=>u.$S,HW:()=>k,vF:()=>p.v,ht:()=>m,g1:()=>d.g1,r7:()=>v,jh:()=>b});var r=n(6347),o=n(4586),a=n(7065);function i(e,t){void 0===t&&(t={});const n=function(){const{globalData:e}=(0,o.A)();return e}()[e];if(!n&&t.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin.`);return n}const s=e=>e.versions.find((e=>e.isLast));function l(e,t){return[...e.versions].sort(((e,t)=>e.path===t.path?0:e.path.includes(t.path)?-1:t.path.includes(e.path)?1:0)).find((e=>!!(0,r.B6)(t,{path:e.path,exact:!1,strict:!1})))}function c(e,t){const n=l(e,t),o=n?.docs.find((e=>!!(0,r.B6)(t,{path:e.path,exact:!0,strict:!1})));return{activeVersion:n,activeDoc:o,alternateDocVersions:o?function(t){const n={};return e.versions.forEach((e=>{e.docs.forEach((r=>{r.id===t&&(n[e.name]=r)}))})),n}(o.id):{}}}var u=n(6972),d=n(3886),p=n(2565);const f={},g=()=>i("docusaurus-plugin-content-docs")??f,m=e=>{try{return function(e,t,n){void 0===t&&(t=a.W),void 0===n&&(n={});const r=i(e),o=r?.[t];if(!o&&n.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin with id "${t}".`);return o}("docusaurus-plugin-content-docs",e,{failfast:!0})}catch(t){throw new Error("You are using a feature of the Docusaurus docs plugin, but this plugin does not seem to be enabled"+("Default"===e?"":` (pluginId=${e}`),{cause:t})}};function h(e){void 0===e&&(e={});const t=g(),{pathname:n}=(0,r.zy)();return function(e,t,n){void 0===n&&(n={});const o=Object.entries(e).sort(((e,t)=>t[1].path.localeCompare(e[1].path))).find((e=>{let[,n]=e;return!!(0,r.B6)(t,{path:n.path,exact:!1,strict:!1})})),a=o?{pluginId:o[0],pluginData:o[1]}:void 0;if(!a&&n.failfast)throw new Error(`Can't find active docs plugin for "${t}" pathname, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: ${Object.values(e).map((e=>e.path)).join(", ")}`);return a}(t,n,e)}function y(e){void 0===e&&(e={});const t=h(e),{pathname:n}=(0,r.zy)();if(!t)return;return{activePlugin:t,activeVersion:l(t.pluginData,n)}}function b(e){return m(e).versions}function v(e){const t=m(e);return s(t)}function w(e){const t=m(e),{pathname:n}=(0,r.zy)();return c(t,n)}function k(e){const t=m(e),{pathname:n}=(0,r.zy)();return function(e,t){const n=s(e);return{latestDocSuggestion:c(e,t).alternateDocVersions[n.name],latestVersionSuggestion:n}}(t,n)}},7651:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={onRouteDidUpdate(e){let{location:t,previousLocation:n}=e;!n||t.pathname===n.pathname&&t.search===n.search&&t.hash===n.hash||(window.ga("set","page",t.pathname+t.search+t.hash),window.ga("send","pageview"))}}},6294:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>a});var r=n(5947),o=n.n(r);o().configure({showSpinner:!1});const a={onRouteUpdate(e){let{location:t,previousLocation:n}=e;if(n&&t.pathname!==n.pathname){const e=window.setTimeout((()=>{o().start()}),200);return()=>window.clearTimeout(e)}},onRouteDidUpdate(){o().done()}}},6134:(e,t,n)=>{"use strict";var r=n(1765),o=n(4784);!function(e){const{themeConfig:{prism:t}}=o.default,{additionalLanguages:r}=t,a=globalThis.Prism;globalThis.Prism=e,r.forEach((e=>{"php"===e&&n(9700),n(8692)(`./prism-${e}`)})),delete globalThis.Prism,void 0!==a&&(globalThis.Prism=e)}(r.My)},1107:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});n(6540);var r=n(4164),o=n(1312),a=n(6342),i=n(8774),s=n(3427);const l={anchorWithStickyNavbar:"anchorWithStickyNavbar_LWe7",anchorWithHideOnScrollNavbar:"anchorWithHideOnScrollNavbar_WYt5"};var c=n(4848);function u(e){let{as:t,id:n,...u}=e;const d=(0,s.A)(),{navbar:{hideOnScroll:p}}=(0,a.p)();if("h1"===t||!n)return(0,c.jsx)(t,{...u,id:void 0});d.collectAnchor(n);const f=(0,o.T)({id:"theme.common.headingLinkTitle",message:"Direct link to {heading}",description:"Title for link to heading"},{heading:"string"==typeof u.children?u.children:n});return(0,c.jsxs)(t,{...u,className:(0,r.A)("anchor",p?l.anchorWithHideOnScrollNavbar:l.anchorWithStickyNavbar,u.className),id:n,children:[u.children,(0,c.jsx)(i.A,{className:"hash-link",to:`#${n}`,"aria-label":f,title:f,children:"\u200b"})]})}},3186:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});n(6540);const r={iconExternalLink:"iconExternalLink_nPIU"};var o=n(4848);function a(e){let{width:t=13.5,height:n=13.5}=e;return(0,o.jsx)("svg",{width:t,height:n,"aria-hidden":"true",viewBox:"0 0 24 24",className:r.iconExternalLink,children:(0,o.jsx)("path",{fill:"currentColor",d:"M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"})})}},7823:(e,t,n)=>{"use strict";n.d(t,{A:()=>Xt});var r=n(6540),o=n(4164),a=n(7489),i=n(1213),s=n(6347),l=n(1312),c=n(5062),u=n(4848);const d="__docusaurus_skipToContent_fallback";function p(e){e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")}function f(){const e=(0,r.useRef)(null),{action:t}=(0,s.W6)(),n=(0,r.useCallback)((e=>{e.preventDefault();const t=document.querySelector("main:first-of-type")??document.getElementById(d);t&&p(t)}),[]);return(0,c.$)((n=>{let{location:r}=n;e.current&&!r.hash&&"PUSH"===t&&p(e.current)})),{containerRef:e,onClick:n}}const g=(0,l.T)({id:"theme.common.skipToMainContent",description:"The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation",message:"Skip to main content"});function m(e){const t=e.children??g,{containerRef:n,onClick:r}=f();return(0,u.jsx)("div",{ref:n,role:"region","aria-label":g,children:(0,u.jsx)("a",{...e,href:`#${d}`,onClick:r,children:t})})}var h=n(7559),y=n(4090);const b={skipToContent:"skipToContent_fXgn"};function v(){return(0,u.jsx)(m,{className:b.skipToContent})}var w=n(6342),k=n(5041);function x(e){let{width:t=21,height:n=21,color:r="currentColor",strokeWidth:o=1.2,className:a,...i}=e;return(0,u.jsx)("svg",{viewBox:"0 0 15 15",width:t,height:n,...i,children:(0,u.jsx)("g",{stroke:r,strokeWidth:o,children:(0,u.jsx)("path",{d:"M.75.75l13.5 13.5M14.25.75L.75 14.25"})})})}const S={closeButton:"closeButton_CVFx"};function _(e){return(0,u.jsx)("button",{type:"button","aria-label":(0,l.T)({id:"theme.AnnouncementBar.closeButtonAriaLabel",message:"Close",description:"The ARIA label for close button of announcement bar"}),...e,className:(0,o.A)("clean-btn close",S.closeButton,e.className),children:(0,u.jsx)(x,{width:14,height:14,strokeWidth:3.1})})}const E={content:"content_knG7"};function C(e){const{announcementBar:t}=(0,w.p)(),{content:n}=t;return(0,u.jsx)("div",{...e,className:(0,o.A)(E.content,e.className),dangerouslySetInnerHTML:{__html:n}})}const A={announcementBar:"announcementBar_mb4j",announcementBarPlaceholder:"announcementBarPlaceholder_vyr4",announcementBarClose:"announcementBarClose_gvF7",announcementBarContent:"announcementBarContent_xLdY"};function T(){const{announcementBar:e}=(0,w.p)(),{isActive:t,close:n}=(0,k.M)();if(!t)return null;const{backgroundColor:r,textColor:o,isCloseable:a}=e;return(0,u.jsxs)("div",{className:A.announcementBar,style:{backgroundColor:r,color:o},role:"banner",children:[a&&(0,u.jsx)("div",{className:A.announcementBarPlaceholder}),(0,u.jsx)(C,{className:A.announcementBarContent}),a&&(0,u.jsx)(_,{onClick:n,className:A.announcementBarClose})]})}var j=n(2069),R=n(3104);var P=n(9532),L=n(5600);const N=r.createContext(null);function O(e){let{children:t}=e;const n=function(){const e=(0,j.M)(),t=(0,L.YL)(),[n,o]=(0,r.useState)(!1),a=null!==t.component,i=(0,P.ZC)(a);return(0,r.useEffect)((()=>{a&&!i&&o(!0)}),[a,i]),(0,r.useEffect)((()=>{a?e.shown||o(!0):o(!1)}),[e.shown,a]),(0,r.useMemo)((()=>[n,o]),[n])}();return(0,u.jsx)(N.Provider,{value:n,children:t})}function D(e){if(e.component){const t=e.component;return(0,u.jsx)(t,{...e.props})}}function I(){const e=(0,r.useContext)(N);if(!e)throw new P.dV("NavbarSecondaryMenuDisplayProvider");const[t,n]=e,o=(0,r.useCallback)((()=>n(!1)),[n]),a=(0,L.YL)();return(0,r.useMemo)((()=>({shown:t,hide:o,content:D(a)})),[o,a,t])}function M(e){let{header:t,primaryMenu:n,secondaryMenu:r}=e;const{shown:a}=I();return(0,u.jsxs)("div",{className:"navbar-sidebar",children:[t,(0,u.jsxs)("div",{className:(0,o.A)("navbar-sidebar__items",{"navbar-sidebar__items--show-secondary":a}),children:[(0,u.jsx)("div",{className:"navbar-sidebar__item menu",children:n}),(0,u.jsx)("div",{className:"navbar-sidebar__item menu",children:r})]})]})}var F=n(5293),z=n(2303);function B(e){return(0,u.jsx)("svg",{viewBox:"0 0 24 24",width:24,height:24,...e,children:(0,u.jsx)("path",{fill:"currentColor",d:"M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"})})}function $(e){return(0,u.jsx)("svg",{viewBox:"0 0 24 24",width:24,height:24,...e,children:(0,u.jsx)("path",{fill:"currentColor",d:"M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"})})}const U={toggle:"toggle_vylO",toggleButton:"toggleButton_gllP",darkToggleIcon:"darkToggleIcon_wfgR",lightToggleIcon:"lightToggleIcon_pyhR",toggleButtonDisabled:"toggleButtonDisabled_aARS"};function q(e){let{className:t,buttonClassName:n,value:r,onChange:a}=e;const i=(0,z.A)(),s=(0,l.T)({message:"Switch between dark and light mode (currently {mode})",id:"theme.colorToggle.ariaLabel",description:"The ARIA label for the navbar color mode toggle"},{mode:"dark"===r?(0,l.T)({message:"dark mode",id:"theme.colorToggle.ariaLabel.mode.dark",description:"The name for the dark color mode"}):(0,l.T)({message:"light mode",id:"theme.colorToggle.ariaLabel.mode.light",description:"The name for the light color mode"})});return(0,u.jsx)("div",{className:(0,o.A)(U.toggle,t),children:(0,u.jsxs)("button",{className:(0,o.A)("clean-btn",U.toggleButton,!i&&U.toggleButtonDisabled,n),type:"button",onClick:()=>a("dark"===r?"light":"dark"),disabled:!i,title:s,"aria-label":s,"aria-live":"polite","aria-pressed":"dark"===r?"true":"false",children:[(0,u.jsx)(B,{className:(0,o.A)(U.toggleIcon,U.lightToggleIcon)}),(0,u.jsx)($,{className:(0,o.A)(U.toggleIcon,U.darkToggleIcon)})]})})}const G=r.memo(q),H={darkNavbarColorModeToggle:"darkNavbarColorModeToggle_X3D1"};function V(e){let{className:t}=e;const n=(0,w.p)().navbar.style,r=(0,w.p)().colorMode.disableSwitch,{colorMode:o,setColorMode:a}=(0,F.G)();return r?null:(0,u.jsx)(G,{className:t,buttonClassName:"dark"===n?H.darkNavbarColorModeToggle:void 0,value:o,onChange:a})}var W=n(3465);function K(){return(0,u.jsx)(W.A,{className:"navbar__brand",imageClassName:"navbar__logo",titleClassName:"navbar__title text--truncate"})}function Q(){const e=(0,j.M)();return(0,u.jsx)("button",{type:"button","aria-label":(0,l.T)({id:"theme.docs.sidebar.closeSidebarButtonAriaLabel",message:"Close navigation bar",description:"The ARIA label for close button of mobile sidebar"}),className:"clean-btn navbar-sidebar__close",onClick:()=>e.toggle(),children:(0,u.jsx)(x,{color:"var(--ifm-color-emphasis-600)"})})}function Y(){return(0,u.jsxs)("div",{className:"navbar-sidebar__brand",children:[(0,u.jsx)(K,{}),(0,u.jsx)(V,{className:"margin-right--md"}),(0,u.jsx)(Q,{})]})}var Z=n(8774),X=n(6025),J=n(6654);function ee(e,t){return void 0!==e&&void 0!==t&&new RegExp(e,"gi").test(t)}var te=n(3186);function ne(e){let{activeBasePath:t,activeBaseRegex:n,to:r,href:o,label:a,html:i,isDropdownLink:s,prependBaseUrlToHref:l,...c}=e;const d=(0,X.Ay)(r),p=(0,X.Ay)(t),f=(0,X.Ay)(o,{forcePrependBaseUrl:!0}),g=a&&o&&!(0,J.A)(o),m=i?{dangerouslySetInnerHTML:{__html:i}}:{children:(0,u.jsxs)(u.Fragment,{children:[a,g&&(0,u.jsx)(te.A,{...s&&{width:12,height:12}})]})};return o?(0,u.jsx)(Z.A,{href:l?f:o,...c,...m}):(0,u.jsx)(Z.A,{to:d,isNavLink:!0,...(t||n)&&{isActive:(e,t)=>n?ee(n,t.pathname):t.pathname.startsWith(p)},...c,...m})}function re(e){let{className:t,isDropdownItem:n=!1,...r}=e;const a=(0,u.jsx)(ne,{className:(0,o.A)(n?"dropdown__link":"navbar__item navbar__link",t),isDropdownLink:n,...r});return n?(0,u.jsx)("li",{children:a}):a}function oe(e){let{className:t,isDropdownItem:n,...r}=e;return(0,u.jsx)("li",{className:"menu__list-item",children:(0,u.jsx)(ne,{className:(0,o.A)("menu__link",t),...r})})}function ae(e){let{mobile:t=!1,position:n,...r}=e;const o=t?oe:re;return(0,u.jsx)(o,{...r,activeClassName:r.activeClassName??(t?"menu__link--active":"navbar__link--active")})}var ie=n(1422),se=n(9169),le=n(4586);const ce="dropdownNavbarItemMobile_S0Fm";function ue(e,t){return e.some((e=>function(e,t){return!!(0,se.ys)(e.to,t)||!!ee(e.activeBaseRegex,t)||!(!e.activeBasePath||!t.startsWith(e.activeBasePath))}(e,t)))}function de(e){let{items:t,position:n,className:a,onClick:i,...s}=e;const l=(0,r.useRef)(null),[c,d]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{const e=e=>{l.current&&!l.current.contains(e.target)&&d(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),document.addEventListener("focusin",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e),document.removeEventListener("focusin",e)}}),[l]),(0,u.jsxs)("div",{ref:l,className:(0,o.A)("navbar__item","dropdown","dropdown--hoverable",{"dropdown--right":"right"===n,"dropdown--show":c}),children:[(0,u.jsx)(ne,{"aria-haspopup":"true","aria-expanded":c,role:"button",href:s.to?void 0:"#",className:(0,o.A)("navbar__link",a),...s,onClick:s.to?void 0:e=>e.preventDefault(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),d(!c))},children:s.children??s.label}),(0,u.jsx)("ul",{className:"dropdown__menu",children:t.map(((e,t)=>(0,r.createElement)(ut,{isDropdownItem:!0,activeClassName:"dropdown__link--active",...e,key:t})))})]})}function pe(e){let{items:t,className:n,position:a,onClick:i,...l}=e;const c=function(){const{siteConfig:{baseUrl:e}}=(0,le.A)(),{pathname:t}=(0,s.zy)();return t.replace(e,"/")}(),d=ue(t,c),{collapsed:p,toggleCollapsed:f,setCollapsed:g}=(0,ie.u)({initialState:()=>!d});return(0,r.useEffect)((()=>{d&&g(!d)}),[c,d,g]),(0,u.jsxs)("li",{className:(0,o.A)("menu__list-item",{"menu__list-item--collapsed":p}),children:[(0,u.jsx)(ne,{role:"button",className:(0,o.A)(ce,"menu__link menu__link--sublist menu__link--sublist-caret",n),...l,onClick:e=>{e.preventDefault(),f()},children:l.children??l.label}),(0,u.jsx)(ie.N,{lazy:!0,as:"ul",className:"menu__list",collapsed:p,children:t.map(((e,t)=>(0,r.createElement)(ut,{mobile:!0,isDropdownItem:!0,onClick:i,activeClassName:"menu__link--active",...e,key:t})))})]})}function fe(e){let{mobile:t=!1,...n}=e;const r=t?pe:de;return(0,u.jsx)(r,{...n})}var ge=n(2131);function me(e){let{width:t=20,height:n=20,...r}=e;return(0,u.jsx)("svg",{viewBox:"0 0 24 24",width:t,height:n,"aria-hidden":!0,...r,children:(0,u.jsx)("path",{fill:"currentColor",d:"M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"})})}const he="iconLanguage_nlXk";var ye=n(4070),be=n(9153),ve=n(9913),we=n(4471),ke=n(7674),xe=n(6841),Se=n(3810),_e=n(4081);const Ee="searchBar_RVTs",Ce="dropdownMenu_qbY6",Ae="searchBarLeft_MXDe",Te="suggestion_fB_2",je="cursor_eG29",Re="hitTree_kk6K",Pe="hitIcon_a7Zy",Le="hitPath_ieM4",Ne="noResultsIcon_EBY5",Oe="hitFooter_E9YW",De="hitWrapper_sAK8",Ie="hitTitle_vyVt",Me="hitAction_NqkB",Fe="noResults_l6Q3",ze="searchBarContainer_NW3z",Be="searchBarLoadingRing_YnHq",$e="searchClearButton_qk4g",Ue="searchIndexLoading_EJ1f",qe="searchHintContainer_Pkmr",Ge="searchHint_iIMx",He="focused_OWtg",Ve="input_FOTf",We="hint_URu1",Ke="suggestions_X8XU",Qe="dataset_QiCy",Ye="empty_eITn";function Ze(e){let{document:t,type:n,page:r,metadata:o,tokens:a,isInterOfTree:i,isLastOfTree:s}=e;const l=n===ve.i.Title,c=n===ve.i.Keywords,u=l||c,d=n===ve.i.Heading,p=[];i?p.push(''):s&&p.push('');const f=p.map((e=>`${e}`)),g=`${u?'':d?'':''}`,m=[`${c?(0,xe.Z)(t.s,a):(0,Se.C)(t.t,(0,ke.g)(o,"t"),a)}`];if(!i&&!s&&_e.tb){const e=r?r.b?.concat(r.t).concat(t.s&&t.s!==r.t?t.s:[]):t.b;m.push(`${(0,we.$)(e??[])}`)}else u||m.push(`${(0,xe.Z)(r.t||(t.u.startsWith("/docs/api-reference/")?"API Reference":""),a)}`);const h=``;return[...f,g,``,...m,"",h].join("")}function Xe(){return`${(0,l.T)({id:"theme.SearchBar.noResultsText",message:"No results"})}`}var Je=n(2849),et=n(3385);async function tt(){const e=await Promise.all([n.e(489),n.e(5741)]).then(n.t.bind(n,489,23)),t=e.default;return t.noConflict?t.noConflict():e.noConflict&&e.noConflict(),t}const nt="_highlight";const rt=function(e){let{handleSearchBarToggle:t}=e;const a=(0,z.A)(),{siteConfig:{baseUrl:i},i18n:{currentLocale:c}}=(0,le.A)(),d=(0,ye.vT)();let p=i;try{const{preferredVersion:e}=function(){return n(4070).g1(...arguments)}(d?.pluginId??_e.UB);e&&!e.isLast&&(p=e.path+"/")}catch(B){if(_e.I$&&!(B instanceof P.dV))throw B}const f=(0,s.W6)(),g=(0,s.zy)(),m=(0,r.useRef)(null),h=(0,r.useRef)(new Map),y=(0,r.useRef)(!1),[b,v]=(0,r.useState)(!1),[w,k]=(0,r.useState)(!1),[x,S]=(0,r.useState)(""),_=(0,r.useRef)(null),E=(0,r.useRef)(""),[C,A]=(0,r.useState)("");(0,r.useEffect)((()=>{if(!Array.isArray(_e.Hg))return;let e="";if(g.pathname.startsWith(p)){const t=g.pathname.substring(p.length);let n;for(const e of _e.Hg){const r="string"==typeof e?e:e.path;if(t===r||t.startsWith(`${r}/`)){n=r;break}}n&&(e=n)}E.current!==e&&(h.current.delete(e),E.current=e),A(e)}),[g.pathname,p]);const T=!!_e.O6&&Array.isArray(_e.Hg)&&""===C,j=(0,r.useCallback)((async()=>{if(T||h.current.get(C))return;h.current.set(C,"loading"),_.current?.autocomplete.destroy(),v(!0);const[e]=await Promise.all([tt(),(0,be.k)(p,C)]);if(_.current=e(m.current,{hint:!1,autoselect:!0,openOnFocus:!0,cssClasses:{root:(0,o.A)(Ee,{[Ae]:"left"===_e.ZG}),noPrefix:!0,dropdownMenu:Ce,input:Ve,hint:We,suggestions:Ke,suggestion:Te,cursor:je,dataset:Qe,empty:Ye}},[{source:async(e,t)=>{t(await(0,be.w)(p,C,e))},templates:{suggestion:Ze,empty:Xe,footer:e=>{let{query:t,isEmpty:n}=e;if(n&&(!C||!_e.dz))return;const r=(e=>{let{query:t,isEmpty:n}=e;const r=document.createElement("a"),o=new URLSearchParams;let a;if(o.set("q",t),C){const e=C&&Array.isArray(_e.Hg)?_e.Hg.find((e=>"string"==typeof e?e===C:e.path===C)):C,t=e?(0,et.p)(e,c).label:C;a=_e.dz&&n?(0,l.T)({id:"theme.SearchBar.seeAllOutsideContext",message:'See all results outside "{context}"'},{context:t}):(0,l.T)({id:"theme.SearchBar.searchInContext",message:'See all results within "{context}"'},{context:t})}else a=(0,l.T)({id:"theme.SearchBar.seeAll",message:"See all results"});if(!C||!Array.isArray(_e.Hg)||_e.dz&&n||o.set("ctx",C),p!==i){if(!p.startsWith(i))throw new Error(`Version url '${p}' does not start with base url '${i}', this is a bug of \`@easyops-cn/docusaurus-search-local\`, please report it.`);o.set("version",p.substring(i.length))}const s=`${i}search/?${o.toString()}`;return r.href=s,r.textContent=a,r.addEventListener("click",(e=>{e.ctrlKey||e.metaKey||(e.preventDefault(),_.current?.autocomplete.close(),f.push(s))})),r})({query:t,isEmpty:n}),o=document.createElement("div");return o.className=Oe,o.appendChild(r),o}}}]).on("autocomplete:selected",(function(e,t){let{document:{u:n,h:r},tokens:o}=t;m.current?.blur();let a=n;if(_e.CU&&o.length>0){const e=new URLSearchParams;for(const t of o)e.append(nt,t);a+=`?${e.toString()}`}r&&(a+=r),f.push(a)})).on("autocomplete:closed",(()=>{m.current?.blur()})),h.current.set(C,"done"),v(!1),y.current){const e=m.current;e.value&&_.current?.autocomplete.open(),e.focus()}}),[T,C,p,i,f]);(0,r.useEffect)((()=>{if(!_e.CU)return;const e=a?new URLSearchParams(g.search).getAll(nt):[];setTimeout((()=>{const t=document.querySelector("article");if(!t)return;const n=new _e.CU(t);n.unmark(),0!==e.length&&n.mark(e),S(e.join(" ")),_.current?.autocomplete.setVal(e.join(" "))}))}),[a,g.search,g.pathname]);const[R,L]=(0,r.useState)(!1),N=(0,r.useCallback)((()=>{y.current=!0,j(),L(!0),t?.(!0)}),[t,j]),O=(0,r.useCallback)((()=>{L(!1),t?.(!1)}),[t]),D=(0,r.useCallback)((()=>{j()}),[j]),I=(0,r.useCallback)((e=>{S(e.target.value),e.target.value&&k(!0)}),[]),M=!!a&&/mac/i.test(navigator.userAgentData?.platform??navigator.platform);(0,r.useEffect)((()=>{if(!_e.WW)return;const e=e=>{!(M?e.metaKey:e.ctrlKey)||"k"!==e.key&&"K"!==e.key||(e.preventDefault(),m.current?.focus(),N())};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}),[M,N]);const F=(0,r.useCallback)((()=>{const e=new URLSearchParams(g.search);e.delete(nt);const t=e.toString(),n=g.pathname+(""!=t?`?${t}`:"")+g.hash;n!=g.pathname+g.search+g.hash&&f.push(n),S(""),_.current?.autocomplete.setVal("")}),[g.pathname,g.search,g.hash,f]);return(0,u.jsxs)("div",{className:(0,o.A)("navbar__search",ze,{[Ue]:b&&w,[He]:R}),hidden:T,dir:"ltr",children:[(0,u.jsx)("input",{placeholder:(0,l.T)({id:"theme.SearchBar.label",message:"Search",description:"The ARIA label and placeholder for search button"}),"aria-label":"Search",className:"navbar__search-input",onMouseEnter:D,onFocus:N,onBlur:O,onChange:I,ref:m,value:x}),(0,u.jsx)(Je.A,{className:Be}),_e.WW&&_e.pk&&(""!==x?(0,u.jsx)("button",{className:$e,onClick:F,children:"\u2715"}):a&&(0,u.jsxs)("div",{className:qe,children:[(0,u.jsx)("kbd",{className:Ge,children:M?"\u2318":"ctrl"}),(0,u.jsx)("kbd",{className:Ge,children:"K"})]}))]})},ot={navbarSearchContainer:"navbarSearchContainer_Bca1"};function at(e){let{children:t,className:n}=e;return(0,u.jsx)("div",{className:(0,o.A)(n,ot.navbarSearchContainer),children:t})}var it=n(6972);var st=n(3886);function lt(e,t){return t.alternateDocVersions[e.name]??function(e){return e.docs.find((t=>t.id===e.mainDocId))}(e)}const ct={default:ae,localeDropdown:function(e){let{mobile:t,dropdownItemsBefore:n,dropdownItemsAfter:r,queryString:o="",...a}=e;const{i18n:{currentLocale:i,locales:c,localeConfigs:d}}=(0,le.A)(),p=(0,ge.o)(),{search:f,hash:g}=(0,s.zy)(),m=[...n,...c.map((e=>{const n=`${`pathname://${p.createUrl({locale:e,fullyQualified:!1})}`}${f}${g}${o}`;return{label:d[e].label,lang:d[e].htmlLang,to:n,target:"_self",autoAddBaseUrl:!1,className:e===i?t?"menu__link--active":"dropdown__link--active":""}})),...r],h=t?(0,l.T)({message:"Languages",id:"theme.navbar.mobileLanguageDropdown.label",description:"The label for the mobile language switcher dropdown"}):d[i].label;return(0,u.jsx)(fe,{...a,mobile:t,label:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(me,{className:he}),h]}),items:m})},search:function(e){let{mobile:t,className:n}=e;return t?null:(0,u.jsx)(at,{className:n,children:(0,u.jsx)(rt,{})})},dropdown:fe,html:function(e){let{value:t,className:n,mobile:r=!1,isDropdownItem:a=!1}=e;const i=a?"li":"div";return(0,u.jsx)(i,{className:(0,o.A)({navbar__item:!r&&!a,"menu__list-item":r},n),dangerouslySetInnerHTML:{__html:t}})},doc:function(e){let{docId:t,label:n,docsPluginId:r,...o}=e;const{activeDoc:a}=(0,ye.zK)(r),i=(0,it.QB)(t,r),s=a?.path===i?.path;return null===i||i.unlisted&&!s?null:(0,u.jsx)(ae,{exact:!0,...o,isActive:()=>s||!!a?.sidebar&&a.sidebar===i.sidebar,label:n??i.id,to:i.path})},docSidebar:function(e){let{sidebarId:t,label:n,docsPluginId:r,...o}=e;const{activeDoc:a}=(0,ye.zK)(r),i=(0,it.fW)(t,r).link;if(!i)throw new Error(`DocSidebarNavbarItem: Sidebar with ID "${t}" doesn't have anything to be linked to.`);return(0,u.jsx)(ae,{exact:!0,...o,isActive:()=>a?.sidebar===t,label:n??i.label,to:i.path})},docsVersion:function(e){let{label:t,to:n,docsPluginId:r,...o}=e;const a=(0,it.Vd)(r)[0],i=t??a.label,s=n??(e=>e.docs.find((t=>t.id===e.mainDocId)))(a).path;return(0,u.jsx)(ae,{...o,label:i,to:s})},docsVersionDropdown:function(e){let{mobile:t,docsPluginId:n,dropdownActiveClassDisabled:r,dropdownItemsBefore:o,dropdownItemsAfter:a,...i}=e;const{search:c,hash:d}=(0,s.zy)(),p=(0,ye.zK)(n),f=(0,ye.jh)(n),{savePreferredVersionName:g}=(0,st.g1)(n),m=[...o,...f.map((function(e){const t=lt(e,p);return{label:e.label,to:`${t.path}${c}${d}`,isActive:()=>e===p.activeVersion,onClick:()=>g(e.name)}})),...a],h=(0,it.Vd)(n)[0],y=t&&m.length>1?(0,l.T)({id:"theme.navbar.mobileVersionsDropdown.label",message:"Versions",description:"The label for the navbar versions dropdown on mobile view"}):h.label,b=t&&m.length>1?void 0:lt(h,p).path;return m.length<=1?(0,u.jsx)(ae,{...i,mobile:t,label:y,to:b,isActive:r?()=>!1:void 0}):(0,u.jsx)(fe,{...i,mobile:t,label:y,to:b,items:m,isActive:r?()=>!1:void 0})}};function ut(e){let{type:t,...n}=e;const r=function(e,t){return e&&"default"!==e?e:"items"in t?"dropdown":"default"}(t,n),o=ct[r];if(!o)throw new Error(`No NavbarItem component found for type "${t}".`);return(0,u.jsx)(o,{...n})}function dt(){const e=(0,j.M)(),t=(0,w.p)().navbar.items;return(0,u.jsx)("ul",{className:"menu__list",children:t.map(((t,n)=>(0,r.createElement)(ut,{mobile:!0,...t,onClick:()=>e.toggle(),key:n})))})}function pt(e){return(0,u.jsx)("button",{...e,type:"button",className:"clean-btn navbar-sidebar__back",children:(0,u.jsx)(l.A,{id:"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel",description:"The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)",children:"\u2190 Back to main menu"})})}function ft(){const e=0===(0,w.p)().navbar.items.length,t=I();return(0,u.jsxs)(u.Fragment,{children:[!e&&(0,u.jsx)(pt,{onClick:()=>t.hide()}),t.content]})}function gt(){const e=(0,j.M)();var t;return void 0===(t=e.shown)&&(t=!0),(0,r.useEffect)((()=>(document.body.style.overflow=t?"hidden":"visible",()=>{document.body.style.overflow="visible"})),[t]),e.shouldRender?(0,u.jsx)(M,{header:(0,u.jsx)(Y,{}),primaryMenu:(0,u.jsx)(dt,{}),secondaryMenu:(0,u.jsx)(ft,{})}):null}const mt={navbarHideable:"navbarHideable_m1mJ",navbarHidden:"navbarHidden_jGov"};function ht(e){return(0,u.jsx)("div",{role:"presentation",...e,className:(0,o.A)("navbar-sidebar__backdrop",e.className)})}function yt(e){let{children:t}=e;const{navbar:{hideOnScroll:n,style:a}}=(0,w.p)(),i=(0,j.M)(),{navbarRef:s,isNavbarVisible:d}=function(e){const[t,n]=(0,r.useState)(e),o=(0,r.useRef)(!1),a=(0,r.useRef)(0),i=(0,r.useCallback)((e=>{null!==e&&(a.current=e.getBoundingClientRect().height)}),[]);return(0,R.Mq)(((t,r)=>{let{scrollY:i}=t;if(!e)return;if(i =s?n(!1):i+c {if(!e)return;const r=t.location.hash;if(r?document.getElementById(r.substring(1)):void 0)return o.current=!0,void n(!1);n(!0)})),{navbarRef:i,isNavbarVisible:t}}(n);return(0,u.jsxs)("nav",{ref:s,"aria-label":(0,l.T)({id:"theme.NavBar.navAriaLabel",message:"Main",description:"The ARIA label for the main navigation"}),className:(0,o.A)("navbar","navbar--fixed-top",n&&[mt.navbarHideable,!d&&mt.navbarHidden],{"navbar--dark":"dark"===a,"navbar--primary":"primary"===a,"navbar-sidebar--show":i.shown}),children:[t,(0,u.jsx)(ht,{onClick:i.toggle}),(0,u.jsx)(gt,{})]})}var bt=n(440);const vt={errorBoundaryError:"errorBoundaryError_a6uf",errorBoundaryFallback:"errorBoundaryFallback_VBag"};function wt(e){return(0,u.jsx)("button",{type:"button",...e,children:(0,u.jsx)(l.A,{id:"theme.ErrorPageContent.tryAgain",description:"The label of the button to try again rendering when the React error boundary captures an error",children:"Try again"})})}function kt(e){let{error:t}=e;const n=(0,bt.rA)(t).map((e=>e.message)).join("\n\nCause:\n");return(0,u.jsx)("p",{className:vt.errorBoundaryError,children:n})}class xt extends r.Component{componentDidCatch(e,t){throw this.props.onError(e,t)}render(){return this.props.children}}const St="right";function _t(e){let{width:t=30,height:n=30,className:r,...o}=e;return(0,u.jsx)("svg",{className:r,width:t,height:n,viewBox:"0 0 30 30","aria-hidden":"true",...o,children:(0,u.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M4 7h22M4 15h22M4 23h22"})})}function Et(){const{toggle:e,shown:t}=(0,j.M)();return(0,u.jsx)("button",{onClick:e,"aria-label":(0,l.T)({id:"theme.docs.sidebar.toggleSidebarButtonAriaLabel",message:"Toggle navigation bar",description:"The ARIA label for hamburger menu button of mobile navigation"}),"aria-expanded":t,className:"navbar__toggle clean-btn",type:"button",children:(0,u.jsx)(_t,{})})}const Ct={colorModeToggle:"colorModeToggle_DEke"};function At(e){let{items:t}=e;return(0,u.jsx)(u.Fragment,{children:t.map(((e,t)=>(0,u.jsx)(xt,{onError:t=>new Error(`A theme navbar item failed to render.\nPlease double-check the following navbar item (themeConfig.navbar.items) of your Docusaurus config:\n${JSON.stringify(e,null,2)}`,{cause:t}),children:(0,u.jsx)(ut,{...e})},t)))})}function Tt(e){let{left:t,right:n}=e;return(0,u.jsxs)("div",{className:"navbar__inner",children:[(0,u.jsx)("div",{className:"navbar__items",children:t}),(0,u.jsx)("div",{className:"navbar__items navbar__items--right",children:n})]})}function jt(){const e=(0,j.M)(),t=(0,w.p)().navbar.items,[n,r]=function(e){function t(e){return"left"===(e.position??St)}return[e.filter(t),e.filter((e=>!t(e)))]}(t),o=t.find((e=>"search"===e.type));return(0,u.jsx)(Tt,{left:(0,u.jsxs)(u.Fragment,{children:[!e.disabled&&(0,u.jsx)(Et,{}),(0,u.jsx)(K,{}),(0,u.jsx)(At,{items:n})]}),right:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(At,{items:r}),(0,u.jsx)(V,{className:Ct.colorModeToggle}),!o&&(0,u.jsx)(at,{children:(0,u.jsx)(rt,{})})]})})}function Rt(){return(0,u.jsx)(yt,{children:(0,u.jsx)(jt,{})})}function Pt(e){let{item:t}=e;const{to:n,href:r,label:a,prependBaseUrlToHref:i,className:s,...l}=t,c=(0,X.Ay)(n),d=(0,X.Ay)(r,{forcePrependBaseUrl:!0});return(0,u.jsxs)(Z.A,{className:(0,o.A)("footer__link-item",s),...r?{href:i?d:r}:{to:c},...l,children:[a,r&&!(0,J.A)(r)&&(0,u.jsx)(te.A,{})]})}function Lt(e){let{item:t}=e;return t.html?(0,u.jsx)("li",{className:(0,o.A)("footer__item",t.className),dangerouslySetInnerHTML:{__html:t.html}}):(0,u.jsx)("li",{className:"footer__item",children:(0,u.jsx)(Pt,{item:t})},t.href??t.to)}function Nt(e){let{column:t}=e;return(0,u.jsxs)("div",{className:(0,o.A)("col footer__col",t.className),children:[(0,u.jsx)("div",{className:"footer__title",children:t.title}),(0,u.jsx)("ul",{className:"footer__items clean-list",children:t.items.map(((e,t)=>(0,u.jsx)(Lt,{item:e},t)))})]})}function Ot(e){let{columns:t}=e;return(0,u.jsx)("div",{className:"row footer__links",children:t.map(((e,t)=>(0,u.jsx)(Nt,{column:e},t)))})}function Dt(){return(0,u.jsx)("span",{className:"footer__link-separator",children:"\xb7"})}function It(e){let{item:t}=e;return t.html?(0,u.jsx)("span",{className:(0,o.A)("footer__link-item",t.className),dangerouslySetInnerHTML:{__html:t.html}}):(0,u.jsx)(Pt,{item:t})}function Mt(e){let{links:t}=e;return(0,u.jsx)("div",{className:"footer__links text--center",children:(0,u.jsx)("div",{className:"footer__links",children:t.map(((e,n)=>(0,u.jsxs)(r.Fragment,{children:[(0,u.jsx)(It,{item:e}),t.length!==n+1&&(0,u.jsx)(Dt,{})]},n)))})})}function Ft(e){let{links:t}=e;return function(e){return"title"in e[0]}(t)?(0,u.jsx)(Ot,{columns:t}):(0,u.jsx)(Mt,{links:t})}var zt=n(1122);const Bt="footerLogoLink_BH7S";function $t(e){let{logo:t}=e;const{withBaseUrl:n}=(0,X.hH)(),r={light:n(t.src),dark:n(t.srcDark??t.src)};return(0,u.jsx)(zt.A,{className:(0,o.A)("footer__logo",t.className),alt:t.alt,sources:r,width:t.width,height:t.height,style:t.style})}function Ut(e){let{logo:t}=e;return t.href?(0,u.jsx)(Z.A,{href:t.href,className:Bt,target:t.target,children:(0,u.jsx)($t,{logo:t})}):(0,u.jsx)($t,{logo:t})}function qt(e){let{copyright:t}=e;return(0,u.jsx)("div",{className:"footer__copyright",dangerouslySetInnerHTML:{__html:t}})}function Gt(e){let{style:t,links:n,logo:r,copyright:a}=e;return(0,u.jsx)("footer",{className:(0,o.A)("footer",{"footer--dark":"dark"===t}),children:(0,u.jsxs)("div",{className:"container container-fluid",children:[n,(r||a)&&(0,u.jsxs)("div",{className:"footer__bottom text--center",children:[r&&(0,u.jsx)("div",{className:"margin-bottom--sm",children:r}),a]})]})})}function Ht(){const{footer:e}=(0,w.p)();if(!e)return null;const{copyright:t,links:n,logo:r,style:o}=e;return(0,u.jsx)(Gt,{style:o,links:n&&n.length>0&&(0,u.jsx)(Ft,{links:n}),logo:r&&(0,u.jsx)(Ut,{logo:r}),copyright:t&&(0,u.jsx)(qt,{copyright:t})})}const Vt=r.memo(Ht),Wt=(0,P.fM)([F.a,k.o,R.Tv,st.VQ,i.Jx,function(e){let{children:t}=e;return(0,u.jsx)(L.y_,{children:(0,u.jsx)(j.e,{children:(0,u.jsx)(O,{children:t})})})}]);function Kt(e){let{children:t}=e;return(0,u.jsx)(Wt,{children:t})}var Qt=n(1107);function Yt(e){let{error:t,tryAgain:n}=e;return(0,u.jsx)("main",{className:"container margin-vert--xl",children:(0,u.jsx)("div",{className:"row",children:(0,u.jsxs)("div",{className:"col col--6 col--offset-3",children:[(0,u.jsx)(Qt.A,{as:"h1",className:"hero__title",children:(0,u.jsx)(l.A,{id:"theme.ErrorPageContent.title",description:"The title of the fallback page when the page crashed",children:"This page crashed."})}),(0,u.jsx)("div",{className:"margin-vert--lg",children:(0,u.jsx)(wt,{onClick:n,className:"button button--primary shadow--lw"})}),(0,u.jsx)("hr",{}),(0,u.jsx)("div",{className:"margin-vert--md",children:(0,u.jsx)(kt,{error:t})})]})})})}const Zt={mainWrapper:"mainWrapper_z2l0"};function Xt(e){const{children:t,noFooter:n,wrapperClassName:r,title:s,description:l}=e;return(0,y.J)(),(0,u.jsxs)(Kt,{children:[(0,u.jsx)(i.be,{title:s,description:l}),(0,u.jsx)(v,{}),(0,u.jsx)(T,{}),(0,u.jsx)(Rt,{}),(0,u.jsx)("div",{id:d,className:(0,o.A)(h.G.wrapper.main,Zt.mainWrapper,r),children:(0,u.jsx)(a.A,{fallback:e=>(0,u.jsx)(Yt,{...e}),children:t})}),!n&&(0,u.jsx)(Vt,{})]})}},3465:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});n(6540);var r=n(8774),o=n(6025),a=n(4586),i=n(6342),s=n(1122),l=n(4848);function c(e){let{logo:t,alt:n,imageClassName:r}=e;const a={light:(0,o.Ay)(t.src),dark:(0,o.Ay)(t.srcDark||t.src)},i=(0,l.jsx)(s.A,{className:t.className,sources:a,height:t.height,width:t.width,alt:n,style:t.style});return r?(0,l.jsx)("div",{className:r,children:i}):i}function u(e){const{siteConfig:{title:t}}=(0,a.A)(),{navbar:{title:n,logo:s}}=(0,i.p)(),{imageClassName:u,titleClassName:d,...p}=e,f=(0,o.Ay)(s?.href||"/"),g=n?"":t,m=s?.alt??g;return(0,l.jsxs)(r.A,{to:f,...p,...s?.target&&{target:s.target},children:[s&&(0,l.jsx)(c,{logo:s,alt:m,imageClassName:u}),null!=n&&(0,l.jsx)("b",{className:d,children:n})]})}},1463:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});n(6540);var r=n(5260),o=n(4848);function a(e){let{locale:t,version:n,tag:a}=e;const i=t;return(0,o.jsxs)(r.A,{children:[t&&(0,o.jsx)("meta",{name:"docusaurus_locale",content:t}),n&&(0,o.jsx)("meta",{name:"docusaurus_version",content:n}),a&&(0,o.jsx)("meta",{name:"docusaurus_tag",content:a}),i&&(0,o.jsx)("meta",{name:"docsearch:language",content:i}),n&&(0,o.jsx)("meta",{name:"docsearch:version",content:n}),a&&(0,o.jsx)("meta",{name:"docsearch:docusaurus_tag",content:a})]})}},1122:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var r=n(6540),o=n(4164),a=n(2303),i=n(5293);const s={themedComponent:"themedComponent_mlkZ","themedComponent--light":"themedComponent--light_NVdE","themedComponent--dark":"themedComponent--dark_xIcU"};var l=n(4848);function c(e){let{className:t,children:n}=e;const c=(0,a.A)(),{colorMode:u}=(0,i.G)();return(0,l.jsx)(l.Fragment,{children:(c?"dark"===u?["dark"]:["light"]:["light","dark"]).map((e=>{const a=n({theme:e,className:(0,o.A)(t,s.themedComponent,s[`themedComponent--${e}`])});return(0,l.jsx)(r.Fragment,{children:a},e)}))})}function u(e){const{sources:t,className:n,alt:r,...o}=e;return(0,l.jsx)(c,{className:n,children:e=>{let{theme:n,className:a}=e;return(0,l.jsx)("img",{src:t[n],alt:r,className:a,...o})}})}},1422:(e,t,n)=>{"use strict";n.d(t,{N:()=>y,u:()=>c});var r=n(6540),o=n(2303),a=n(205),i=n(3109),s=n(4848);const l="ease-in-out";function c(e){let{initialState:t}=e;const[n,o]=(0,r.useState)(t??!1),a=(0,r.useCallback)((()=>{o((e=>!e))}),[]);return{collapsed:n,setCollapsed:o,toggleCollapsed:a}}const u={display:"none",overflow:"hidden",height:"0px"},d={display:"block",overflow:"visible",height:"auto"};function p(e,t){const n=t?u:d;e.style.display=n.display,e.style.overflow=n.overflow,e.style.height=n.height}function f(e){let{collapsibleRef:t,collapsed:n,animation:o}=e;const a=(0,r.useRef)(!1);(0,r.useEffect)((()=>{const e=t.current;function r(){const t=e.scrollHeight,n=o?.duration??function(e){if((0,i.O)())return 1;const t=e/36;return Math.round(10*(4+15*t**.25+t/5))}(t);return{transition:`height ${n}ms ${o?.easing??l}`,height:`${t}px`}}function s(){const t=r();e.style.transition=t.transition,e.style.height=t.height}if(!a.current)return p(e,n),void(a.current=!0);return e.style.willChange="height",function(){const t=requestAnimationFrame((()=>{n?(s(),requestAnimationFrame((()=>{e.style.height=u.height,e.style.overflow=u.overflow}))):(e.style.display="block",requestAnimationFrame((()=>{s()})))}));return()=>cancelAnimationFrame(t)}()}),[t,n,o])}function g(e){let{collapsed:t,isBrowser:n}=e;if(!n)return t?u:d}function m(e){let{as:t="div",collapsed:n,children:a,animation:i,onCollapseTransitionEnd:l,className:c,disableSSRStyle:u}=e;const d=(0,o.A)(),m=(0,r.useRef)(null);return f({collapsibleRef:m,collapsed:n,animation:i}),(0,s.jsx)(t,{ref:m,style:u?void 0:g({collapsed:n,isBrowser:d}),onTransitionEnd:e=>{"height"===e.propertyName&&(p(m.current,n),l?.(n))},className:c,children:a})}function h(e){let{collapsed:t,...n}=e;const[o,i]=(0,r.useState)(!t),[l,c]=(0,r.useState)(t);return(0,a.A)((()=>{t||i(!0)}),[t]),(0,a.A)((()=>{o&&c(t)}),[o,t]),o?(0,s.jsx)(m,{...n,collapsed:l}):null}function y(e){let{lazy:t,...n}=e;const r=t?h:m;return(0,s.jsx)(r,{...n})}},5041:(e,t,n)=>{"use strict";n.d(t,{M:()=>m,o:()=>g});var r=n(6540),o=n(2303),a=n(679),i=n(9532),s=n(6342),l=n(4848);const c=(0,a.Wf)("docusaurus.announcement.dismiss"),u=(0,a.Wf)("docusaurus.announcement.id"),d=()=>"true"===c.get(),p=e=>c.set(String(e)),f=r.createContext(null);function g(e){let{children:t}=e;const n=function(){const{announcementBar:e}=(0,s.p)(),t=(0,o.A)(),[n,a]=(0,r.useState)((()=>!!t&&d()));(0,r.useEffect)((()=>{a(d())}),[]);const i=(0,r.useCallback)((()=>{p(!0),a(!0)}),[]);return(0,r.useEffect)((()=>{if(!e)return;const{id:t}=e;let n=u.get();"annoucement-bar"===n&&(n="announcement-bar");const r=t!==n;u.set(t),r&&p(!1),!r&&d()||a(!1)}),[e]),(0,r.useMemo)((()=>({isActive:!!e&&!n,close:i})),[e,n,i])}();return(0,l.jsx)(f.Provider,{value:n,children:t})}function m(){const e=(0,r.useContext)(f);if(!e)throw new i.dV("AnnouncementBarProvider");return e}},5293:(e,t,n)=>{"use strict";n.d(t,{G:()=>y,a:()=>h});var r=n(6540),o=n(8193),a=n(9532),i=n(679),s=n(6342),l=n(4848);const c=r.createContext(void 0),u="theme",d=(0,i.Wf)(u),p={light:"light",dark:"dark"},f=e=>e===p.dark?p.dark:p.light,g=e=>o.A.canUseDOM?f(document.documentElement.getAttribute("data-theme")):f(e),m=e=>{d.set(f(e))};function h(e){let{children:t}=e;const n=function(){const{colorMode:{defaultMode:e,disableSwitch:t,respectPrefersColorScheme:n}}=(0,s.p)(),[o,a]=(0,r.useState)(g(e));(0,r.useEffect)((()=>{t&&d.del()}),[t]);const i=(0,r.useCallback)((function(t,r){void 0===r&&(r={});const{persist:o=!0}=r;t?(a(t),o&&m(t)):(a(n?window.matchMedia("(prefers-color-scheme: dark)").matches?p.dark:p.light:e),d.del())}),[n,e]);(0,r.useEffect)((()=>{document.documentElement.setAttribute("data-theme",f(o))}),[o]),(0,r.useEffect)((()=>{if(t)return;const e=e=>{if(e.key!==u)return;const t=d.get();null!==t&&i(f(t))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}),[t,i]);const l=(0,r.useRef)(!1);return(0,r.useEffect)((()=>{if(t&&!n)return;const e=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>{window.matchMedia("print").matches||l.current?l.current=window.matchMedia("print").matches:i(null)};return e.addListener(r),()=>e.removeListener(r)}),[i,t,n]),(0,r.useMemo)((()=>({colorMode:o,setColorMode:i,get isDarkTheme(){return o===p.dark},setLightTheme(){i(p.light)},setDarkTheme(){i(p.dark)}})),[o,i])}();return(0,l.jsx)(c.Provider,{value:n,children:t})}function y(){const e=(0,r.useContext)(c);if(null==e)throw new a.dV("ColorModeProvider","Please see https://docusaurus.io/docs/api/themes/configuration#use-color-mode.");return e}},2069:(e,t,n)=>{"use strict";n.d(t,{M:()=>f,e:()=>p});var r=n(6540),o=n(5600),a=n(4581),i=n(7485),s=n(6342),l=n(9532),c=n(4848);const u=r.createContext(void 0);function d(){const e=function(){const e=(0,o.YL)(),{items:t}=(0,s.p)().navbar;return 0===t.length&&!e.component}(),t=(0,a.l)(),n=!e&&"mobile"===t,[l,c]=(0,r.useState)(!1);(0,i.$Z)((()=>{if(l)return c(!1),!1}));const u=(0,r.useCallback)((()=>{c((e=>!e))}),[]);return(0,r.useEffect)((()=>{"desktop"===t&&c(!1)}),[t]),(0,r.useMemo)((()=>({disabled:e,shouldRender:n,toggle:u,shown:l})),[e,n,u,l])}function p(e){let{children:t}=e;const n=d();return(0,c.jsx)(u.Provider,{value:n,children:t})}function f(){const e=r.useContext(u);if(void 0===e)throw new l.dV("NavbarMobileSidebarProvider");return e}},5600:(e,t,n)=>{"use strict";n.d(t,{GX:()=>c,YL:()=>l,y_:()=>s});var r=n(6540),o=n(9532),a=n(4848);const i=r.createContext(null);function s(e){let{children:t}=e;const n=(0,r.useState)({component:null,props:null});return(0,a.jsx)(i.Provider,{value:n,children:t})}function l(){const e=(0,r.useContext)(i);if(!e)throw new o.dV("NavbarSecondaryMenuContentProvider");return e[0]}function c(e){let{component:t,props:n}=e;const a=(0,r.useContext)(i);if(!a)throw new o.dV("NavbarSecondaryMenuContentProvider");const[,s]=a,l=(0,o.Be)(n);return(0,r.useEffect)((()=>{s({component:t,props:l})}),[s,t,l]),(0,r.useEffect)((()=>()=>s({component:null,props:null})),[s]),null}},4090:(e,t,n)=>{"use strict";n.d(t,{w:()=>o,J:()=>a});var r=n(6540);const o="navigation-with-keyboard";function a(){(0,r.useEffect)((()=>{function e(e){"keydown"===e.type&&"Tab"===e.key&&document.body.classList.add(o),"mousedown"===e.type&&document.body.classList.remove(o)}return document.addEventListener("keydown",e),document.addEventListener("mousedown",e),()=>{document.body.classList.remove(o),document.removeEventListener("keydown",e),document.removeEventListener("mousedown",e)}}),[])}},4581:(e,t,n)=>{"use strict";n.d(t,{l:()=>s});var r=n(6540),o=n(8193);const a={desktop:"desktop",mobile:"mobile",ssr:"ssr"},i=996;function s(e){let{desktopBreakpoint:t=i}=void 0===e?{}:e;const[n,s]=(0,r.useState)((()=>"ssr"));return(0,r.useEffect)((()=>{function e(){s(function(e){if(!o.A.canUseDOM)throw new Error("getWindowSize() should only be called after React hydration");return window.innerWidth>e?a.desktop:a.mobile}(t))}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[t]),n}},7559:(e,t,n)=>{"use strict";n.d(t,{G:()=>r});const r={page:{blogListPage:"blog-list-page",blogPostPage:"blog-post-page",blogTagsListPage:"blog-tags-list-page",blogTagPostListPage:"blog-tags-post-list-page",blogAuthorsListPage:"blog-authors-list-page",blogAuthorsPostsPage:"blog-authors-posts-page",docsDocPage:"docs-doc-page",docsTagsListPage:"docs-tags-list-page",docsTagDocListPage:"docs-tags-doc-list-page",mdxPage:"mdx-page"},wrapper:{main:"main-wrapper",blogPages:"blog-wrapper",docsPages:"docs-wrapper",mdxPages:"mdx-wrapper"},common:{editThisPage:"theme-edit-this-page",lastUpdated:"theme-last-updated",backToTopButton:"theme-back-to-top-button",codeBlock:"theme-code-block",admonition:"theme-admonition",unlistedBanner:"theme-unlisted-banner",draftBanner:"theme-draft-banner",admonitionType:e=>`theme-admonition-${e}`},layout:{},docs:{docVersionBanner:"theme-doc-version-banner",docVersionBadge:"theme-doc-version-badge",docBreadcrumbs:"theme-doc-breadcrumbs",docMarkdown:"theme-doc-markdown",docTocMobile:"theme-doc-toc-mobile",docTocDesktop:"theme-doc-toc-desktop",docFooter:"theme-doc-footer",docFooterTagsRow:"theme-doc-footer-tags-row",docFooterEditMetaRow:"theme-doc-footer-edit-meta-row",docSidebarContainer:"theme-doc-sidebar-container",docSidebarMenu:"theme-doc-sidebar-menu",docSidebarItemCategory:"theme-doc-sidebar-item-category",docSidebarItemLink:"theme-doc-sidebar-item-link",docSidebarItemCategoryLevel:e=>`theme-doc-sidebar-item-category-level-${e}`,docSidebarItemLinkLevel:e=>`theme-doc-sidebar-item-link-level-${e}`},blog:{blogFooterTagsRow:"theme-blog-footer-tags-row",blogFooterEditMetaRow:"theme-blog-footer-edit-meta-row"},pages:{pageFooterEditMetaRow:"theme-pages-footer-edit-meta-row"}}},3109:(e,t,n)=>{"use strict";function r(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}n.d(t,{O:()=>r})},7485:(e,t,n)=>{"use strict";n.d(t,{$Z:()=>i,aZ:()=>l});var r=n(6540),o=n(6347),a=n(9532);function i(e){!function(e){const t=(0,o.W6)(),n=(0,a._q)(e);(0,r.useEffect)((()=>t.block(((e,t)=>n(e,t)))),[t,n])}(((t,n)=>{if("POP"===n)return e(t,n)}))}function s(e){const t=(0,o.W6)();return(0,r.useSyncExternalStore)(t.listen,(()=>e(t)),(()=>e(t)))}function l(e){return s((t=>null===e?null:new URLSearchParams(t.location.search).get(e)))}},1682:(e,t,n)=>{"use strict";function r(e,t){return void 0===t&&(t=(e,t)=>e===t),e.filter(((n,r)=>e.findIndex((e=>t(e,n)))!==r))}function o(e){return Array.from(new Set(e))}function a(e,t){const n={};let r=0;for(const o of e){const e=t(o,r);n[e]??=[],n[e].push(o),r+=1}return n}n.d(t,{$z:()=>a,XI:()=>r,sb:()=>o})},1213:(e,t,n)=>{"use strict";n.d(t,{e3:()=>p,be:()=>u,Jx:()=>f});var r=n(6540),o=n(4164),a=n(5260),i=n(6803),s=n(6025),l=n(4586);var c=n(4848);function u(e){let{title:t,description:n,keywords:r,image:o,children:i}=e;const u=function(e){const{siteConfig:t}=(0,l.A)(),{title:n,titleDelimiter:r}=t;return e?.trim().length?`${e.trim()} ${r} ${n}`:n}(t),{withBaseUrl:d}=(0,s.hH)(),p=o?d(o,{absolute:!0}):void 0;return(0,c.jsxs)(a.A,{children:[t&&(0,c.jsx)("title",{children:u}),t&&(0,c.jsx)("meta",{property:"og:title",content:u}),n&&(0,c.jsx)("meta",{name:"description",content:n}),n&&(0,c.jsx)("meta",{property:"og:description",content:n}),r&&(0,c.jsx)("meta",{name:"keywords",content:Array.isArray(r)?r.join(","):r}),p&&(0,c.jsx)("meta",{property:"og:image",content:p}),p&&(0,c.jsx)("meta",{name:"twitter:image",content:p}),i]})}const d=r.createContext(void 0);function p(e){let{className:t,children:n}=e;const i=r.useContext(d),s=(0,o.A)(i,t);return(0,c.jsxs)(d.Provider,{value:s,children:[(0,c.jsx)(a.A,{children:(0,c.jsx)("html",{className:s})}),n]})}function f(e){let{children:t}=e;const n=(0,i.A)(),r=`plugin-${n.plugin.name.replace(/docusaurus-(?:plugin|theme)-(?:content-)?/gi,"")}`;const a=`plugin-id-${n.plugin.id}`;return(0,c.jsx)(p,{className:(0,o.A)(r,a),children:t})}},9532:(e,t,n)=>{"use strict";n.d(t,{Be:()=>c,ZC:()=>s,_q:()=>i,dV:()=>l,fM:()=>u});var r=n(6540),o=n(205),a=n(4848);function i(e){const t=(0,r.useRef)(e);return(0,o.A)((()=>{t.current=e}),[e]),(0,r.useCallback)((function(){return t.current(...arguments)}),[])}function s(e){const t=(0,r.useRef)();return(0,o.A)((()=>{t.current=e})),t.current}class l extends Error{constructor(e,t){super(),this.name="ReactContextError",this.message=`Hook ${this.stack?.split("\n")[1]?.match(/at (?:\w+\.)?(? \w+)/)?.groups.name??""} is called outside the <${e}>. ${t??""}`}}function c(e){const t=Object.entries(e);return t.sort(((e,t)=>e[0].localeCompare(t[0]))),(0,r.useMemo)((()=>e),t.flat())}function u(e){return t=>{let{children:n}=t;return(0,a.jsx)(a.Fragment,{children:e.reduceRight(((e,t)=>(0,a.jsx)(t,{children:e})),n)})}}},9169:(e,t,n)=>{"use strict";n.d(t,{Dt:()=>s,ys:()=>i});var r=n(6540),o=n(8328),a=n(4586);function i(e,t){const n=e=>(!e||e.endsWith("/")?e:`${e}/`)?.toLowerCase();return n(e)===n(t)}function s(){const{baseUrl:e}=(0,a.A)().siteConfig;return(0,r.useMemo)((()=>function(e){let{baseUrl:t,routes:n}=e;function r(e){return e.path===t&&!0===e.exact}function o(e){return e.path===t&&!e.exact}return function e(t){if(0===t.length)return;return t.find(r)||e(t.filter(o).flatMap((e=>e.routes??[])))}(n)}({routes:o.A,baseUrl:e})),[e])}},3104:(e,t,n)=>{"use strict";n.d(t,{Mq:()=>f,Tv:()=>u,a_:()=>g,gk:()=>m});var r=n(6540),o=n(8193),a=n(2303),i=n(205),s=n(9532),l=n(4848);const c=r.createContext(void 0);function u(e){let{children:t}=e;const n=function(){const e=(0,r.useRef)(!0);return(0,r.useMemo)((()=>({scrollEventsEnabledRef:e,enableScrollEvents:()=>{e.current=!0},disableScrollEvents:()=>{e.current=!1}})),[])}();return(0,l.jsx)(c.Provider,{value:n,children:t})}function d(){const e=(0,r.useContext)(c);if(null==e)throw new s.dV("ScrollControllerProvider");return e}const p=()=>o.A.canUseDOM?{scrollX:window.pageXOffset,scrollY:window.pageYOffset}:null;function f(e,t){void 0===t&&(t=[]);const{scrollEventsEnabledRef:n}=d(),o=(0,r.useRef)(p()),a=(0,s._q)(e);(0,r.useEffect)((()=>{const e=()=>{if(!n.current)return;const e=p();a(e,o.current),o.current=e},t={passive:!0};return e(),window.addEventListener("scroll",e,t),()=>window.removeEventListener("scroll",e,t)}),[a,n,...t])}function g(){const e=d(),t=function(){const e=(0,r.useRef)({elem:null,top:0}),t=(0,r.useCallback)((t=>{e.current={elem:t,top:t.getBoundingClientRect().top}}),[]),n=(0,r.useCallback)((()=>{const{current:{elem:t,top:n}}=e;if(!t)return{restored:!1};const r=t.getBoundingClientRect().top-n;return r&&window.scrollBy({left:0,top:r}),e.current={elem:null,top:0},{restored:0!==r}}),[]);return(0,r.useMemo)((()=>({save:t,restore:n})),[n,t])}(),n=(0,r.useRef)(void 0),o=(0,r.useCallback)((r=>{t.save(r),e.disableScrollEvents(),n.current=()=>{const{restored:r}=t.restore();if(n.current=void 0,r){const t=()=>{e.enableScrollEvents(),window.removeEventListener("scroll",t)};window.addEventListener("scroll",t)}else e.enableScrollEvents()}}),[e,t]);return(0,i.A)((()=>{queueMicrotask((()=>n.current?.()))})),{blockElementScrollPositionUntilNextRender:o}}function m(){const e=(0,r.useRef)(null),t=(0,a.A)()&&"smooth"===getComputedStyle(document.documentElement).scrollBehavior;return{startScroll:n=>{e.current=t?function(e){return window.scrollTo({top:e,behavior:"smooth"}),()=>{}}(n):function(e){let t=null;const n=document.documentElement.scrollTop>e;return function r(){const o=document.documentElement.scrollTop;(n&&o>e||!n&&o t&&cancelAnimationFrame(t)}(n)},cancelScroll:()=>e.current?.()}}},679:(e,t,n)=>{"use strict";n.d(t,{Wf:()=>u,Dv:()=>d});var r=n(6540);const o=JSON.parse('{"N":"localStorage","M":""}'),a=o.N;function i(e){let{key:t,oldValue:n,newValue:r,storage:o}=e;if(n===r)return;const a=document.createEvent("StorageEvent");a.initStorageEvent("storage",!1,!1,t,n,r,window.location.href,o),window.dispatchEvent(a)}function s(e){if(void 0===e&&(e=a),"undefined"==typeof window)throw new Error("Browser storage is not available on Node.js/Docusaurus SSR process.");if("none"===e)return null;try{return window[e]}catch(n){return t=n,l||(console.warn("Docusaurus browser storage is not available.\nPossible reasons: running Docusaurus in an iframe, in an incognito browser session, or using too strict browser privacy settings.",t),l=!0),null}var t}let l=!1;const c={get:()=>null,set:()=>{},del:()=>{},listen:()=>()=>{}};function u(e,t){const n=`${e}${o.M}`;if("undefined"==typeof window)return function(e){function t(){throw new Error(`Illegal storage API usage for storage key "${e}".\nDocusaurus storage APIs are not supposed to be called on the server-rendering process.\nPlease only call storage APIs in effects and event handlers.`)}return{get:t,set:t,del:t,listen:t}}(n);const r=s(t?.persistence);return null===r?c:{get:()=>{try{return r.getItem(n)}catch(e){return console.error(`Docusaurus storage error, can't get key=${n}`,e),null}},set:e=>{try{const t=r.getItem(n);r.setItem(n,e),i({key:n,oldValue:t,newValue:e,storage:r})}catch(t){console.error(`Docusaurus storage error, can't set ${n}=${e}`,t)}},del:()=>{try{const e=r.getItem(n);r.removeItem(n),i({key:n,oldValue:e,newValue:null,storage:r})}catch(e){console.error(`Docusaurus storage error, can't delete key=${n}`,e)}},listen:e=>{try{const t=t=>{t.storageArea===r&&t.key===n&&e(t)};return window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)}catch(t){return console.error(`Docusaurus storage error, can't listen for changes of key=${n}`,t),()=>{}}}}}function d(e,t){const n=(0,r.useRef)((()=>null===e?c:u(e,t))).current(),o=(0,r.useCallback)((e=>"undefined"==typeof window?()=>{}:n.listen(e)),[n]);return[(0,r.useSyncExternalStore)(o,(()=>n.get()),(()=>null)),n]}},2131:(e,t,n)=>{"use strict";n.d(t,{o:()=>i});var r=n(4586),o=n(6347),a=n(440);function i(){const{siteConfig:{baseUrl:e,url:t,trailingSlash:n},i18n:{defaultLocale:i,currentLocale:s}}=(0,r.A)(),{pathname:l}=(0,o.zy)(),c=(0,a.Ks)(l,{trailingSlash:n,baseUrl:e}),u=s===i?e:e.replace(`/${s}/`,"/"),d=c.replace(e,"");return{createUrl:function(e){let{locale:n,fullyQualified:r}=e;return`${r?t:""}${function(e){return e===i?`${u}`:`${u}${e}/`}(n)}${d}`}}}},5062:(e,t,n)=>{"use strict";n.d(t,{$:()=>i});var r=n(6540),o=n(6347),a=n(9532);function i(e){const t=(0,o.zy)(),n=(0,a.ZC)(t),i=(0,a._q)(e);(0,r.useEffect)((()=>{n&&t!==n&&i({location:t,previousLocation:n})}),[i,t,n])}},6342:(e,t,n)=>{"use strict";n.d(t,{p:()=>o});var r=n(4586);function o(){return(0,r.A)().siteConfig.themeConfig}},2983:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addTrailingSlash=o,t.default=function(e,t){const{trailingSlash:n,baseUrl:r}=t;if(e.startsWith("#"))return e;if(void 0===n)return e;const[i]=e.split(/[#?]/),s="/"===i||i===r?i:(l=i,c=n,c?o(l):a(l));var l,c;return e.replace(i,s)},t.addLeadingSlash=function(e){return(0,r.addPrefix)(e,"/")},t.removeTrailingSlash=a;const r=n(2566);function o(e){return e.endsWith("/")?e:`${e}/`}function a(e){return(0,r.removeSuffix)(e,"/")}},253:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCausalChain=function e(t){if(t.cause)return[t,...e(t.cause)];return[t]}},440:(e,t,n)=>{"use strict";t.rA=t.Ks=t.LU=void 0;const r=n(1635);t.LU="__blog-post-container";var o=n(2983);Object.defineProperty(t,"Ks",{enumerable:!0,get:function(){return r.__importDefault(o).default}});var a=n(2566);var i=n(253);Object.defineProperty(t,"rA",{enumerable:!0,get:function(){return i.getErrorCausalChain}})},2566:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addPrefix=function(e,t){return e.startsWith(t)?e:`${t}${e}`},t.removeSuffix=function(e,t){if(""===t)return e;return e.endsWith(t)?e.slice(0,-t.length):e},t.addSuffix=function(e,t){return e.endsWith(t)?e:`${e}${t}`},t.removePrefix=function(e,t){return e.startsWith(t)?e.slice(t.length):e}},2849:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});n(6540);var r=n(4164);const o={loadingRing:"loadingRing_RJI3","loading-ring":"loading-ring_FB5o"};var a=n(4848);function i(e){let{className:t}=e;return(0,a.jsxs)("div",{className:(0,r.A)(o.loadingRing,t),children:[(0,a.jsx)("div",{}),(0,a.jsx)("div",{}),(0,a.jsx)("div",{}),(0,a.jsx)("div",{})]})}},9153:(e,t,n)=>{"use strict";n.d(t,{k:()=>E,w:()=>C});const r=Symbol("Comlink.proxy"),o=Symbol("Comlink.endpoint"),a=Symbol("Comlink.releaseProxy"),i=Symbol("Comlink.finalizer"),s=Symbol("Comlink.thrown"),l=e=>"object"==typeof e&&null!==e||"function"==typeof e,c=new Map([["proxy",{canHandle:e=>l(e)&&e[r],serialize(e){const{port1:t,port2:n}=new MessageChannel;return u(e,t),[n,[n]]},deserialize:e=>(e.start(),p(e))}],["throw",{canHandle:e=>l(e)&&s in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function u(e,t=globalThis,n=["*"]){t.addEventListener("message",(function o(a){if(!a||!a.data)return;if(!function(e,t){for(const n of e){if(t===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}return!1}(n,a.origin))return void console.warn(`Invalid origin '${a.origin}' for comlink proxy`);const{id:l,type:c,path:p}=Object.assign({path:[]},a.data),f=(a.data.argumentList||[]).map(k);let g;try{const t=p.slice(0,-1).reduce(((e,t)=>e[t]),e),n=p.reduce(((e,t)=>e[t]),e);switch(c){case"GET":g=n;break;case"SET":t[p.slice(-1)[0]]=k(a.data.value),g=!0;break;case"APPLY":g=n.apply(t,f);break;case"CONSTRUCT":g=function(e){return Object.assign(e,{[r]:!0})}(new n(...f));break;case"ENDPOINT":{const{port1:t,port2:n}=new MessageChannel;u(e,n),g=function(e,t){return v.set(e,t),e}(t,[t])}break;case"RELEASE":g=void 0;break;default:return}}catch(m){g={value:m,[s]:0}}Promise.resolve(g).catch((e=>({value:e,[s]:0}))).then((n=>{const[r,a]=w(n);t.postMessage(Object.assign(Object.assign({},r),{id:l}),a),"RELEASE"===c&&(t.removeEventListener("message",o),d(t),i in e&&"function"==typeof e[i]&&e[i]())})).catch((e=>{const[n,r]=w({value:new TypeError("Unserializable return value"),[s]:0});t.postMessage(Object.assign(Object.assign({},n),{id:l}),r)}))})),t.start&&t.start()}function d(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function p(e,t){const n=new Map;return e.addEventListener("message",(function(e){const{data:t}=e;if(!t||!t.id)return;const r=n.get(t.id);if(r)try{r(t)}finally{n.delete(t.id)}})),y(e,n,[],t)}function f(e){if(e)throw new Error("Proxy has been released and is not useable")}function g(e){return x(e,new Map,{type:"RELEASE"}).then((()=>{d(e)}))}const m=new WeakMap,h="FinalizationRegistry"in globalThis&&new FinalizationRegistry((e=>{const t=(m.get(e)||0)-1;m.set(e,t),0===t&&g(e)}));function y(e,t,n=[],r=function(){}){let i=!1;const s=new Proxy(r,{get(r,o){if(f(i),o===a)return()=>{!function(e){h&&h.unregister(e)}(s),g(e),t.clear(),i=!0};if("then"===o){if(0===n.length)return{then:()=>s};const r=x(e,t,{type:"GET",path:n.map((e=>e.toString()))}).then(k);return r.then.bind(r)}return y(e,t,[...n,o])},set(r,o,a){f(i);const[s,l]=w(a);return x(e,t,{type:"SET",path:[...n,o].map((e=>e.toString())),value:s},l).then(k)},apply(r,a,s){f(i);const l=n[n.length-1];if(l===o)return x(e,t,{type:"ENDPOINT"}).then(k);if("bind"===l)return y(e,t,n.slice(0,-1));const[c,u]=b(s);return x(e,t,{type:"APPLY",path:n.map((e=>e.toString())),argumentList:c},u).then(k)},construct(r,o){f(i);const[a,s]=b(o);return x(e,t,{type:"CONSTRUCT",path:n.map((e=>e.toString())),argumentList:a},s).then(k)}});return function(e,t){const n=(m.get(t)||0)+1;m.set(t,n),h&&h.register(e,t,e)}(s,e),s}function b(e){const t=e.map(w);return[t.map((e=>e[0])),(n=t.map((e=>e[1])),Array.prototype.concat.apply([],n))];var n}const v=new WeakMap;function w(e){for(const[t,n]of c)if(n.canHandle(e)){const[r,o]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},o]}return[{type:"RAW",value:e},v.get(e)||[]]}function k(e){switch(e.type){case"HANDLER":return c.get(e.name).deserialize(e.value);case"RAW":return e.value}}function x(e,t,n,r){return new Promise((o=>{const a=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");t.set(a,o),e.start&&e.start(),e.postMessage(Object.assign({id:a},n),r)}))}let S;function _(){return S||(S=(async()=>{const e=p(new Worker(new URL(n.p+n.u(4809),n.b)));return await new e})()),S}async function E(e,t){{const n=await _();await n.fetchIndexes(e,t)}}async function C(e,t,n){return(await _()).search(e,t,n)}},4471:(e,t,n)=>{"use strict";function r(e){return e.join(" \u203a ")}n.d(t,{$:()=>r})},3103:(e,t,n)=>{"use strict";function r(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}n.d(t,{Z:()=>r})},7674:(e,t,n)=>{"use strict";function r(e,t){const n=[];for(const r of Object.values(e))r[t]&&n.push(...r[t].position);return n.sort(((e,t)=>e[0]-t[0]||t[1]-e[1]))}n.d(t,{g:()=>r})},6841:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(3103);function o(e,t,n){const a=[];for(const i of t){const n=e.toLowerCase().indexOf(i);if(n>=0){n>0&&a.push(o(e.substr(0,n),t)),a.push(`${(0,r.Z)(e.substr(n,i.length))}`);const s=n+i.length;s ${(0,r.Z)(e)}`:(0,r.Z)(e):a.join("")}},3810:(e,t,n)=>{"use strict";n.d(t,{C:()=>l});var r=n(3103),o=n(6841);const a=/\w+|\p{Unified_Ideograph}/u;function i(e){const t=[];let n=0,r=e;for(;r.length>0;){const o=r.match(a);if(!o){t.push(r);break}o.index>0&&t.push(r.substring(0,o.index)),t.push(o[0]),n+=o.index+o[0].length,r=e.substring(n)}return t}var s=n(4081);function l(e,t,n,a){void 0===a&&(a=s.rG);const{chunkIndex:l,chunks:c}=function(e,t,n){const a=[];let s=0,l=0,c=-1;for(;s l){const t=i(e.substring(l,u)).map((e=>({html:(0,r.Z)(e),textLength:e.length})));for(const e of t)a.push(e)}-1===c&&(c=a.length),l=u+d,a.push({html:(0,o.Z)(e.substring(u,l),n,!0),textLength:d})}}if(l ({html:(0,r.Z)(e),textLength:e.length})));for(const e of t)a.push(e)}return{chunkIndex:c,chunks:a}}(e,t,n),u=c.slice(0,l),d=c[l],p=[d.html],f=c.slice(l+1);let g=d.textLength,m=0,h=0,y=!1,b=!1;for(;g0){const e=u.pop();g+e.textLength<=a?(p.unshift(e.html),m+=e.textLength,g+=e.textLength):(y=!0,u.length=0)}else{if(!(f.length>0))break;{const e=f.shift();g+e.textLength<=a?(p.push(e.html),h+=e.textLength,g+=e.textLength):(b=!0,f.length=0)}}return(y||u.length>0)&&p.unshift("\u2026"),(b||f.length>0)&&p.push("\u2026"),p.join("")}},3385:(e,t,n)=>{"use strict";function r(e,t){if("string"==typeof e)return{label:e,path:e};{const{label:n,path:r}=e;return"string"==typeof n?{label:n,path:r}:Object.prototype.hasOwnProperty.call(n,t)?{label:n[t],path:r}:{label:r,path:r}}}n.d(t,{p:()=>r})},9913:(e,t,n)=>{"use strict";var r;n.d(t,{i:()=>r}),function(e){e[e.Title=0]="Title",e[e.Heading=1]="Heading",e[e.Description=2]="Description",e[e.Keywords=3]="Keywords",e[e.Content=4]="Content"}(r||(r={}))},1513:(e,t,n)=>{"use strict";n.d(t,{zR:()=>w,TM:()=>C,yJ:()=>f,sC:()=>T,AO:()=>p});var r=n(8168);function o(e){return"/"===e.charAt(0)}function a(e,t){for(var n=t,r=n+1,o=e.length;r =0;p--){var f=i[p];"."===f?a(i,p):".."===f?(a(i,p),d++):d&&(a(i,p),d--)}if(!c)for(;d--;d)i.unshift("..");!c||""===i[0]||i[0]&&o(i[0])||i.unshift("");var g=i.join("/");return n&&"/"!==g.substr(-1)&&(g+="/"),g};var s=n(1561);function l(e){return"/"===e.charAt(0)?e:"/"+e}function c(e){return"/"===e.charAt(0)?e.substr(1):e}function u(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function d(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function p(e){var t=e.pathname,n=e.search,r=e.hash,o=t||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}function f(e,t,n,o){var a;"string"==typeof e?(a=function(e){var t=e||"/",n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substr(o),t=t.substr(0,o));var a=t.indexOf("?");return-1!==a&&(n=t.substr(a),t=t.substr(0,a)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e),a.state=t):(void 0===(a=(0,r.A)({},e)).pathname&&(a.pathname=""),a.search?"?"!==a.search.charAt(0)&&(a.search="?"+a.search):a.search="",a.hash?"#"!==a.hash.charAt(0)&&(a.hash="#"+a.hash):a.hash="",void 0!==t&&void 0===a.state&&(a.state=t));try{a.pathname=decodeURI(a.pathname)}catch(s){throw s instanceof URIError?new URIError('Pathname "'+a.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):s}return n&&(a.key=n),o?a.pathname?"/"!==a.pathname.charAt(0)&&(a.pathname=i(a.pathname,o.pathname)):a.pathname=o.pathname:a.pathname||(a.pathname="/"),a}function g(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,o){if(null!=e){var a="function"==typeof e?e(t,n):e;"string"==typeof a?"function"==typeof r?r(a,o):o(!0):o(!1!==a)}else o(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r t?n.splice(t,n.length-t,o):n.push(o),d({action:r,location:o,index:t,entries:n})}}))},replace:function(e,t){var r="REPLACE",o=f(e,t,m(),w.location);u.confirmTransitionTo(o,r,n,(function(e){e&&(w.entries[w.index]=o,d({action:r,location:o}))}))},go:v,goBack:function(){v(-1)},goForward:function(){v(1)},canGo:function(e){var t=w.index+e;return t>=0&&t {"use strict";var r=n(4363),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?i:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=i;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,g=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(g){var o=f(n);o&&o!==g&&e(t,o,r)}var i=u(n);d&&(i=i.concat(d(n)));for(var s=l(t),m=l(n),h=0;h {"use strict";e.exports=function(e,t,n,r,o,a,i,s){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,a,i,s],u=0;(l=new Error(t.replace(/%s/g,(function(){return c[u++]})))).name="Invariant Violation"}throw l.framesToPop=1,l}}},4634:e=>{e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},119:(e,t,n)=>{"use strict";n.r(t)},5947:function(e,t,n){var r,o;r=function(){var e,t,n={version:"0.2.0"},r=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:' '};function o(e,t,n){return en?n:e}function a(e){return 100*(-1+e)}function i(e,t,n){var o;return(o="translate3d"===r.positionUsing?{transform:"translate3d("+a(e)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+a(e)+"%,0)"}:{"margin-left":a(e)+"%"}).transition="all "+t+"ms "+n,o}n.configure=function(e){var t,n;for(t in e)void 0!==(n=e[t])&&e.hasOwnProperty(t)&&(r[t]=n);return this},n.status=null,n.set=function(e){var t=n.isStarted();e=o(e,r.minimum,1),n.status=1===e?null:e;var a=n.render(!t),c=a.querySelector(r.barSelector),u=r.speed,d=r.easing;return a.offsetWidth,s((function(t){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),l(c,i(e,u,d)),1===e?(l(a,{transition:"none",opacity:1}),a.offsetWidth,setTimeout((function(){l(a,{transition:"all "+u+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),u)}),u)):setTimeout(t,u)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var e=function(){setTimeout((function(){n.status&&(n.trickle(),e())}),r.trickleSpeed)};return r.trickle&&e(),this},n.done=function(e){return e||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(e){var t=n.status;return t?("number"!=typeof e&&(e=(1-t)*o(Math.random()*t,.1,.95)),t=o(t+e,0,.994),n.set(t)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},e=0,t=0,n.promise=function(r){return r&&"resolved"!==r.state()?(0===t&&n.start(),e++,t++,r.always((function(){0==--t?(e=0,n.done()):n.set((e-t)/e)})),this):this},n.render=function(e){if(n.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=r.template;var o,i=t.querySelector(r.barSelector),s=e?"-100":a(n.status||0),c=document.querySelector(r.parent);return l(i,{transition:"all 0 linear",transform:"translate3d("+s+"%,0,0)"}),r.showSpinner||(o=t.querySelector(r.spinnerSelector))&&f(o),c!=document.body&&u(c,"nprogress-custom-parent"),c.appendChild(t),t},n.remove=function(){d(document.documentElement,"nprogress-busy"),d(document.querySelector(r.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&f(e)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var s=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),l=function(){var e=["Webkit","O","Moz","ms"],t={};function n(e){return e.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()}))}function r(t){var n=document.body.style;if(t in n)return t;for(var r,o=e.length,a=t.charAt(0).toUpperCase()+t.slice(1);o--;)if((r=e[o]+a)in n)return r;return t}function o(e){return e=n(e),t[e]||(t[e]=r(e))}function a(e,t,n){t=o(t),e.style[t]=n}return function(e,t){var n,r,o=arguments;if(2==o.length)for(n in t)void 0!==(r=t[n])&&t.hasOwnProperty(n)&&a(e,n,r);else a(e,o[1],o[2])}}();function c(e,t){return("string"==typeof e?e:p(e)).indexOf(" "+t+" ")>=0}function u(e,t){var n=p(e),r=n+t;c(n,t)||(e.className=r.substring(1))}function d(e,t){var n,r=p(e);c(e,t)&&(n=r.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function p(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function f(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return n},void 0===(o="function"==typeof r?r.call(t,n,t,e):r)||(e.exports=o)},5302:(e,t,n)=>{var r=n(4634);e.exports=g,e.exports.parse=a,e.exports.compile=function(e,t){return l(a(e,t),t)},e.exports.tokensToFunction=l,e.exports.tokensToRegExp=f;var o=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function a(e,t){for(var n,r=[],a=0,s=0,l="",c=t&&t.delimiter||"/";null!=(n=o.exec(e));){var d=n[0],p=n[1],f=n.index;if(l+=e.slice(s,f),s=f+d.length,p)l+=p[1];else{var g=e[s],m=n[2],h=n[3],y=n[4],b=n[5],v=n[6],w=n[7];l&&(r.push(l),l="");var k=null!=m&&null!=g&&g!==m,x="+"===v||"*"===v,S="?"===v||"*"===v,_=m||c,E=y||b,C=m||("string"==typeof r[r.length-1]?r[r.length-1]:"");r.push({name:h||a++,prefix:m||"",delimiter:_,optional:S,repeat:x,partial:k,asterisk:!!w,pattern:E?u(E):w?".*":i(_,C)})}}return s -1?"[^"+c(e)+"]+?":c(t)+"|(?:(?!"+c(t)+")[^"+c(e)+"])+?"}function s(e){return encodeURI(e).replace(/[\/?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}function l(e,t){for(var n=new Array(e.length),o=0;o {e.exports&&(e.exports={core:{meta:{path:"components/prism-core.js",option:"mandatory"},core:"Core"},themes:{meta:{path:"themes/{id}.css",link:"index.html?theme={id}",exclusive:!0},prism:{title:"Default",option:"default"},"prism-dark":"Dark","prism-funky":"Funky","prism-okaidia":{title:"Okaidia",owner:"ocodia"},"prism-twilight":{title:"Twilight",owner:"remybach"},"prism-coy":{title:"Coy",owner:"tshedor"},"prism-solarizedlight":{title:"Solarized Light",owner:"hectormatos2011 "},"prism-tomorrow":{title:"Tomorrow Night",owner:"Rosey"}},languages:{meta:{path:"components/prism-{id}",noCSS:!0,examplesPath:"examples/prism-{id}",addCheckAll:!0},markup:{title:"Markup",alias:["html","xml","svg","mathml","ssml","atom","rss"],aliasTitles:{html:"HTML",xml:"XML",svg:"SVG",mathml:"MathML",ssml:"SSML",atom:"Atom",rss:"RSS"},option:"default"},css:{title:"CSS",option:"default",modify:"markup"},clike:{title:"C-like",option:"default"},javascript:{title:"JavaScript",require:"clike",modify:"markup",optional:"regex",alias:"js",option:"default"},abap:{title:"ABAP",owner:"dellagustin"},abnf:{title:"ABNF",owner:"RunDevelopment"},actionscript:{title:"ActionScript",require:"javascript",modify:"markup",owner:"Golmote"},ada:{title:"Ada",owner:"Lucretia"},agda:{title:"Agda",owner:"xy-ren"},al:{title:"AL",owner:"RunDevelopment"},antlr4:{title:"ANTLR4",alias:"g4",owner:"RunDevelopment"},apacheconf:{title:"Apache Configuration",owner:"GuiTeK"},apex:{title:"Apex",require:["clike","sql"],owner:"RunDevelopment"},apl:{title:"APL",owner:"ngn"},applescript:{title:"AppleScript",owner:"Golmote"},aql:{title:"AQL",owner:"RunDevelopment"},arduino:{title:"Arduino",require:"cpp",alias:"ino",owner:"dkern"},arff:{title:"ARFF",owner:"Golmote"},armasm:{title:"ARM Assembly",alias:"arm-asm",owner:"RunDevelopment"},arturo:{title:"Arturo",alias:"art",optional:["bash","css","javascript","markup","markdown","sql"],owner:"drkameleon"},asciidoc:{alias:"adoc",title:"AsciiDoc",owner:"Golmote"},aspnet:{title:"ASP.NET (C#)",require:["markup","csharp"],owner:"nauzilus"},asm6502:{title:"6502 Assembly",owner:"kzurawel"},asmatmel:{title:"Atmel AVR Assembly",owner:"cerkit"},autohotkey:{title:"AutoHotkey",owner:"aviaryan"},autoit:{title:"AutoIt",owner:"Golmote"},avisynth:{title:"AviSynth",alias:"avs",owner:"Zinfidel"},"avro-idl":{title:"Avro IDL",alias:"avdl",owner:"RunDevelopment"},awk:{title:"AWK",alias:"gawk",aliasTitles:{gawk:"GAWK"},owner:"RunDevelopment"},bash:{title:"Bash",alias:["sh","shell"],aliasTitles:{sh:"Shell",shell:"Shell"},owner:"zeitgeist87"},basic:{title:"BASIC",owner:"Golmote"},batch:{title:"Batch",owner:"Golmote"},bbcode:{title:"BBcode",alias:"shortcode",aliasTitles:{shortcode:"Shortcode"},owner:"RunDevelopment"},bbj:{title:"BBj",owner:"hyyan"},bicep:{title:"Bicep",owner:"johnnyreilly"},birb:{title:"Birb",require:"clike",owner:"Calamity210"},bison:{title:"Bison",require:"c",owner:"Golmote"},bnf:{title:"BNF",alias:"rbnf",aliasTitles:{rbnf:"RBNF"},owner:"RunDevelopment"},bqn:{title:"BQN",owner:"yewscion"},brainfuck:{title:"Brainfuck",owner:"Golmote"},brightscript:{title:"BrightScript",owner:"RunDevelopment"},bro:{title:"Bro",owner:"wayward710"},bsl:{title:"BSL (1C:Enterprise)",alias:"oscript",aliasTitles:{oscript:"OneScript"},owner:"Diversus23"},c:{title:"C",require:"clike",owner:"zeitgeist87"},csharp:{title:"C#",require:"clike",alias:["cs","dotnet"],owner:"mvalipour"},cpp:{title:"C++",require:"c",owner:"zeitgeist87"},cfscript:{title:"CFScript",require:"clike",alias:"cfc",owner:"mjclemente"},chaiscript:{title:"ChaiScript",require:["clike","cpp"],owner:"RunDevelopment"},cil:{title:"CIL",owner:"sbrl"},cilkc:{title:"Cilk/C",require:"c",alias:"cilk-c",owner:"OpenCilk"},cilkcpp:{title:"Cilk/C++",require:"cpp",alias:["cilk-cpp","cilk"],owner:"OpenCilk"},clojure:{title:"Clojure",owner:"troglotit"},cmake:{title:"CMake",owner:"mjrogozinski"},cobol:{title:"COBOL",owner:"RunDevelopment"},coffeescript:{title:"CoffeeScript",require:"javascript",alias:"coffee",owner:"R-osey"},concurnas:{title:"Concurnas",alias:"conc",owner:"jasontatton"},csp:{title:"Content-Security-Policy",owner:"ScottHelme"},cooklang:{title:"Cooklang",owner:"ahue"},coq:{title:"Coq",owner:"RunDevelopment"},crystal:{title:"Crystal",require:"ruby",owner:"MakeNowJust"},"css-extras":{title:"CSS Extras",require:"css",modify:"css",owner:"milesj"},csv:{title:"CSV",owner:"RunDevelopment"},cue:{title:"CUE",owner:"RunDevelopment"},cypher:{title:"Cypher",owner:"RunDevelopment"},d:{title:"D",require:"clike",owner:"Golmote"},dart:{title:"Dart",require:"clike",owner:"Golmote"},dataweave:{title:"DataWeave",owner:"machaval"},dax:{title:"DAX",owner:"peterbud"},dhall:{title:"Dhall",owner:"RunDevelopment"},diff:{title:"Diff",owner:"uranusjr"},django:{title:"Django/Jinja2",require:"markup-templating",alias:"jinja2",owner:"romanvm"},"dns-zone-file":{title:"DNS zone file",owner:"RunDevelopment",alias:"dns-zone"},docker:{title:"Docker",alias:"dockerfile",owner:"JustinBeckwith"},dot:{title:"DOT (Graphviz)",alias:"gv",optional:"markup",owner:"RunDevelopment"},ebnf:{title:"EBNF",owner:"RunDevelopment"},editorconfig:{title:"EditorConfig",owner:"osipxd"},eiffel:{title:"Eiffel",owner:"Conaclos"},ejs:{title:"EJS",require:["javascript","markup-templating"],owner:"RunDevelopment",alias:"eta",aliasTitles:{eta:"Eta"}},elixir:{title:"Elixir",owner:"Golmote"},elm:{title:"Elm",owner:"zwilias"},etlua:{title:"Embedded Lua templating",require:["lua","markup-templating"],owner:"RunDevelopment"},erb:{title:"ERB",require:["ruby","markup-templating"],owner:"Golmote"},erlang:{title:"Erlang",owner:"Golmote"},"excel-formula":{title:"Excel Formula",alias:["xlsx","xls"],owner:"RunDevelopment"},fsharp:{title:"F#",require:"clike",owner:"simonreynolds7"},factor:{title:"Factor",owner:"catb0t"},false:{title:"False",owner:"edukisto"},"firestore-security-rules":{title:"Firestore security rules",require:"clike",owner:"RunDevelopment"},flow:{title:"Flow",require:"javascript",owner:"Golmote"},fortran:{title:"Fortran",owner:"Golmote"},ftl:{title:"FreeMarker Template Language",require:"markup-templating",owner:"RunDevelopment"},gml:{title:"GameMaker Language",alias:"gamemakerlanguage",require:"clike",owner:"LiarOnce"},gap:{title:"GAP (CAS)",owner:"RunDevelopment"},gcode:{title:"G-code",owner:"RunDevelopment"},gdscript:{title:"GDScript",owner:"RunDevelopment"},gedcom:{title:"GEDCOM",owner:"Golmote"},gettext:{title:"gettext",alias:"po",owner:"RunDevelopment"},gherkin:{title:"Gherkin",owner:"hason"},git:{title:"Git",owner:"lgiraudel"},glsl:{title:"GLSL",require:"c",owner:"Golmote"},gn:{title:"GN",alias:"gni",owner:"RunDevelopment"},"linker-script":{title:"GNU Linker Script",alias:"ld",owner:"RunDevelopment"},go:{title:"Go",require:"clike",owner:"arnehormann"},"go-module":{title:"Go module",alias:"go-mod",owner:"RunDevelopment"},gradle:{title:"Gradle",require:"clike",owner:"zeabdelkhalek-badido18"},graphql:{title:"GraphQL",optional:"markdown",owner:"Golmote"},groovy:{title:"Groovy",require:"clike",owner:"robfletcher"},haml:{title:"Haml",require:"ruby",optional:["css","css-extras","coffeescript","erb","javascript","less","markdown","scss","textile"],owner:"Golmote"},handlebars:{title:"Handlebars",require:"markup-templating",alias:["hbs","mustache"],aliasTitles:{mustache:"Mustache"},owner:"Golmote"},haskell:{title:"Haskell",alias:"hs",owner:"bholst"},haxe:{title:"Haxe",require:"clike",optional:"regex",owner:"Golmote"},hcl:{title:"HCL",owner:"outsideris"},hlsl:{title:"HLSL",require:"c",owner:"RunDevelopment"},hoon:{title:"Hoon",owner:"matildepark"},http:{title:"HTTP",optional:["csp","css","hpkp","hsts","javascript","json","markup","uri"],owner:"danielgtaylor"},hpkp:{title:"HTTP Public-Key-Pins",owner:"ScottHelme"},hsts:{title:"HTTP Strict-Transport-Security",owner:"ScottHelme"},ichigojam:{title:"IchigoJam",owner:"BlueCocoa"},icon:{title:"Icon",owner:"Golmote"},"icu-message-format":{title:"ICU Message Format",owner:"RunDevelopment"},idris:{title:"Idris",alias:"idr",owner:"KeenS",require:"haskell"},ignore:{title:".ignore",owner:"osipxd",alias:["gitignore","hgignore","npmignore"],aliasTitles:{gitignore:".gitignore",hgignore:".hgignore",npmignore:".npmignore"}},inform7:{title:"Inform 7",owner:"Golmote"},ini:{title:"Ini",owner:"aviaryan"},io:{title:"Io",owner:"AlesTsurko"},j:{title:"J",owner:"Golmote"},java:{title:"Java",require:"clike",owner:"sherblot"},javadoc:{title:"JavaDoc",require:["markup","java","javadoclike"],modify:"java",optional:"scala",owner:"RunDevelopment"},javadoclike:{title:"JavaDoc-like",modify:["java","javascript","php"],owner:"RunDevelopment"},javastacktrace:{title:"Java stack trace",owner:"RunDevelopment"},jexl:{title:"Jexl",owner:"czosel"},jolie:{title:"Jolie",require:"clike",owner:"thesave"},jq:{title:"JQ",owner:"RunDevelopment"},jsdoc:{title:"JSDoc",require:["javascript","javadoclike","typescript"],modify:"javascript",optional:["actionscript","coffeescript"],owner:"RunDevelopment"},"js-extras":{title:"JS Extras",require:"javascript",modify:"javascript",optional:["actionscript","coffeescript","flow","n4js","typescript"],owner:"RunDevelopment"},json:{title:"JSON",alias:"webmanifest",aliasTitles:{webmanifest:"Web App Manifest"},owner:"CupOfTea696"},json5:{title:"JSON5",require:"json",owner:"RunDevelopment"},jsonp:{title:"JSONP",require:"json",owner:"RunDevelopment"},jsstacktrace:{title:"JS stack trace",owner:"sbrl"},"js-templates":{title:"JS Templates",require:"javascript",modify:"javascript",optional:["css","css-extras","graphql","markdown","markup","sql"],owner:"RunDevelopment"},julia:{title:"Julia",owner:"cdagnino"},keepalived:{title:"Keepalived Configure",owner:"dev-itsheng"},keyman:{title:"Keyman",owner:"mcdurdin"},kotlin:{title:"Kotlin",alias:["kt","kts"],aliasTitles:{kts:"Kotlin Script"},require:"clike",owner:"Golmote"},kumir:{title:"KuMir (\u041a\u0443\u041c\u0438\u0440)",alias:"kum",owner:"edukisto"},kusto:{title:"Kusto",owner:"RunDevelopment"},latex:{title:"LaTeX",alias:["tex","context"],aliasTitles:{tex:"TeX",context:"ConTeXt"},owner:"japborst"},latte:{title:"Latte",require:["clike","markup-templating","php"],owner:"nette"},less:{title:"Less",require:"css",optional:"css-extras",owner:"Golmote"},lilypond:{title:"LilyPond",require:"scheme",alias:"ly",owner:"RunDevelopment"},liquid:{title:"Liquid",require:"markup-templating",owner:"cinhtau"},lisp:{title:"Lisp",alias:["emacs","elisp","emacs-lisp"],owner:"JuanCaicedo"},livescript:{title:"LiveScript",owner:"Golmote"},llvm:{title:"LLVM IR",owner:"porglezomp"},log:{title:"Log file",optional:"javastacktrace",owner:"RunDevelopment"},lolcode:{title:"LOLCODE",owner:"Golmote"},lua:{title:"Lua",owner:"Golmote"},magma:{title:"Magma (CAS)",owner:"RunDevelopment"},makefile:{title:"Makefile",owner:"Golmote"},markdown:{title:"Markdown",require:"markup",optional:"yaml",alias:"md",owner:"Golmote"},"markup-templating":{title:"Markup templating",require:"markup",owner:"Golmote"},mata:{title:"Mata",owner:"RunDevelopment"},matlab:{title:"MATLAB",owner:"Golmote"},maxscript:{title:"MAXScript",owner:"RunDevelopment"},mel:{title:"MEL",owner:"Golmote"},mermaid:{title:"Mermaid",owner:"RunDevelopment"},metafont:{title:"METAFONT",owner:"LaeriExNihilo"},mizar:{title:"Mizar",owner:"Golmote"},mongodb:{title:"MongoDB",owner:"airs0urce",require:"javascript"},monkey:{title:"Monkey",owner:"Golmote"},moonscript:{title:"MoonScript",alias:"moon",owner:"RunDevelopment"},n1ql:{title:"N1QL",owner:"TMWilds"},n4js:{title:"N4JS",require:"javascript",optional:"jsdoc",alias:"n4jsd",owner:"bsmith-n4"},"nand2tetris-hdl":{title:"Nand To Tetris HDL",owner:"stephanmax"},naniscript:{title:"Naninovel Script",owner:"Elringus",alias:"nani"},nasm:{title:"NASM",owner:"rbmj"},neon:{title:"NEON",owner:"nette"},nevod:{title:"Nevod",owner:"nezaboodka"},nginx:{title:"nginx",owner:"volado"},nim:{title:"Nim",owner:"Golmote"},nix:{title:"Nix",owner:"Golmote"},nsis:{title:"NSIS",owner:"idleberg"},objectivec:{title:"Objective-C",require:"c",alias:"objc",owner:"uranusjr"},ocaml:{title:"OCaml",owner:"Golmote"},odin:{title:"Odin",owner:"edukisto"},opencl:{title:"OpenCL",require:"c",modify:["c","cpp"],owner:"Milania1"},openqasm:{title:"OpenQasm",alias:"qasm",owner:"RunDevelopment"},oz:{title:"Oz",owner:"Golmote"},parigp:{title:"PARI/GP",owner:"Golmote"},parser:{title:"Parser",require:"markup",owner:"Golmote"},pascal:{title:"Pascal",alias:"objectpascal",aliasTitles:{objectpascal:"Object Pascal"},owner:"Golmote"},pascaligo:{title:"Pascaligo",owner:"DefinitelyNotAGoat"},psl:{title:"PATROL Scripting Language",owner:"bertysentry"},pcaxis:{title:"PC-Axis",alias:"px",owner:"RunDevelopment"},peoplecode:{title:"PeopleCode",alias:"pcode",owner:"RunDevelopment"},perl:{title:"Perl",owner:"Golmote"},php:{title:"PHP",require:"markup-templating",owner:"milesj"},phpdoc:{title:"PHPDoc",require:["php","javadoclike"],modify:"php",owner:"RunDevelopment"},"php-extras":{title:"PHP Extras",require:"php",modify:"php",owner:"milesj"},"plant-uml":{title:"PlantUML",alias:"plantuml",owner:"RunDevelopment"},plsql:{title:"PL/SQL",require:"sql",owner:"Golmote"},powerquery:{title:"PowerQuery",alias:["pq","mscript"],owner:"peterbud"},powershell:{title:"PowerShell",owner:"nauzilus"},processing:{title:"Processing",require:"clike",owner:"Golmote"},prolog:{title:"Prolog",owner:"Golmote"},promql:{title:"PromQL",owner:"arendjr"},properties:{title:".properties",owner:"Golmote"},protobuf:{title:"Protocol Buffers",require:"clike",owner:"just-boris"},pug:{title:"Pug",require:["markup","javascript"],optional:["coffeescript","ejs","handlebars","less","livescript","markdown","scss","stylus","twig"],owner:"Golmote"},puppet:{title:"Puppet",owner:"Golmote"},pure:{title:"Pure",optional:["c","cpp","fortran"],owner:"Golmote"},purebasic:{title:"PureBasic",require:"clike",alias:"pbfasm",owner:"HeX0R101"},purescript:{title:"PureScript",require:"haskell",alias:"purs",owner:"sriharshachilakapati"},python:{title:"Python",alias:"py",owner:"multipetros"},qsharp:{title:"Q#",require:"clike",alias:"qs",owner:"fedonman"},q:{title:"Q (kdb+ database)",owner:"Golmote"},qml:{title:"QML",require:"javascript",owner:"RunDevelopment"},qore:{title:"Qore",require:"clike",owner:"temnroegg"},r:{title:"R",owner:"Golmote"},racket:{title:"Racket",require:"scheme",alias:"rkt",owner:"RunDevelopment"},cshtml:{title:"Razor C#",alias:"razor",require:["markup","csharp"],optional:["css","css-extras","javascript","js-extras"],owner:"RunDevelopment"},jsx:{title:"React JSX",require:["markup","javascript"],optional:["jsdoc","js-extras","js-templates"],owner:"vkbansal"},tsx:{title:"React TSX",require:["jsx","typescript"]},reason:{title:"Reason",require:"clike",owner:"Golmote"},regex:{title:"Regex",owner:"RunDevelopment"},rego:{title:"Rego",owner:"JordanSh"},renpy:{title:"Ren'py",alias:"rpy",owner:"HyuchiaDiego"},rescript:{title:"ReScript",alias:"res",owner:"vmarcosp"},rest:{title:"reST (reStructuredText)",owner:"Golmote"},rip:{title:"Rip",owner:"ravinggenius"},roboconf:{title:"Roboconf",owner:"Golmote"},robotframework:{title:"Robot Framework",alias:"robot",owner:"RunDevelopment"},ruby:{title:"Ruby",require:"clike",alias:"rb",owner:"samflores"},rust:{title:"Rust",owner:"Golmote"},sas:{title:"SAS",optional:["groovy","lua","sql"],owner:"Golmote"},sass:{title:"Sass (Sass)",require:"css",optional:"css-extras",owner:"Golmote"},scss:{title:"Sass (SCSS)",require:"css",optional:"css-extras",owner:"MoOx"},scala:{title:"Scala",require:"java",owner:"jozic"},scheme:{title:"Scheme",owner:"bacchus123"},"shell-session":{title:"Shell session",require:"bash",alias:["sh-session","shellsession"],owner:"RunDevelopment"},smali:{title:"Smali",owner:"RunDevelopment"},smalltalk:{title:"Smalltalk",owner:"Golmote"},smarty:{title:"Smarty",require:"markup-templating",optional:"php",owner:"Golmote"},sml:{title:"SML",alias:"smlnj",aliasTitles:{smlnj:"SML/NJ"},owner:"RunDevelopment"},solidity:{title:"Solidity (Ethereum)",alias:"sol",require:"clike",owner:"glachaud"},"solution-file":{title:"Solution file",alias:"sln",owner:"RunDevelopment"},soy:{title:"Soy (Closure Template)",require:"markup-templating",owner:"Golmote"},sparql:{title:"SPARQL",require:"turtle",owner:"Triply-Dev",alias:"rq"},"splunk-spl":{title:"Splunk SPL",owner:"RunDevelopment"},sqf:{title:"SQF: Status Quo Function (Arma 3)",require:"clike",owner:"RunDevelopment"},sql:{title:"SQL",owner:"multipetros"},squirrel:{title:"Squirrel",require:"clike",owner:"RunDevelopment"},stan:{title:"Stan",owner:"RunDevelopment"},stata:{title:"Stata Ado",require:["mata","java","python"],owner:"RunDevelopment"},iecst:{title:"Structured Text (IEC 61131-3)",owner:"serhioromano"},stylus:{title:"Stylus",owner:"vkbansal"},supercollider:{title:"SuperCollider",alias:"sclang",owner:"RunDevelopment"},swift:{title:"Swift",owner:"chrischares"},systemd:{title:"Systemd configuration file",owner:"RunDevelopment"},"t4-templating":{title:"T4 templating",owner:"RunDevelopment"},"t4-cs":{title:"T4 Text Templates (C#)",require:["t4-templating","csharp"],alias:"t4",owner:"RunDevelopment"},"t4-vb":{title:"T4 Text Templates (VB)",require:["t4-templating","vbnet"],owner:"RunDevelopment"},tap:{title:"TAP",owner:"isaacs",require:"yaml"},tcl:{title:"Tcl",owner:"PeterChaplin"},tt2:{title:"Template Toolkit 2",require:["clike","markup-templating"],owner:"gflohr"},textile:{title:"Textile",require:"markup",optional:"css",owner:"Golmote"},toml:{title:"TOML",owner:"RunDevelopment"},tremor:{title:"Tremor",alias:["trickle","troy"],owner:"darach",aliasTitles:{trickle:"trickle",troy:"troy"}},turtle:{title:"Turtle",alias:"trig",aliasTitles:{trig:"TriG"},owner:"jakubklimek"},twig:{title:"Twig",require:"markup-templating",owner:"brandonkelly"},typescript:{title:"TypeScript",require:"javascript",optional:"js-templates",alias:"ts",owner:"vkbansal"},typoscript:{title:"TypoScript",alias:"tsconfig",aliasTitles:{tsconfig:"TSConfig"},owner:"dkern"},unrealscript:{title:"UnrealScript",alias:["uscript","uc"],owner:"RunDevelopment"},uorazor:{title:"UO Razor Script",owner:"jaseowns"},uri:{title:"URI",alias:"url",aliasTitles:{url:"URL"},owner:"RunDevelopment"},v:{title:"V",require:"clike",owner:"taggon"},vala:{title:"Vala",require:"clike",optional:"regex",owner:"TemplarVolk"},vbnet:{title:"VB.Net",require:"basic",owner:"Bigsby"},velocity:{title:"Velocity",require:"markup",owner:"Golmote"},verilog:{title:"Verilog",owner:"a-rey"},vhdl:{title:"VHDL",owner:"a-rey"},vim:{title:"vim",owner:"westonganger"},"visual-basic":{title:"Visual Basic",alias:["vb","vba"],aliasTitles:{vba:"VBA"},owner:"Golmote"},warpscript:{title:"WarpScript",owner:"RunDevelopment"},wasm:{title:"WebAssembly",owner:"Golmote"},"web-idl":{title:"Web IDL",alias:"webidl",owner:"RunDevelopment"},wgsl:{title:"WGSL",owner:"Dr4gonthree"},wiki:{title:"Wiki markup",require:"markup",owner:"Golmote"},wolfram:{title:"Wolfram language",alias:["mathematica","nb","wl"],aliasTitles:{mathematica:"Mathematica",nb:"Mathematica Notebook"},owner:"msollami"},wren:{title:"Wren",owner:"clsource"},xeora:{title:"Xeora",require:"markup",alias:"xeoracube",aliasTitles:{xeoracube:"XeoraCube"},owner:"freakmaxi"},"xml-doc":{title:"XML doc (.net)",require:"markup",modify:["csharp","fsharp","vbnet"],owner:"RunDevelopment"},xojo:{title:"Xojo (REALbasic)",owner:"Golmote"},xquery:{title:"XQuery",require:"markup",owner:"Golmote"},yaml:{title:"YAML",alias:"yml",owner:"hason"},yang:{title:"YANG",owner:"RunDevelopment"},zig:{title:"Zig",owner:"RunDevelopment"}},plugins:{meta:{path:"plugins/{id}/prism-{id}",link:"plugins/{id}/"},"line-highlight":{title:"Line Highlight",description:"Highlights specific lines and/or line ranges."},"line-numbers":{title:"Line Numbers",description:"Line number at the beginning of code lines.",owner:"kuba-kubula"},"show-invisibles":{title:"Show Invisibles",description:"Show hidden characters such as tabs and line breaks.",optional:["autolinker","data-uri-highlight"]},autolinker:{title:"Autolinker",description:"Converts URLs and emails in code to clickable links. Parses Markdown links in comments."},wpd:{title:"WebPlatform Docs",description:'Makes tokens link to WebPlatform.org documentation. The links open in a new tab.'},"custom-class":{title:"Custom Class",description:"This plugin allows you to prefix Prism's default classes ( .comment
can become.namespace--comment
) or replace them with your defined ones (like.editor__comment
). You can even add new classes.",owner:"dvkndn",noCSS:!0},"file-highlight":{title:"File Highlight",description:"Fetch external files and highlight them with Prism. Used on the Prism website itself.",noCSS:!0},"show-language":{title:"Show Language",description:"Display the highlighted language in code blocks (inline code does not show the label).",owner:"nauzilus",noCSS:!0,require:"toolbar"},"jsonp-highlight":{title:"JSONP Highlight",description:"Fetch content with JSONP and highlight some interesting content (e.g. GitHub/Gists or Bitbucket API).",noCSS:!0,owner:"nauzilus"},"highlight-keywords":{title:"Highlight Keywords",description:"Adds special CSS classes for each keyword for fine-grained highlighting.",owner:"vkbansal",noCSS:!0},"remove-initial-line-feed":{title:"Remove initial line feed",description:"Removes the initial line feed in code blocks.",owner:"Golmote",noCSS:!0},"inline-color":{title:"Inline color",description:"Adds a small inline preview for colors in style sheets.",require:"css-extras",owner:"RunDevelopment"},previewers:{title:"Previewers",description:"Previewers for angles, colors, gradients, easing and time.",require:"css-extras",owner:"Golmote"},autoloader:{title:"Autoloader",description:"Automatically loads the needed languages to highlight the code blocks.",owner:"Golmote",noCSS:!0},"keep-markup":{title:"Keep Markup",description:"Prevents custom markup from being dropped out during highlighting.",owner:"Golmote",optional:"normalize-whitespace",noCSS:!0},"command-line":{title:"Command Line",description:"Display a command line with a prompt and, optionally, the output/response from the commands.",owner:"chriswells0"},"unescaped-markup":{title:"Unescaped Markup",description:"Write markup without having to escape anything."},"normalize-whitespace":{title:"Normalize Whitespace",description:"Supports multiple operations to normalize whitespace in code blocks.",owner:"zeitgeist87",optional:"unescaped-markup",noCSS:!0},"data-uri-highlight":{title:"Data-URI Highlight",description:"Highlights data-URI contents.",owner:"Golmote",noCSS:!0},toolbar:{title:"Toolbar",description:"Attach a toolbar for plugins to easily register buttons on the top of a code block.",owner:"mAAdhaTTah"},"copy-to-clipboard":{title:"Copy to Clipboard Button",description:"Add a button that copies the code block to the clipboard when clicked.",owner:"mAAdhaTTah",require:"toolbar",noCSS:!0},"download-button":{title:"Download Button",description:"A button in the toolbar of a code block adding a convenient way to download a code file.",owner:"Golmote",require:"toolbar",noCSS:!0},"match-braces":{title:"Match braces",description:"Highlights matching braces.",owner:"RunDevelopment"},"diff-highlight":{title:"Diff Highlight",description:"Highlights the code inside diff blocks.",owner:"RunDevelopment",require:"diff"},"filter-highlight-all":{title:"Filter highlightAll",description:"Filters the elements thehighlightAll
andhighlightAllUnder
methods actually highlight.",owner:"RunDevelopment",noCSS:!0},treeview:{title:"Treeview",description:"A language with special styles to highlight file system tree structures.",owner:"Golmote"}}})},8722:(e,t,n)=>{const r=n(6969),o=n(8380),a=new Set;function i(e){void 0===e?e=Object.keys(r.languages).filter((e=>"meta"!=e)):Array.isArray(e)||(e=[e]);const t=[...a,...Object.keys(Prism.languages)];o(r,e,t).load((e=>{if(!(e in r.languages))return void(i.silent||console.warn("Language does not exist: "+e));const t="./prism-"+e;delete n.c[n(3157).resolve(t)],delete Prism.languages[e],n(3157)(t),a.add(e)}))}i.silent=!1,e.exports=i},9700:()=>{!function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,o,a){if(n.language===r){var i=n.tokenStack=[];n.code=n.code.replace(o,(function(e){if("function"==typeof a&&!a(e))return e;for(var o,s=i.length;-1!==n.code.indexOf(o=t(r,s));)++s;return i[s]=e,o})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language===r&&n.tokenStack){n.grammar=e.languages[r];var o=0,a=Object.keys(n.tokenStack);!function i(s){for(var l=0;l=a.length);l++){var c=s[l];if("string"==typeof c||c.content&&"string"==typeof c.content){var u=a[o],d=n.tokenStack[u],p="string"==typeof c?c:c.content,f=t(r,u),g=p.indexOf(f);if(g>-1){++o;var m=p.substring(0,g),h=new e.Token(r,e.tokenize(d,n.grammar),"language-"+r,d),y=p.substring(g+f.length),b=[];m&&b.push.apply(b,i([m])),b.push(h),y&&b.push.apply(b,i([y])),"string"==typeof c?s.splice.apply(s,[l,1].concat(b)):c.content=b}}else c.content&&i(c.content)}return s}(n.tokens)}}}})}(Prism)},8692:(e,t,n)=>{var r={"./":8722};function o(e){var t=a(e);return n(t)}function a(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}o.keys=function(){return Object.keys(r)},o.resolve=a,e.exports=o,o.id=8692},3157:(e,t,n)=>{var r={"./":8722};function o(e){var t=a(e);return n(t)}function a(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}o.keys=function(){return Object.keys(r)},o.resolve=a,e.exports=o,o.id=3157},8380:e=>{"use strict";var t=function(){var e=function(){};function t(e,t){Array.isArray(e)?e.forEach(t):null!=e&&t(e,0)}function n(e){for(var t={},n=0,r=e.length;n "));var s={},l=e[r];if(l){function c(t){if(!(t in e))throw new Error(r+" depends on an unknown component "+t);if(!(t in s))for(var i in o(t,a),s[t]=!0,n[t])s[i]=!0}t(l.require,c),t(l.optional,c),t(l.modify,c)}n[r]=s,a.pop()}}return function(e){var t=n[e];return t||(o(e,r),t=n[e]),t}}function o(e){for(var t in e)return!0;return!1}return function(a,i,s){var l=function(e){var t={};for(var n in e){var r=e[n];for(var o in r)if("meta"!=o){var a=r[o];t[o]="string"==typeof a?{title:a}:a}}return t}(a),c=function(e){var n;return function(r){if(r in e)return r;if(!n)for(var o in n={},e){var a=e[o];t(a&&a.alias,(function(t){if(t in n)throw new Error(t+" cannot be alias for both "+o+" and "+n[t]);if(t in e)throw new Error(t+" cannot be alias of "+o+" because it is a component.");n[t]=o}))}return n[r]||r}}(l);i=i.map(c),s=(s||[]).map(c);var u=n(i),d=n(s);i.forEach((function e(n){var r=l[n];t(r&&r.require,(function(t){t in d||(u[t]=!0,e(t))}))}));for(var p,f=r(l),g=u;o(g);){for(var m in p={},g){var h=l[m];t(h&&h.modify,(function(e){e in d&&(p[e]=!0)}))}for(var y in d)if(!(y in u))for(var b in f(y))if(b in u){p[y]=!0;break}for(var v in g=p)u[v]=!0}var w={getIds:function(){var e=[];return w.load((function(t){e.push(t)})),e},load:function(t,n){return function(t,n,r,o){var a=o?o.series:void 0,i=o?o.parallel:e,s={},l={};function c(e){if(e in s)return s[e];l[e]=!0;var o,u=[];for(var d in t(e))d in n&&u.push(d);if(0===u.length)o=r(e);else{var p=i(u.map((function(e){var t=c(e);return delete l[e],t})));a?o=a(p,(function(){return r(e)})):r(e)}return s[e]=o}for(var u in n)c(u);var d=[];for(var p in l)d.push(s[p]);return i(d)}(f,u,t,n)}};return w}}();e.exports=t},2694:(e,t,n)=>{"use strict";var r=n(6925);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,a,i){if(i!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:o};return n.PropTypes=n,n}},5556:(e,t,n)=>{e.exports=n(2694)()},6925:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},2551:(e,t,n)=>{"use strict";var r=n(6540),o=n(9982);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n t}return!1}(t,n,o,r)&&(n=null),r||null===o?function(e){return!!d.call(g,e)||!d.call(f,e)&&(p.test(e)?g[e]=!0:(f[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=null===n?3!==o.type&&"":n:(t=o.attributeName,r=o.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(o=o.type)||4===o&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(y,b);h[t]=new m(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(y,b);h[t]=new m(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(y,b);h[t]=new m(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){h[e]=new m(e,1,!1,e.toLowerCase(),null,!1,!1)})),h.xlinkHref=new m("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){h[e]=new m(e,1,!1,e.toLowerCase(),null,!0,!0)}));var w=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,k=Symbol.for("react.element"),x=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),C=Symbol.for("react.provider"),A=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),L=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var N=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var O=Symbol.iterator;function D(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=O&&e[O]||e["@@iterator"])?e:null}var I,M=Object.assign;function F(e){if(void 0===I)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);I=t&&t[1]||""}return"\n"+I+e}var z=!1;function B(e,t){if(!e||z)return"";z=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&"string"==typeof c.stack){for(var o=c.stack.split("\n"),a=r.stack.split("\n"),i=o.length-1,s=a.length-1;1<=i&&0<=s&&o[i]!==a[s];)s--;for(;1<=i&&0<=s;i--,s--)if(o[i]!==a[s]){if(1!==i||1!==s)do{if(i--,0>--s||o[i]!==a[s]){var l="\n"+o[i].replace(" at new "," at ");return e.displayName&&l.includes(" ")&&(l=l.replace(" ",e.displayName)),l}}while(1<=i&&0<=s);break}}}finally{z=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?F(e):""}function $(e){switch(e.tag){case 5:return F(e.type);case 16:return F("Lazy");case 13:return F("Suspense");case 19:return F("SuspenseList");case 0:case 2:case 15:return e=B(e.type,!1);case 11:return e=B(e.type.render,!1);case 1:return e=B(e.type,!0);default:return""}}function U(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case S:return"Fragment";case x:return"Portal";case E:return"Profiler";case _:return"StrictMode";case j:return"Suspense";case R:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case A:return(e.displayName||"Context")+".Consumer";case C:return(e._context.displayName||"Context")+".Provider";case T:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case P:return null!==(t=e.displayName||null)?t:U(e.type)||"Memo";case L:t=e._payload,e=e._init;try{return U(e(t))}catch(n){}}return null}function q(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return U(t);case 8:return t===_?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function G(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function H(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function V(e){e._valueTracker||(e._valueTracker=function(e){var t=H(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var o=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){r=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function W(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=H(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function K(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Q(e,t){var n=t.checked;return M({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function Y(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=G(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function Z(e,t){null!=(t=t.checked)&&v(e,"checked",t,!1)}function X(e,t){Z(e,t);var n=G(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?ee(e,t.type,n):t.hasOwnProperty("defaultValue")&&ee(e,t.type,G(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function J(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ee(e,t,n){"number"===t&&K(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var te=Array.isArray;function ne(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o "+t.valueOf().toString()+"",t=ce.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return ue(e,t)}))}:ue);function pe(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var fe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ge=["Webkit","ms","Moz","O"];function me(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||fe.hasOwnProperty(e)&&fe[e]?(""+t).trim():t+"px"}function he(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=me(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}Object.keys(fe).forEach((function(e){ge.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),fe[t]=fe[e]}))}));var ye=M({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function be(e,t){if(t){if(ye[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(a(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(a(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(a(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(a(62))}}function ve(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var we=null;function ke(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var xe=null,Se=null,_e=null;function Ee(e){if(e=wo(e)){if("function"!=typeof xe)throw Error(a(280));var t=e.stateNode;t&&(t=xo(t),xe(e.stateNode,e.type,t))}}function Ce(e){Se?_e?_e.push(e):_e=[e]:Se=e}function Ae(){if(Se){var e=Se,t=_e;if(_e=Se=null,Ee(e),t)for(e=0;e >>=0,0===e?32:31-(st(e)/lt|0)|0},st=Math.log,lt=Math.LN2;var ct=64,ut=4194304;function dt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function pt(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,o=e.suspendedLanes,a=e.pingedLanes,i=268435455&n;if(0!==i){var s=i&~o;0!==s?r=dt(s):0!==(a&=i)&&(r=dt(a))}else 0!==(i=n&~o)?r=dt(i):0!==a&&(r=dt(a));if(0===r)return 0;if(0!==t&&t!==r&&!(t&o)&&((o=r&-r)>=(a=t&-t)||16===o&&4194240&a))return t;if(4&r&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0 n;n++)t.push(e);return t}function yt(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-it(t)]=n}function bt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-it(n),o=1< =Dn),Fn=String.fromCharCode(32),zn=!1;function Bn(e,t){switch(e){case"keyup":return-1!==Nn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $n(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Un=!1;var qn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Gn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!qn[e.type]:"textarea"===t}function Hn(e,t,n,r){Ce(r),0<(t=Vr(t,"onChange")).length&&(n=new un("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Vn=null,Wn=null;function Kn(e){Fr(e,0)}function Qn(e){if(W(ko(e)))return e}function Yn(e,t){if("change"===e)return t}var Zn=!1;if(u){var Xn;if(u){var Jn="oninput"in document;if(!Jn){var er=document.createElement("div");er.setAttribute("oninput","return;"),Jn="function"==typeof er.oninput}Xn=Jn}else Xn=!1;Zn=Xn&&(!document.documentMode||9 =t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=cr(r)}}function dr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?dr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function pr(){for(var e=window,t=K();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=K((e=t.contentWindow).document)}return t}function fr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function gr(e){var t=pr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&dr(n.ownerDocument.documentElement,n)){if(null!==r&&fr(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var o=n.textContent.length,a=Math.min(r.start,o);r=void 0===r.end?a:Math.min(r.end,o),!e.extend&&a>r&&(o=r,r=a,a=o),o=ur(n,a);var i=ur(n,r);o&&i&&(1!==e.rangeCount||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&((t=t.createRange()).setStart(o.node,o.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;n =document.documentMode,hr=null,yr=null,br=null,vr=!1;function wr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;vr||null==hr||hr!==K(r)||("selectionStart"in(r=hr)&&fr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},br&&lr(br,r)||(br=r,0<(r=Vr(yr,"onSelect")).length&&(t=new un("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=hr)))}function kr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var xr={animationend:kr("Animation","AnimationEnd"),animationiteration:kr("Animation","AnimationIteration"),animationstart:kr("Animation","AnimationStart"),transitionend:kr("Transition","TransitionEnd")},Sr={},_r={};function Er(e){if(Sr[e])return Sr[e];if(!xr[e])return e;var t,n=xr[e];for(t in n)if(n.hasOwnProperty(t)&&t in _r)return Sr[e]=n[t];return e}u&&(_r=document.createElement("div").style,"AnimationEvent"in window||(delete xr.animationend.animation,delete xr.animationiteration.animation,delete xr.animationstart.animation),"TransitionEvent"in window||delete xr.transitionend.transition);var Cr=Er("animationend"),Ar=Er("animationiteration"),Tr=Er("animationstart"),jr=Er("transitionend"),Rr=new Map,Pr="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Lr(e,t){Rr.set(e,t),l(t,[e])}for(var Nr=0;Nr _o||(e.current=So[_o],So[_o]=null,_o--)}function Ao(e,t){_o++,So[_o]=e.current,e.current=t}var To={},jo=Eo(To),Ro=Eo(!1),Po=To;function Lo(e,t){var n=e.type.contextTypes;if(!n)return To;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,a={};for(o in n)a[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function No(e){return null!=(e=e.childContextTypes)}function Oo(){Co(Ro),Co(jo)}function Do(e,t,n){if(jo.current!==To)throw Error(a(168));Ao(jo,t),Ao(Ro,n)}function Io(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var o in r=r.getChildContext())if(!(o in t))throw Error(a(108,q(e)||"Unknown",o));return M({},n,r)}function Mo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||To,Po=jo.current,Ao(jo,e),Ao(Ro,Ro.current),!0}function Fo(e,t,n){var r=e.stateNode;if(!r)throw Error(a(169));n?(e=Io(e,t,Po),r.__reactInternalMemoizedMergedChildContext=e,Co(Ro),Co(jo),Ao(jo,e)):Co(Ro),Ao(Ro,n)}var zo=null,Bo=!1,$o=!1;function Uo(e){null===zo?zo=[e]:zo.push(e)}function qo(){if(!$o&&null!==zo){$o=!0;var e=0,t=vt;try{var n=zo;for(vt=1;e >=i,o-=i,Zo=1<<32-it(t)+o|n< m?(h=d,d=null):h=d.sibling;var y=f(o,d,s[m],l);if(null===y){null===d&&(d=h);break}e&&d&&null===y.alternate&&t(o,d),a=i(y,a,m),null===u?c=y:u.sibling=y,u=y,d=h}if(m===s.length)return n(o,d),aa&&Jo(o,m),c;if(null===d){for(;m h?(y=m,m=null):y=m.sibling;var v=f(o,m,b.value,c);if(null===v){null===m&&(m=y);break}e&&m&&null===v.alternate&&t(o,m),s=i(v,s,h),null===d?u=v:d.sibling=v,d=v,m=y}if(b.done)return n(o,m),aa&&Jo(o,h),u;if(null===m){for(;!b.done;h++,b=l.next())null!==(b=p(o,b.value,c))&&(s=i(b,s,h),null===d?u=b:d.sibling=b,d=b);return aa&&Jo(o,h),u}for(m=r(o,m);!b.done;h++,b=l.next())null!==(b=g(m,o,h,b.value,c))&&(e&&null!==b.alternate&&m.delete(null===b.key?h:b.key),s=i(b,s,h),null===d?u=b:d.sibling=b,d=b);return e&&m.forEach((function(e){return t(o,e)})),aa&&Jo(o,h),u}return function e(r,a,i,l){if("object"==typeof i&&null!==i&&i.type===S&&null===i.key&&(i=i.props.children),"object"==typeof i&&null!==i){switch(i.$$typeof){case k:e:{for(var c=i.key,u=a;null!==u;){if(u.key===c){if((c=i.type)===S){if(7===u.tag){n(r,u.sibling),(a=o(u,i.props.children)).return=r,r=a;break e}}else if(u.elementType===c||"object"==typeof c&&null!==c&&c.$$typeof===L&&va(c)===u.type){n(r,u.sibling),(a=o(u,i.props)).ref=ya(r,u,i),a.return=r,r=a;break e}n(r,u);break}t(r,u),u=u.sibling}i.type===S?((a=Dc(i.props.children,r.mode,l,i.key)).return=r,r=a):((l=Oc(i.type,i.key,i.props,null,r.mode,l)).ref=ya(r,a,i),l.return=r,r=l)}return s(r);case x:e:{for(u=i.key;null!==a;){if(a.key===u){if(4===a.tag&&a.stateNode.containerInfo===i.containerInfo&&a.stateNode.implementation===i.implementation){n(r,a.sibling),(a=o(a,i.children||[])).return=r,r=a;break e}n(r,a);break}t(r,a),a=a.sibling}(a=Fc(i,r.mode,l)).return=r,r=a}return s(r);case L:return e(r,a,(u=i._init)(i._payload),l)}if(te(i))return m(r,a,i,l);if(D(i))return h(r,a,i,l);ba(r,i)}return"string"==typeof i&&""!==i||"number"==typeof i?(i=""+i,null!==a&&6===a.tag?(n(r,a.sibling),(a=o(a,i)).return=r,r=a):(n(r,a),(a=Mc(i,r.mode,l)).return=r,r=a),s(r)):n(r,a)}}var ka=wa(!0),xa=wa(!1),Sa=Eo(null),_a=null,Ea=null,Ca=null;function Aa(){Ca=Ea=_a=null}function Ta(e){var t=Sa.current;Co(Sa),e._currentValue=t}function ja(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Ra(e,t){_a=e,Ca=Ea=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(!!(e.lanes&t)&&(vs=!0),e.firstContext=null)}function Pa(e){var t=e._currentValue;if(Ca!==e)if(e={context:e,memoizedValue:t,next:null},null===Ea){if(null===_a)throw Error(a(308));Ea=e,_a.dependencies={lanes:0,firstContext:e}}else Ea=Ea.next=e;return t}var La=null;function Na(e){null===La?La=[e]:La.push(e)}function Oa(e,t,n,r){var o=t.interleaved;return null===o?(n.next=n,Na(t)):(n.next=o.next,o.next=n),t.interleaved=n,Da(e,r)}function Da(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var Ia=!1;function Ma(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Fa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function za(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ba(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&Tl){var o=r.pending;return null===o?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Da(e,n)}return null===(o=r.interleaved)?(t.next=t,Na(r)):(t.next=o.next,o.next=t),r.interleaved=t,Da(e,n)}function $a(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,bt(e,n)}}function Ua(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var o=null,a=null;if(null!==(n=n.firstBaseUpdate)){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===a?o=a=i:a=a.next=i,n=n.next}while(null!==n);null===a?o=a=t:a=a.next=t}else o=a=t;return n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:a,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function qa(e,t,n,r){var o=e.updateQueue;Ia=!1;var a=o.firstBaseUpdate,i=o.lastBaseUpdate,s=o.shared.pending;if(null!==s){o.shared.pending=null;var l=s,c=l.next;l.next=null,null===i?a=c:i.next=c,i=l;var u=e.alternate;null!==u&&((s=(u=u.updateQueue).lastBaseUpdate)!==i&&(null===s?u.firstBaseUpdate=c:s.next=c,u.lastBaseUpdate=l))}if(null!==a){var d=o.baseState;for(i=0,u=c=l=null,s=a;;){var p=s.lane,f=s.eventTime;if((r&p)===p){null!==u&&(u=u.next={eventTime:f,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var g=e,m=s;switch(p=t,f=n,m.tag){case 1:if("function"==typeof(g=m.payload)){d=g.call(f,d,p);break e}d=g;break e;case 3:g.flags=-65537&g.flags|128;case 0:if(null==(p="function"==typeof(g=m.payload)?g.call(f,d,p):g))break e;d=M({},d,p);break e;case 2:Ia=!0}}null!==s.callback&&0!==s.lane&&(e.flags|=64,null===(p=o.effects)?o.effects=[s]:p.push(s))}else f={eventTime:f,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===u?(c=u=f,l=d):u=u.next=f,i|=p;if(null===(s=s.next)){if(null===(s=o.shared.pending))break;s=(p=s).next,p.next=null,o.lastBaseUpdate=p,o.shared.pending=null}}if(null===u&&(l=d),o.baseState=l,o.firstBaseUpdate=c,o.lastBaseUpdate=u,null!==(t=o.shared.interleaved)){o=t;do{i|=o.lane,o=o.next}while(o!==t)}else null===a&&(o.shared.lanes=0);Il|=i,e.lanes=i,e.memoizedState=d}}function Ga(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t n?n:4,e(!0);var r=ai.transition;ai.transition={};try{e(!1),t()}finally{vt=n,ai.transition=r}}function Vi(){return vi().memoizedState}function Wi(e,t,n){var r=tc(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Qi(e))Yi(t,n);else if(null!==(n=Oa(e,t,n,r))){nc(n,e,r,ec()),Zi(n,t,r)}}function Ki(e,t,n){var r=tc(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Qi(e))Yi(t,o);else{var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var i=t.lastRenderedState,s=a(i,n);if(o.hasEagerState=!0,o.eagerState=s,sr(s,i)){var l=t.interleaved;return null===l?(o.next=o,Na(t)):(o.next=l.next,l.next=o),void(t.interleaved=o)}}catch(c){}null!==(n=Oa(e,t,o,r))&&(nc(n,e,r,o=ec()),Zi(n,t,r))}}function Qi(e){var t=e.alternate;return e===si||null!==t&&t===si}function Yi(e,t){di=ui=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Zi(e,t,n){if(4194240&n){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,bt(e,n)}}var Xi={readContext:Pa,useCallback:gi,useContext:gi,useEffect:gi,useImperativeHandle:gi,useInsertionEffect:gi,useLayoutEffect:gi,useMemo:gi,useReducer:gi,useRef:gi,useState:gi,useDebugValue:gi,useDeferredValue:gi,useTransition:gi,useMutableSource:gi,useSyncExternalStore:gi,useId:gi,unstable_isNewReconciler:!1},Ji={readContext:Pa,useCallback:function(e,t){return bi().memoizedState=[e,void 0===t?null:t],e},useContext:Pa,useEffect:Di,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,Ni(4194308,4,zi.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ni(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ni(4,2,e,t)},useMemo:function(e,t){var n=bi();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=bi();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Wi.bind(null,si,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},bi().memoizedState=e},useState:Ri,useDebugValue:$i,useDeferredValue:function(e){return bi().memoizedState=e},useTransition:function(){var e=Ri(!1),t=e[0];return e=Hi.bind(null,e[1]),bi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=si,o=bi();if(aa){if(void 0===n)throw Error(a(407));n=n()}else{if(n=t(),null===jl)throw Error(a(349));30&ii||Ei(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Di(Ai.bind(null,r,i,e),[e]),r.flags|=2048,Pi(9,Ci.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=bi(),t=jl.identifierPrefix;if(aa){var n=Xo;t=":"+t+"R"+(n=(Zo&~(1<<32-it(Zo)-1)).toString(32)+n),0<(n=pi++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=fi++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},es={readContext:Pa,useCallback:Ui,useContext:Pa,useEffect:Ii,useImperativeHandle:Bi,useInsertionEffect:Mi,useLayoutEffect:Fi,useMemo:qi,useReducer:ki,useRef:Li,useState:function(){return ki(wi)},useDebugValue:$i,useDeferredValue:function(e){return Gi(vi(),li.memoizedState,e)},useTransition:function(){return[ki(wi)[0],vi().memoizedState]},useMutableSource:Si,useSyncExternalStore:_i,useId:Vi,unstable_isNewReconciler:!1},ts={readContext:Pa,useCallback:Ui,useContext:Pa,useEffect:Ii,useImperativeHandle:Bi,useInsertionEffect:Mi,useLayoutEffect:Fi,useMemo:qi,useReducer:xi,useRef:Li,useState:function(){return xi(wi)},useDebugValue:$i,useDeferredValue:function(e){var t=vi();return null===li?t.memoizedState=e:Gi(t,li.memoizedState,e)},useTransition:function(){return[xi(wi)[0],vi().memoizedState]},useMutableSource:Si,useSyncExternalStore:_i,useId:Vi,unstable_isNewReconciler:!1};function ns(e,t){if(e&&e.defaultProps){for(var n in t=M({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}function rs(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:M({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var os={isMounted:function(e){return!!(e=e._reactInternals)&&Ue(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=ec(),o=tc(e),a=za(r,o);a.payload=t,null!=n&&(a.callback=n),null!==(t=Ba(e,a,o))&&(nc(t,e,o,r),$a(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=ec(),o=tc(e),a=za(r,o);a.tag=1,a.payload=t,null!=n&&(a.callback=n),null!==(t=Ba(e,a,o))&&(nc(t,e,o,r),$a(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ec(),r=tc(e),o=za(n,r);o.tag=2,null!=t&&(o.callback=t),null!==(t=Ba(e,o,r))&&(nc(t,e,r,n),$a(t,e,r))}};function as(e,t,n,r,o,a,i){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,a,i):!t.prototype||!t.prototype.isPureReactComponent||(!lr(n,r)||!lr(o,a))}function is(e,t,n){var r=!1,o=To,a=t.contextType;return"object"==typeof a&&null!==a?a=Pa(a):(o=No(t)?Po:jo.current,a=(r=null!=(r=t.contextTypes))?Lo(e,o):To),t=new t(n,a),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=os,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=a),t}function ss(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&os.enqueueReplaceState(t,t.state,null)}function ls(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},Ma(e);var a=t.contextType;"object"==typeof a&&null!==a?o.context=Pa(a):(a=No(t)?Po:jo.current,o.context=Lo(e,a)),o.state=e.memoizedState,"function"==typeof(a=t.getDerivedStateFromProps)&&(rs(e,t,a,n),o.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof o.getSnapshotBeforeUpdate||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||(t=o.state,"function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),t!==o.state&&os.enqueueReplaceState(o,o.state,null),qa(e,n,o,r),o.state=e.memoizedState),"function"==typeof o.componentDidMount&&(e.flags|=4194308)}function cs(e,t){try{var n="",r=t;do{n+=$(r),r=r.return}while(r);var o=n}catch(a){o="\nError generating stack: "+a.message+"\n"+a.stack}return{value:e,source:t,stack:o,digest:null}}function us(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function ds(e,t){try{console.error(t.value)}catch(n){setTimeout((function(){throw n}))}}var ps="function"==typeof WeakMap?WeakMap:Map;function fs(e,t,n){(n=za(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Gl||(Gl=!0,Hl=r),ds(0,t)},n}function gs(e,t,n){(n=za(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){ds(0,t)}}var a=e.stateNode;return null!==a&&"function"==typeof a.componentDidCatch&&(n.callback=function(){ds(0,t),"function"!=typeof r&&(null===Vl?Vl=new Set([this]):Vl.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function ms(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new ps;var o=new Set;r.set(t,o)}else void 0===(o=r.get(t))&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=Ec.bind(null,e,t,n),t.then(e,e))}function hs(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function ys(e,t,n,r,o){return 1&e.mode?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=za(-1,1)).tag=2,Ba(n,t,1))),n.lanes|=1),e)}var bs=w.ReactCurrentOwner,vs=!1;function ws(e,t,n,r){t.child=null===e?xa(t,null,n,r):ka(t,e.child,n,r)}function ks(e,t,n,r,o){n=n.render;var a=t.ref;return Ra(t,o),r=hi(e,t,n,r,a,o),n=yi(),null===e||vs?(aa&&n&&ta(t),t.flags|=1,ws(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Gs(e,t,o))}function xs(e,t,n,r,o){if(null===e){var a=n.type;return"function"!=typeof a||Lc(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Oc(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,Ss(e,t,a,r,o))}if(a=e.child,!(e.lanes&o)){var i=a.memoizedProps;if((n=null!==(n=n.compare)?n:lr)(i,r)&&e.ref===t.ref)return Gs(e,t,o)}return t.flags|=1,(e=Nc(a,r)).ref=t.ref,e.return=t,t.child=e}function Ss(e,t,n,r,o){if(null!==e){var a=e.memoizedProps;if(lr(a,r)&&e.ref===t.ref){if(vs=!1,t.pendingProps=r=a,!(e.lanes&o))return t.lanes=e.lanes,Gs(e,t,o);131072&e.flags&&(vs=!0)}}return Cs(e,t,n,r,o)}function _s(e,t,n){var r=t.pendingProps,o=r.children,a=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(1&t.mode){if(!(1073741824&n))return e=null!==a?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ao(Nl,Ll),Ll|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==a?a.baseLanes:n,Ao(Nl,Ll),Ll|=r}else t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ao(Nl,Ll),Ll|=n;else null!==a?(r=a.baseLanes|n,t.memoizedState=null):r=n,Ao(Nl,Ll),Ll|=r;return ws(e,t,o,n),t.child}function Es(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Cs(e,t,n,r,o){var a=No(n)?Po:jo.current;return a=Lo(t,a),Ra(t,o),n=hi(e,t,n,r,a,o),r=yi(),null===e||vs?(aa&&r&&ta(t),t.flags|=1,ws(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Gs(e,t,o))}function As(e,t,n,r,o){if(No(n)){var a=!0;Mo(t)}else a=!1;if(Ra(t,o),null===t.stateNode)qs(e,t),is(t,n,r),ls(t,n,r,o),r=!0;else if(null===e){var i=t.stateNode,s=t.memoizedProps;i.props=s;var l=i.context,c=n.contextType;"object"==typeof c&&null!==c?c=Pa(c):c=Lo(t,c=No(n)?Po:jo.current);var u=n.getDerivedStateFromProps,d="function"==typeof u||"function"==typeof i.getSnapshotBeforeUpdate;d||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(s!==r||l!==c)&&ss(t,i,r,c),Ia=!1;var p=t.memoizedState;i.state=p,qa(t,r,i,o),l=t.memoizedState,s!==r||p!==l||Ro.current||Ia?("function"==typeof u&&(rs(t,n,u,r),l=t.memoizedState),(s=Ia||as(t,n,s,r,p,l,c))?(d||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||("function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount()),"function"==typeof i.componentDidMount&&(t.flags|=4194308)):("function"==typeof i.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),i.props=r,i.state=l,i.context=c,r=s):("function"==typeof i.componentDidMount&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,Fa(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:ns(t.type,s),i.props=c,d=t.pendingProps,p=i.context,"object"==typeof(l=n.contextType)&&null!==l?l=Pa(l):l=Lo(t,l=No(n)?Po:jo.current);var f=n.getDerivedStateFromProps;(u="function"==typeof f||"function"==typeof i.getSnapshotBeforeUpdate)||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(s!==d||p!==l)&&ss(t,i,r,l),Ia=!1,p=t.memoizedState,i.state=p,qa(t,r,i,o);var g=t.memoizedState;s!==d||p!==g||Ro.current||Ia?("function"==typeof f&&(rs(t,n,f,r),g=t.memoizedState),(c=Ia||as(t,n,c,r,p,g,l)||!1)?(u||"function"!=typeof i.UNSAFE_componentWillUpdate&&"function"!=typeof i.componentWillUpdate||("function"==typeof i.componentWillUpdate&&i.componentWillUpdate(r,g,l),"function"==typeof i.UNSAFE_componentWillUpdate&&i.UNSAFE_componentWillUpdate(r,g,l)),"function"==typeof i.componentDidUpdate&&(t.flags|=4),"function"==typeof i.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof i.componentDidUpdate||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),"function"!=typeof i.getSnapshotBeforeUpdate||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),i.props=r,i.state=g,i.context=l,r=c):("function"!=typeof i.componentDidUpdate||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),"function"!=typeof i.getSnapshotBeforeUpdate||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return Ts(e,t,n,r,a,o)}function Ts(e,t,n,r,o,a){Es(e,t);var i=!!(128&t.flags);if(!r&&!i)return o&&Fo(t,n,!1),Gs(e,t,a);r=t.stateNode,bs.current=t;var s=i&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&i?(t.child=ka(t,e.child,null,a),t.child=ka(t,null,s,a)):ws(e,t,s,a),t.memoizedState=r.state,o&&Fo(t,n,!0),t.child}function js(e){var t=e.stateNode;t.pendingContext?Do(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Do(0,t.context,!1),Ya(e,t.containerInfo)}function Rs(e,t,n,r,o){return ga(),ma(o),t.flags|=256,ws(e,t,n,r),t.child}var Ps,Ls,Ns,Os,Ds={dehydrated:null,treeContext:null,retryLane:0};function Is(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ms(e,t,n){var r,o=t.pendingProps,i=ei.current,s=!1,l=!!(128&t.flags);if((r=l)||(r=(null===e||null!==e.memoizedState)&&!!(2&i)),r?(s=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(i|=1),Ao(ei,1&i),null===e)return ua(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(1&t.mode?"$!"===e.data?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=o.children,e=o.fallback,s?(o=t.mode,s=t.child,l={mode:"hidden",children:l},1&o||null===s?s=Ic(l,o,0,null):(s.childLanes=0,s.pendingProps=l),e=Dc(e,o,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Is(n),t.memoizedState=Ds,e):Fs(t,l));if(null!==(i=e.memoizedState)&&null!==(r=i.dehydrated))return function(e,t,n,r,o,i,s){if(n)return 256&t.flags?(t.flags&=-257,zs(e,t,s,r=us(Error(a(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=Ic({mode:"visible",children:r.children},o,0,null),(i=Dc(i,o,s,null)).flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,1&t.mode&&ka(t,e.child,null,s),t.child.memoizedState=Is(s),t.memoizedState=Ds,i);if(!(1&t.mode))return zs(e,t,s,null);if("$!"===o.data){if(r=o.nextSibling&&o.nextSibling.dataset)var l=r.dgst;return r=l,zs(e,t,s,r=us(i=Error(a(419)),r,void 0))}if(l=!!(s&e.childLanes),vs||l){if(null!==(r=jl)){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}0!==(o=o&(r.suspendedLanes|s)?0:o)&&o!==i.retryLane&&(i.retryLane=o,Da(e,o),nc(r,e,o,-1))}return mc(),zs(e,t,s,r=us(Error(a(421))))}return"$?"===o.data?(t.flags|=128,t.child=e.child,t=Ac.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,oa=co(o.nextSibling),ra=t,aa=!0,ia=null,null!==e&&(Ko[Qo++]=Zo,Ko[Qo++]=Xo,Ko[Qo++]=Yo,Zo=e.id,Xo=e.overflow,Yo=t),t=Fs(t,r.children),t.flags|=4096,t)}(e,t,l,o,r,i,n);if(s){s=o.fallback,l=t.mode,r=(i=e.child).sibling;var c={mode:"hidden",children:o.children};return 1&l||t.child===i?(o=Nc(i,c)).subtreeFlags=14680064&i.subtreeFlags:((o=t.child).childLanes=0,o.pendingProps=c,t.deletions=null),null!==r?s=Nc(r,s):(s=Dc(s,l,n,null)).flags|=2,s.return=t,o.return=t,o.sibling=s,t.child=o,o=s,s=t.child,l=null===(l=e.child.memoizedState)?Is(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},s.memoizedState=l,s.childLanes=e.childLanes&~n,t.memoizedState=Ds,o}return e=(s=e.child).sibling,o=Nc(s,{mode:"visible",children:o.children}),!(1&t.mode)&&(o.lanes=n),o.return=t,o.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=o,t.memoizedState=null,o}function Fs(e,t){return(t=Ic({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function zs(e,t,n,r){return null!==r&&ma(r),ka(t,e.child,null,n),(e=Fs(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Bs(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),ja(e.return,t,n)}function $s(e,t,n,r,o){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=o)}function Us(e,t,n){var r=t.pendingProps,o=r.revealOrder,a=r.tail;if(ws(e,t,r.children,n),2&(r=ei.current))r=1&r|2,t.flags|=128;else{if(null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Bs(e,n,t);else if(19===e.tag)Bs(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Ao(ei,r),1&t.mode)switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===ti(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),$s(t,!1,o,n,a);break;case"backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===ti(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}$s(t,!0,n,null,a);break;case"together":$s(t,!1,null,null,void 0);break;default:t.memoizedState=null}else t.memoizedState=null;return t.child}function qs(e,t){!(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Gs(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Il|=t.lanes,!(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(a(153));if(null!==t.child){for(n=Nc(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Nc(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Hs(e,t){if(!aa)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Vs(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=14680064&o.subtreeFlags,r|=14680064&o.flags,o.return=e,o=o.sibling;else for(o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Ws(e,t,n){var r=t.pendingProps;switch(na(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vs(t),null;case 1:case 17:return No(t.type)&&Oo(),Vs(t),null;case 3:return r=t.stateNode,Za(),Co(Ro),Co(jo),ri(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(pa(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,null!==ia&&(ic(ia),ia=null))),Ls(e,t),Vs(t),null;case 5:Ja(t);var o=Qa(Ka.current);if(n=t.type,null!==e&&null!=t.stateNode)Ns(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(a(166));return Vs(t),null}if(e=Qa(Va.current),pa(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[fo]=t,r[go]=i,e=!!(1&t.mode),n){case"dialog":zr("cancel",r),zr("close",r);break;case"iframe":case"object":case"embed":zr("load",r);break;case"video":case"audio":for(o=0;o <\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),"select"===n&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[fo]=t,e[go]=r,Ps(e,t,!1,!1),t.stateNode=e;e:{switch(l=ve(n,r),n){case"dialog":zr("cancel",e),zr("close",e),o=r;break;case"iframe":case"object":case"embed":zr("load",e),o=r;break;case"video":case"audio":for(o=0;o Ul&&(t.flags|=128,r=!0,Hs(i,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=ti(l))){if(t.flags|=128,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),Hs(i,!0),null===i.tail&&"hidden"===i.tailMode&&!l.alternate&&!aa)return Vs(t),null}else 2*Ze()-i.renderingStartTime>Ul&&1073741824!==n&&(t.flags|=128,r=!0,Hs(i,!1),t.lanes=4194304);i.isBackwards?(l.sibling=t.child,t.child=l):(null!==(n=i.last)?n.sibling=l:t.child=l,i.last=l)}return null!==i.tail?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ze(),t.sibling=null,n=ei.current,Ao(ei,r?1&n|2:1&n),t):(Vs(t),null);case 22:case 23:return dc(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&1&t.mode?!!(1073741824&Ll)&&(Vs(t),6&t.subtreeFlags&&(t.flags|=8192)):Vs(t),null;case 24:case 25:return null}throw Error(a(156,t.tag))}function Ks(e,t){switch(na(t),t.tag){case 1:return No(t.type)&&Oo(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Za(),Co(Ro),Co(jo),ri(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 5:return Ja(t),null;case 13:if(Co(ei),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(a(340));ga()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return Co(ei),null;case 4:return Za(),null;case 10:return Ta(t.type._context),null;case 22:case 23:return dc(),null;default:return null}}Ps=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ls=function(){},Ns=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Qa(Va.current);var a,i=null;switch(n){case"input":o=Q(e,o),r=Q(e,r),i=[];break;case"select":o=M({},o,{value:void 0}),r=M({},r,{value:void 0}),i=[];break;case"textarea":o=re(e,o),r=re(e,r),i=[];break;default:"function"!=typeof o.onClick&&"function"==typeof r.onClick&&(e.onclick=Jr)}for(u in be(n,r),n=null,o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&null!=o[u])if("style"===u){var l=o[u];for(a in l)l.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else"dangerouslySetInnerHTML"!==u&&"children"!==u&&"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&"autoFocus"!==u&&(s.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var c=r[u];if(l=null!=o?o[u]:void 0,r.hasOwnProperty(u)&&c!==l&&(null!=c||null!=l))if("style"===u)if(l){for(a in l)!l.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&l[a]!==c[a]&&(n||(n={}),n[a]=c[a])}else n||(i||(i=[]),i.push(u,n)),n=c;else"dangerouslySetInnerHTML"===u?(c=c?c.__html:void 0,l=l?l.__html:void 0,null!=c&&l!==c&&(i=i||[]).push(u,c)):"children"===u?"string"!=typeof c&&"number"!=typeof c||(i=i||[]).push(u,""+c):"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&(s.hasOwnProperty(u)?(null!=c&&"onScroll"===u&&zr("scroll",e),i||l===c||(i=[])):(i=i||[]).push(u,c))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}},Os=function(e,t,n,r){n!==r&&(t.flags|=4)};var Qs=!1,Ys=!1,Zs="function"==typeof WeakSet?WeakSet:Set,Xs=null;function Js(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(r){_c(e,t,r)}else n.current=null}function el(e,t,n){try{n()}catch(r){_c(e,t,r)}}var tl=!1;function nl(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var o=r=r.next;do{if((o.tag&e)===e){var a=o.destroy;o.destroy=void 0,void 0!==a&&el(t,n,a)}o=o.next}while(o!==r)}}function rl(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ol(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"==typeof t?t(e):t.current=e}}function al(e){var t=e.alternate;null!==t&&(e.alternate=null,al(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[fo],delete t[go],delete t[ho],delete t[yo],delete t[bo])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function il(e){return 5===e.tag||3===e.tag||4===e.tag}function sl(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||il(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function ll(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Jr));else if(4!==r&&null!==(e=e.child))for(ll(e,t,n),e=e.sibling;null!==e;)ll(e,t,n),e=e.sibling}function cl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(cl(e,t,n),e=e.sibling;null!==e;)cl(e,t,n),e=e.sibling}var ul=null,dl=!1;function pl(e,t,n){for(n=n.child;null!==n;)fl(e,t,n),n=n.sibling}function fl(e,t,n){if(at&&"function"==typeof at.onCommitFiberUnmount)try{at.onCommitFiberUnmount(ot,n)}catch(s){}switch(n.tag){case 5:Ys||Js(n,t);case 6:var r=ul,o=dl;ul=null,pl(e,t,n),dl=o,null!==(ul=r)&&(dl?(e=ul,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):ul.removeChild(n.stateNode));break;case 18:null!==ul&&(dl?(e=ul,n=n.stateNode,8===e.nodeType?lo(e.parentNode,n):1===e.nodeType&&lo(e,n),Ut(e)):lo(ul,n.stateNode));break;case 4:r=ul,o=dl,ul=n.stateNode.containerInfo,dl=!0,pl(e,t,n),ul=r,dl=o;break;case 0:case 11:case 14:case 15:if(!Ys&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){o=r=r.next;do{var a=o,i=a.destroy;a=a.tag,void 0!==i&&(2&a||4&a)&&el(n,t,i),o=o.next}while(o!==r)}pl(e,t,n);break;case 1:if(!Ys&&(Js(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){_c(n,t,s)}pl(e,t,n);break;case 21:pl(e,t,n);break;case 22:1&n.mode?(Ys=(r=Ys)||null!==n.memoizedState,pl(e,t,n),Ys=r):pl(e,t,n);break;default:pl(e,t,n)}}function gl(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Zs),t.forEach((function(t){var r=Tc.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function ml(e,t){var n=t.deletions;if(null!==n)for(var r=0;r o&&(o=s),r&=~i}if(r=o,10<(r=(120>(r=Ze()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*_l(r/1960))-r)){e.timeoutHandle=ro(kc.bind(null,e,Bl,ql),r);break}kc(e,Bl,ql);break;default:throw Error(a(329))}}}return rc(e,Ze()),e.callbackNode===n?oc.bind(null,e):null}function ac(e,t){var n=zl;return e.current.memoizedState.isDehydrated&&(pc(e,t).flags|=256),2!==(e=hc(e,t))&&(t=Bl,Bl=n,null!==t&&ic(t)),e}function ic(e){null===Bl?Bl=e:Bl.push.apply(Bl,e)}function sc(e,t){for(t&=~Fl,t&=~Ml,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0 e?16:e,null===Kl)var r=!1;else{if(e=Kl,Kl=null,Ql=0,6&Tl)throw Error(a(331));var o=Tl;for(Tl|=4,Xs=e.current;null!==Xs;){var i=Xs,s=i.child;if(16&Xs.flags){var l=i.deletions;if(null!==l){for(var c=0;c Ze()-$l?pc(e,0):Fl|=n),rc(e,t)}function Cc(e,t){0===t&&(1&e.mode?(t=ut,!(130023424&(ut<<=1))&&(ut=4194304)):t=1);var n=ec();null!==(e=Da(e,t))&&(yt(e,t,n),rc(e,n))}function Ac(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Cc(e,n)}function Tc(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;null!==o&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(a(314))}null!==r&&r.delete(t),Cc(e,n)}function jc(e,t){return We(e,t)}function Rc(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Pc(e,t,n,r){return new Rc(e,t,n,r)}function Lc(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Nc(e,t){var n=e.alternate;return null===n?((n=Pc(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Oc(e,t,n,r,o,i){var s=2;if(r=e,"function"==typeof e)Lc(e)&&(s=1);else if("string"==typeof e)s=5;else e:switch(e){case S:return Dc(n.children,o,i,t);case _:s=8,o|=8;break;case E:return(e=Pc(12,n,t,2|o)).elementType=E,e.lanes=i,e;case j:return(e=Pc(13,n,t,o)).elementType=j,e.lanes=i,e;case R:return(e=Pc(19,n,t,o)).elementType=R,e.lanes=i,e;case N:return Ic(n,o,i,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case C:s=10;break e;case A:s=9;break e;case T:s=11;break e;case P:s=14;break e;case L:s=16,r=null;break e}throw Error(a(130,null==e?e:typeof e,""))}return(t=Pc(s,n,t,o)).elementType=e,t.type=r,t.lanes=i,t}function Dc(e,t,n,r){return(e=Pc(7,e,r,t)).lanes=n,e}function Ic(e,t,n,r){return(e=Pc(22,e,r,t)).elementType=N,e.lanes=n,e.stateNode={isHidden:!1},e}function Mc(e,t,n){return(e=Pc(6,e,null,t)).lanes=n,e}function Fc(e,t,n){return(t=Pc(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function zc(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ht(0),this.expirationTimes=ht(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ht(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Bc(e,t,n,r,o,a,i,s,l){return e=new zc(e,t,n,s,l),1===t?(t=1,!0===a&&(t|=8)):t=0,a=Pc(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ma(a),e}function $c(e){if(!e)return To;e:{if(Ue(e=e._reactInternals)!==e||1!==e.tag)throw Error(a(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(No(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(a(171))}if(1===e.tag){var n=e.type;if(No(n))return Io(e,n,t)}return t}function Uc(e,t,n,r,o,a,i,s,l){return(e=Bc(n,r,!0,e,0,a,0,s,l)).context=$c(null),n=e.current,(a=za(r=ec(),o=tc(n))).callback=null!=t?t:null,Ba(n,a,o),e.current.lanes=o,yt(e,o,r),rc(e,r),e}function qc(e,t,n,r){var o=t.current,a=ec(),i=tc(o);return n=$c(n),null===t.context?t.context=n:t.pendingContext=n,(t=za(a,i)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=Ba(o,t,i))&&(nc(e,o,i,a),$a(e,o,i)),i}function Gc(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Hc(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n {"use strict";var r=n(961);t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot},961:(e,t,n)=>{"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(2551)},115:e=>{var t="undefined"!=typeof Element,n="function"==typeof Map,r="function"==typeof Set,o="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function a(e,i){if(e===i)return!0;if(e&&i&&"object"==typeof e&&"object"==typeof i){if(e.constructor!==i.constructor)return!1;var s,l,c,u;if(Array.isArray(e)){if((s=e.length)!=i.length)return!1;for(l=s;0!=l--;)if(!a(e[l],i[l]))return!1;return!0}if(n&&e instanceof Map&&i instanceof Map){if(e.size!==i.size)return!1;for(u=e.entries();!(l=u.next()).done;)if(!i.has(l.value[0]))return!1;for(u=e.entries();!(l=u.next()).done;)if(!a(l.value[1],i.get(l.value[0])))return!1;return!0}if(r&&e instanceof Set&&i instanceof Set){if(e.size!==i.size)return!1;for(u=e.entries();!(l=u.next()).done;)if(!i.has(l.value[0]))return!1;return!0}if(o&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(i)){if((s=e.length)!=i.length)return!1;for(l=s;0!=l--;)if(e[l]!==i[l])return!1;return!0}if(e.constructor===RegExp)return e.source===i.source&&e.flags===i.flags;if(e.valueOf!==Object.prototype.valueOf&&"function"==typeof e.valueOf&&"function"==typeof i.valueOf)return e.valueOf()===i.valueOf();if(e.toString!==Object.prototype.toString&&"function"==typeof e.toString&&"function"==typeof i.toString)return e.toString()===i.toString();if((s=(c=Object.keys(e)).length)!==Object.keys(i).length)return!1;for(l=s;0!=l--;)if(!Object.prototype.hasOwnProperty.call(i,c[l]))return!1;if(t&&e instanceof Element)return!1;for(l=s;0!=l--;)if(("_owner"!==c[l]&&"__v"!==c[l]&&"__o"!==c[l]||!e.$$typeof)&&!a(e[c[l]],i[c[l]]))return!1;return!0}return e!=e&&i!=i}e.exports=function(e,t){try{return a(e,t)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}}},545:(e,t,n)=>{"use strict";n.d(t,{mg:()=>J,vd:()=>H});var r=n(6540),o=n(5556),a=n.n(o),i=n(115),s=n.n(i),l=n(311),c=n.n(l),u=n(2833),d=n.n(u);function p(){return p=Object.assign||function(e){for(var t=1;t =0||(o[n]=e[n]);return o}var h={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title",FRAGMENT:"Symbol(react.fragment)"},y={rel:["amphtml","canonical","alternate"]},b={type:["application/ld+json"]},v={charset:"",name:["robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},w=Object.keys(h).map((function(e){return h[e]})),k={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},x=Object.keys(k).reduce((function(e,t){return e[k[t]]=t,e}),{}),S=function(e,t){for(var n=e.length-1;n>=0;n-=1){var r=e[n];if(Object.prototype.hasOwnProperty.call(r,t))return r[t]}return null},_=function(e){var t=S(e,h.TITLE),n=S(e,"titleTemplate");if(Array.isArray(t)&&(t=t.join("")),n&&t)return n.replace(/%s/g,(function(){return t}));var r=S(e,"defaultTitle");return t||r||void 0},E=function(e){return S(e,"onChangeClientState")||function(){}},C=function(e,t){return t.filter((function(t){return void 0!==t[e]})).map((function(t){return t[e]})).reduce((function(e,t){return p({},e,t)}),{})},A=function(e,t){return t.filter((function(e){return void 0!==e[h.BASE]})).map((function(e){return e[h.BASE]})).reverse().reduce((function(t,n){if(!t.length)for(var r=Object.keys(n),o=0;o /g,">").replace(/"/g,""").replace(/'/g,"'")},D=function(e){return Object.keys(e).reduce((function(t,n){var r=void 0!==e[n]?n+'="'+e[n]+'"':""+n;return t?t+" "+r:r}),"")},I=function(e,t){return void 0===t&&(t={}),Object.keys(e).reduce((function(t,n){return t[k[n]||n]=e[n],t}),t)},M=function(e,t){return t.map((function(t,n){var o,a=((o={key:n})["data-rh"]=!0,o);return Object.keys(t).forEach((function(e){var n=k[e]||e;"innerHTML"===n||"cssText"===n?a.dangerouslySetInnerHTML={__html:t.innerHTML||t.cssText}:a[n]=t[e]})),r.createElement(e,a)}))},F=function(e,t,n){switch(e){case h.TITLE:return{toComponent:function(){return n=t.titleAttributes,(o={key:e=t.title})["data-rh"]=!0,a=I(n,o),[r.createElement(h.TITLE,a,e)];var e,n,o,a},toString:function(){return function(e,t,n,r){var o=D(n),a=R(t);return o?"<"+e+' data-rh="true" '+o+">"+O(a,r)+""+e+">":"<"+e+' data-rh="true">'+O(a,r)+""+e+">"}(e,t.title,t.titleAttributes,n)}};case"bodyAttributes":case"htmlAttributes":return{toComponent:function(){return I(t)},toString:function(){return D(t)}};default:return{toComponent:function(){return M(e,t)},toString:function(){return function(e,t,n){return t.reduce((function(t,r){var o=Object.keys(r).filter((function(e){return!("innerHTML"===e||"cssText"===e)})).reduce((function(e,t){var o=void 0===r[t]?t:t+'="'+O(r[t],n)+'"';return e?e+" "+o:o}),""),a=r.innerHTML||r.cssText||"",i=-1===N.indexOf(e);return t+"<"+e+' data-rh="true" '+o+(i?"/>":">"+a+""+e+">")}),"")}(e,t,n)}}}},z=function(e){var t=e.baseTag,n=e.bodyAttributes,r=e.encode,o=e.htmlAttributes,a=e.noscriptTags,i=e.styleTags,s=e.title,l=void 0===s?"":s,c=e.titleAttributes,u=e.linkTags,d=e.metaTags,p=e.scriptTags,f={toComponent:function(){},toString:function(){return""}};if(e.prioritizeSeoTags){var g=function(e){var t=e.linkTags,n=e.scriptTags,r=e.encode,o=P(e.metaTags,v),a=P(t,y),i=P(n,b);return{priorityMethods:{toComponent:function(){return[].concat(M(h.META,o.priority),M(h.LINK,a.priority),M(h.SCRIPT,i.priority))},toString:function(){return F(h.META,o.priority,r)+" "+F(h.LINK,a.priority,r)+" "+F(h.SCRIPT,i.priority,r)}},metaTags:o.default,linkTags:a.default,scriptTags:i.default}}(e);f=g.priorityMethods,u=g.linkTags,d=g.metaTags,p=g.scriptTags}return{priority:f,base:F(h.BASE,t,r),bodyAttributes:F("bodyAttributes",n,r),htmlAttributes:F("htmlAttributes",o,r),link:F(h.LINK,u,r),meta:F(h.META,d,r),noscript:F(h.NOSCRIPT,a,r),script:F(h.SCRIPT,p,r),style:F(h.STYLE,i,r),title:F(h.TITLE,{title:l,titleAttributes:c},r)}},B=[],$=function(e,t){var n=this;void 0===t&&(t="undefined"!=typeof document),this.instances=[],this.value={setHelmet:function(e){n.context.helmet=e},helmetInstances:{get:function(){return n.canUseDOM?B:n.instances},add:function(e){(n.canUseDOM?B:n.instances).push(e)},remove:function(e){var t=(n.canUseDOM?B:n.instances).indexOf(e);(n.canUseDOM?B:n.instances).splice(t,1)}}},this.context=e,this.canUseDOM=t,t||(e.helmet=z({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))},U=r.createContext({}),q=a().shape({setHelmet:a().func,helmetInstances:a().shape({get:a().func,add:a().func,remove:a().func})}),G="undefined"!=typeof document,H=function(e){function t(n){var r;return(r=e.call(this,n)||this).helmetData=new $(r.props.context,t.canUseDOM),r}return f(t,e),t.prototype.render=function(){return r.createElement(U.Provider,{value:this.helmetData.value},this.props.children)},t}(r.Component);H.canUseDOM=G,H.propTypes={context:a().shape({helmet:a().shape()}),children:a().node.isRequired},H.defaultProps={context:{}},H.displayName="HelmetProvider";var V=function(e,t){var n,r=document.head||document.querySelector(h.HEAD),o=r.querySelectorAll(e+"[data-rh]"),a=[].slice.call(o),i=[];return t&&t.length&&t.forEach((function(t){var r=document.createElement(e);for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&("innerHTML"===o?r.innerHTML=t.innerHTML:"cssText"===o?r.styleSheet?r.styleSheet.cssText=t.cssText:r.appendChild(document.createTextNode(t.cssText)):r.setAttribute(o,void 0===t[o]?"":t[o]));r.setAttribute("data-rh","true"),a.some((function(e,t){return n=t,r.isEqualNode(e)}))?a.splice(n,1):i.push(r)})),a.forEach((function(e){return e.parentNode.removeChild(e)})),i.forEach((function(e){return r.appendChild(e)})),{oldTags:a,newTags:i}},W=function(e,t){var n=document.getElementsByTagName(e)[0];if(n){for(var r=n.getAttribute("data-rh"),o=r?r.split(","):[],a=[].concat(o),i=Object.keys(t),s=0;s =0;d-=1)n.removeAttribute(a[d]);o.length===a.length?n.removeAttribute("data-rh"):n.getAttribute("data-rh")!==i.join(",")&&n.setAttribute("data-rh",i.join(","))}},K=function(e,t){var n=e.baseTag,r=e.htmlAttributes,o=e.linkTags,a=e.metaTags,i=e.noscriptTags,s=e.onChangeClientState,l=e.scriptTags,c=e.styleTags,u=e.title,d=e.titleAttributes;W(h.BODY,e.bodyAttributes),W(h.HTML,r),function(e,t){void 0!==e&&document.title!==e&&(document.title=R(e)),W(h.TITLE,t)}(u,d);var p={baseTag:V(h.BASE,n),linkTags:V(h.LINK,o),metaTags:V(h.META,a),noscriptTags:V(h.NOSCRIPT,i),scriptTags:V(h.SCRIPT,l),styleTags:V(h.STYLE,c)},f={},g={};Object.keys(p).forEach((function(e){var t=p[e],n=t.newTags,r=t.oldTags;n.length&&(f[e]=n),r.length&&(g[e]=p[e].oldTags)})),t&&t(),s(e,f,g)},Q=null,Y=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o elements are self-closing and can not contain children. Refer to our API for more information.")}},n.flattenArrayTypeChildren=function(e){var t,n=e.child,r=e.arrayTypeChildren;return p({},r,((t={})[n.type]=[].concat(r[n.type]||[],[p({},e.newChildProps,this.mapNestedChildrenToProps(n,e.nestedChildren))]),t))},n.mapObjectTypeChildren=function(e){var t,n,r=e.child,o=e.newProps,a=e.newChildProps,i=e.nestedChildren;switch(r.type){case h.TITLE:return p({},o,((t={})[r.type]=i,t.titleAttributes=p({},a),t));case h.BODY:return p({},o,{bodyAttributes:p({},a)});case h.HTML:return p({},o,{htmlAttributes:p({},a)});default:return p({},o,((n={})[r.type]=p({},a),n))}},n.mapArrayTypeChildrenToProps=function(e,t){var n=p({},t);return Object.keys(e).forEach((function(t){var r;n=p({},n,((r={})[t]=e[t],r))})),n},n.warnOnInvalidChildren=function(e,t){return c()(w.some((function(t){return e.type===t})),"function"==typeof e.type?"You may be attempting to nest components within each other, which is not allowed. Refer to our API for more information.":"Only elements types "+w.join(", ")+" are allowed. Helmet does not support rendering <"+e.type+"> elements. Refer to our API for more information."),c()(!t||"string"==typeof t||Array.isArray(t)&&!t.some((function(e){return"string"!=typeof e})),"Helmet expects a string as a child of <"+e.type+">. Did you forget to wrap your children in braces? ( <"+e.type+">{``}"+e.type+"> ) Refer to our API for more information."),!0},n.mapChildrenToProps=function(e,t){var n=this,o={};return r.Children.forEach(e,(function(e){if(e&&e.props){var r=e.props,a=r.children,i=m(r,Z),s=Object.keys(i).reduce((function(e,t){return e[x[t]||t]=i[t],e}),{}),l=e.type;switch("symbol"==typeof l?l=l.toString():n.warnOnInvalidChildren(e,a),l){case h.FRAGMENT:t=n.mapChildrenToProps(a,t);break;case h.LINK:case h.META:case h.NOSCRIPT:case h.SCRIPT:case h.STYLE:o=n.flattenArrayTypeChildren({child:e,arrayTypeChildren:o,newChildProps:s,nestedChildren:a});break;default:t=n.mapObjectTypeChildren({child:e,newProps:t,newChildProps:s,nestedChildren:a})}}})),this.mapArrayTypeChildrenToProps(o,t)},n.render=function(){var e=this.props,t=e.children,n=m(e,X),o=p({},n),a=n.helmetData;return t&&(o=this.mapChildrenToProps(t,o)),!a||a instanceof $||(a=new $(a.context,a.instances)),a?r.createElement(Y,p({},o,{context:a.value,helmetData:void 0})):r.createElement(U.Consumer,null,(function(e){return r.createElement(Y,p({},o,{context:e}))}))},t}(r.Component);J.propTypes={base:a().object,bodyAttributes:a().object,children:a().oneOfType([a().arrayOf(a().node),a().node]),defaultTitle:a().string,defer:a().bool,encodeSpecialCharacters:a().bool,htmlAttributes:a().object,link:a().arrayOf(a().object),meta:a().arrayOf(a().object),noscript:a().arrayOf(a().object),onChangeClientState:a().func,script:a().arrayOf(a().object),style:a().arrayOf(a().object),title:a().string,titleAttributes:a().object,titleTemplate:a().string,prioritizeSeoTags:a().bool,helmetData:a().object},J.defaultProps={defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1},J.displayName="Helmet"},2799:(e,t)=>{"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,a=n?Symbol.for("react.fragment"):60107,i=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,p=n?Symbol.for("react.forward_ref"):60112,f=n?Symbol.for("react.suspense"):60113,g=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,h=n?Symbol.for("react.lazy"):60116,y=n?Symbol.for("react.block"):60121,b=n?Symbol.for("react.fundamental"):60117,v=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function k(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case a:case s:case i:case f:return e;default:switch(e=e&&e.$$typeof){case c:case p:case h:case m:case l:return e;default:return t}}case o:return t}}}function x(e){return k(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=l,t.Element=r,t.ForwardRef=p,t.Fragment=a,t.Lazy=h,t.Memo=m,t.Portal=o,t.Profiler=s,t.StrictMode=i,t.Suspense=f,t.isAsyncMode=function(e){return x(e)||k(e)===u},t.isConcurrentMode=x,t.isContextConsumer=function(e){return k(e)===c},t.isContextProvider=function(e){return k(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return k(e)===p},t.isFragment=function(e){return k(e)===a},t.isLazy=function(e){return k(e)===h},t.isMemo=function(e){return k(e)===m},t.isPortal=function(e){return k(e)===o},t.isProfiler=function(e){return k(e)===s},t.isStrictMode=function(e){return k(e)===i},t.isSuspense=function(e){return k(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===d||e===s||e===i||e===f||e===g||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===m||e.$$typeof===l||e.$$typeof===c||e.$$typeof===p||e.$$typeof===b||e.$$typeof===v||e.$$typeof===w||e.$$typeof===y)},t.typeOf=k},4363:(e,t,n)=>{"use strict";e.exports=n(2799)},3259:(e,t,n)=>{"use strict";function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(){return i=Object.assign||function(e){for(var t=1;t {"use strict";n.d(t,{u:()=>i,v:()=>s});var r=n(6347),o=n(8168),a=n(6540);function i(e,t,n){return void 0===n&&(n=[]),e.some((function(e){var o=e.path?(0,r.B6)(t,e):n.length?n[n.length-1].match:r.Ix.computeRootMatch(t);return o&&(n.push({route:e,match:o}),e.routes&&i(e.routes,t,n)),o})),n}function s(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),e?a.createElement(r.dO,n,e.map((function(e,n){return a.createElement(r.qh,{key:e.key||n,path:e.path,exact:e.exact,strict:e.strict,render:function(n){return e.render?e.render((0,o.A)({},n,{},t,{route:e})):a.createElement(e.component,(0,o.A)({},n,t,{route:e}))}})}))):null}},4625:(e,t,n)=>{"use strict";n.d(t,{I9:()=>d,Kd:()=>u,N_:()=>y,k2:()=>w});var r=n(6347),o=n(2892),a=n(6540),i=n(1513),s=n(8168),l=n(8587),c=n(1561),u=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o {"use strict";n.d(t,{B6:()=>S,Ix:()=>v,W6:()=>L,XZ:()=>b,dO:()=>R,qh:()=>_,zy:()=>N});var r=n(2892),o=n(6540),a=n(5556),i=n.n(a),s=n(1513),l=n(1561),c=n(8168),u=n(5302),d=n.n(u),p=(n(4363),n(8587)),f=(n(4146),1073741823),g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:{};var m=o.createContext||function(e,t){var n,a,s="__create-react-context-"+function(){var e="__global_unique_id__";return g[e]=(g[e]||0)+1}()+"__",l=function(e){function n(){for(var t,n,r,o=arguments.length,a=new Array(o),i=0;i {"use strict";var r=n(6540),o=Symbol.for("react.element"),a=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,a={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)i.call(t,r)&&!l.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===a[r]&&(a[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:u,props:a,_owner:s.current}}t.Fragment=a,t.jsx=c,t.jsxs=c},5287:(e,t)=>{"use strict";var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),f=Symbol.iterator;var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,h={};function y(e,t,n){this.props=e,this.context=t,this.refs=h,this.updater=n||g}function b(){}function v(e,t,n){this.props=e,this.context=t,this.refs=h,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},b.prototype=y.prototype;var w=v.prototype=new b;w.constructor=v,m(w,y.prototype),w.isPureReactComponent=!0;var k=Array.isArray,x=Object.prototype.hasOwnProperty,S={current:null},_={key:!0,ref:!0,__self:!0,__source:!0};function E(e,t,r){var o,a={},i=null,s=null;if(null!=t)for(o in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(i=""+t.key),t)x.call(t,o)&&!_.hasOwnProperty(o)&&(a[o]=t[o]);var l=arguments.length-2;if(1===l)a.children=r;else if(1 {"use strict";e.exports=n(5287)},4848:(e,t,n)=>{"use strict";e.exports=n(1020)},7463:(e,t)=>{"use strict";function n(e,t){var n=e.length;e.push(t);e:for(;0 >>1,o=e[r];if(!(0>>1;ra(l,n))c a(u,l)?(e[r]=u,e[c]=n,r=c):(e[r]=l,e[s]=n,r=s);else{if(!(c a(u,n)))break e;e[r]=u,e[c]=n,r=c}}}return t}function a(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var i=performance;t.unstable_now=function(){return i.now()}}else{var s=Date,l=s.now();t.unstable_now=function(){return s.now()-l}}var c=[],u=[],d=1,p=null,f=3,g=!1,m=!1,h=!1,y="function"==typeof setTimeout?setTimeout:null,b="function"==typeof clearTimeout?clearTimeout:null,v="undefined"!=typeof setImmediate?setImmediate:null;function w(e){for(var t=r(u);null!==t;){if(null===t.callback)o(u);else{if(!(t.startTime<=e))break;o(u),t.sortIndex=t.expirationTime,n(c,t)}t=r(u)}}function k(e){if(h=!1,w(e),!m)if(null!==r(c))m=!0,N(x);else{var t=r(u);null!==t&&O(k,t.startTime-e)}}function x(e,n){m=!1,h&&(h=!1,b(C),C=-1),g=!0;var a=f;try{for(w(n),p=r(c);null!==p&&(!(p.expirationTime>n)||e&&!j());){var i=p.callback;if("function"==typeof i){p.callback=null,f=p.priorityLevel;var s=i(p.expirationTime<=n);n=t.unstable_now(),"function"==typeof s?p.callback=s:p===r(c)&&o(c),w(n)}else o(c);p=r(c)}if(null!==p)var l=!0;else{var d=r(u);null!==d&&O(k,d.startTime-n),l=!1}return l}finally{p=null,f=a,g=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var S,_=!1,E=null,C=-1,A=5,T=-1;function j(){return!(t.unstable_now()-Te||125 i?(e.sortIndex=a,n(u,e),null===r(c)&&e===r(u)&&(h?(b(C),C=-1):h=!0,O(k,a-i))):(e.sortIndex=s,n(c,e),m||g||(m=!0,N(x))),e},t.unstable_shouldYield=j,t.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}},9982:(e,t,n)=>{"use strict";e.exports=n(7463)},2833:e=>{e.exports=function(e,t,n,r){var o=n?n.call(r,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var a=Object.keys(e),i=Object.keys(t);if(a.length!==i.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;l {"use strict";n.r(t),n.d(t,{default:()=>r});const r={title:"Stylable",tagline:"is CSS for components",url:"https://stylable.io",baseUrl:"/",onBrokenLinks:"throw",onBrokenMarkdownLinks:"warn",favicon:"img/favicon.ico",organizationName:"wixplosives",projectName:"stylable.io",trailingSlash:!1,themeConfig:{colorMode:{defaultMode:"dark",respectPrefersColorScheme:!0,disableSwitch:!1},navbar:{hideOnScroll:!0,title:"Stylable",logo:{alt:"Stylable Logo",src:"img/branding/logo/SVG/96-logo-OnlySymbol.svg"},items:[{to:"docs/getting-started/intro",activeBasePath:"docs/getting-started",label:"Getting Started",position:"left"},{to:"docs/guides/handbook/intro",activeBasePath:"docs/guides",label:"Guides",position:"left"},{to:"docs/references/cheatsheet",activeBasePath:"docs/references",label:"API",position:"left"},{to:"playground",label:"Playground",position:"left"},{to:"community",label:"Community",position:"left"},{to:"blog",label:"Blog",position:"left"},{href:"https://github.com/wix/stylable",position:"right",className:"githubIcon__root","aria-label":"GitHub repository"}]},footer:{style:"dark",links:[{title:"Docs",items:[{label:"Getting Started",to:"docs/getting-started/intro"},{label:"Guides",to:"docs/guides/handbook/intro"},{label:"API",to:"docs/references/cheatsheet"}]},{title:"Community",items:[{label:"Issues",href:"https://github.com/wix/stylable/issues"},{label:"Twitter",href:"https://twitter.com/stylableio"},{label:"Discord",href:"https://discord.gg/C5ZhENSbV7"}]},{title:"More",items:[{label:"Site GitHub",href:"https://github.com/wixplosives/stylable.io"},{label:"Style Guide",to:"docs/style-guide"},{label:"Attributions",to:"docs/attributions"}]}],copyright:"Copyright \xa9 2025 Wix.com. Built with Docusaurus."},docs:{versionPersistence:"localStorage",sidebar:{hideable:!1,autoCollapseCategories:!1}},blog:{sidebar:{groupByYear:!0}},metadata:[],prism:{additionalLanguages:[],theme:{plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},magicComments:[{className:"theme-code-block-highlighted-line",line:"highlight-next-line",block:{start:"highlight-start",end:"highlight-end"}}]},tableOfContents:{minHeadingLevel:2,maxHeadingLevel:3}},presets:[["@docusaurus/preset-classic",{docs:{sidebarPath:"/home/runner/work/stylable.io/stylable.io/src/sidebars.js",editUrl:"https://github.com/wixplosives/stylable.io/edit/master",exclude:["unpublished/**"]},blog:{showReadingTime:!0,editUrl:"https://github.com/wixplosives/stylable.io/edit/master",onInlineAuthors:"ignore"},googleAnalytics:{trackingID:"UA-109043375-1",anonymizeIP:!0}}]],plugins:[["/home/runner/work/stylable.io/stylable.io/node_modules/@easyops-cn/docusaurus-search-local/dist/server/server/index.js",{hashed:!0}],["/home/runner/work/stylable.io/stylable.io/plugins/stylable-plugin.js",{}]],baseUrlIssueBanner:!0,i18n:{defaultLocale:"en",path:"i18n",locales:["en"],localeConfigs:{}},future:{experimental_faster:{swcJsLoader:!1,swcJsMinimizer:!1,swcHtmlMinimizer:!1,lightningCssMinimizer:!1,mdxCrossCompilerCache:!1,rspackBundler:!1},experimental_storage:{type:"localStorage",namespace:!1},experimental_router:"browser"},onBrokenAnchors:"warn",onDuplicateRoutes:"warn",staticDirectories:["static"],customFields:{},themes:[],scripts:[],headTags:[],stylesheets:[],clientModules:[],titleDelimiter:"|",noIndex:!1,markdown:{format:"mdx",mermaid:!1,mdx1Compat:{comments:!0,admonitions:!0,headingIds:!0},anchors:{maintainCase:!1}}}},8168:(e,t,n)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t r})},2892:(e,t,n)=>{"use strict";function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}function o(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)}n.d(t,{A:()=>o})},8587:(e,t,n)=>{"use strict";function r(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}n.d(t,{A:()=>r})},4164:(e,t,n)=>{"use strict";function r(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;to});const o=function(){for(var e,t,n=0,o="",a=arguments.length;n{"use strict";n.d(t,{My:()=>A,f4:()=>ne});var r,o,a,i,s,l,c,u=n(6540),d=n(4164),p=Object.create,f=Object.defineProperty,g=Object.defineProperties,m=Object.getOwnPropertyDescriptor,h=Object.getOwnPropertyDescriptors,y=Object.getOwnPropertyNames,b=Object.getOwnPropertySymbols,v=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable,x=(e,t,n)=>t in e?f(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,S=(e,t)=>{for(var n in t||(t={}))w.call(t,n)&&x(e,n,t[n]);if(b)for(var n of b(t))k.call(t,n)&&x(e,n,t[n]);return e},_=(e,t)=>g(e,h(t)),E=(e,t)=>{var n={};for(var r in e)w.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&b)for(var r of b(e))t.indexOf(r)<0&&k.call(e,r)&&(n[r]=e[r]);return n},C=(r={"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(e,t){var n=function(){var e=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,t=0,n={},r={util:{encode:function e(t){return t instanceof o?new o(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/=d.reach);S+=x.value.length,x=x.next){var _=x.value;if(t.length>e.length)return;if(!(_ instanceof o)){var E,C=1;if(b){if(!(E=a(k,S,e,y))||E.index>=e.length)break;var A=E.index,T=E.index+E[0].length,j=S;for(j+=x.value.length;A>=j;)j+=(x=x.next).value.length;if(S=j-=x.value.length,x.value instanceof o)continue;for(var R=x;R!==t.tail&&(j d.reach&&(d.reach=O);var D=x.prev;if(L&&(D=l(t,D,L),S+=L.length),c(t,D,C),x=l(t,D,new o(p,h?r.tokenize(P,h):P,v,P)),N&&l(t,x,N),C>1){var I={cause:p+","+g,reach:O};i(e,t,n,x.prev,S,I),d&&I.reach>d.reach&&(d.reach=I.reach)}}}}}}function s(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function l(e,t,n){var r=t.next,o={value:n,prev:t,next:r};return t.next=o,r.prev=o,e.length++,o}function c(e,t,n){for(var r=t.next,o=0;o "+a.content+""+a.tag+">"},r}();t.exports=n,n.default=n}},function(){return o||(0,r[y(r)[0]])((o={exports:{}}).exports,o),o.exports}),A=((e,t,n)=>(n=null!=e?p(v(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of y(t))w.call(e,o)||o===n||f(e,o,{get:()=>t[o],enumerable:!(r=m(t,o))||r.enumerable});return e})(!t&&e&&e.__esModule?n:f(n,"default",{value:e,enumerable:!0}),e)))(C());A.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/?[\da-f]{1,8};/i]},A.languages.markup.tag.inside["attr-value"].inside.entity=A.languages.markup.entity,A.languages.markup.doctype.inside["internal-subset"].inside=A.languages.markup,A.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(A.languages.markup.tag,"addInlined",{value:function(e,t){var n;(t=((n=((n={})["language-"+t]={pattern:/(^$)/i,lookbehind:!0,inside:A.languages[t]},n.cdata=/^$/i,{"included-cdata":{pattern://i,inside:n}}))["language-"+t]={pattern:/[\s\S]+/,inside:A.languages[t]},{}))[e]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:n},A.languages.insertBefore("markup","cdata",t)}}),Object.defineProperty(A.languages.markup.tag,"addAttribute",{value:function(e,t){A.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:A.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),A.languages.html=A.languages.markup,A.languages.mathml=A.languages.markup,A.languages.svg=A.languages.markup,A.languages.xml=A.languages.extend("markup",{}),A.languages.ssml=A.languages.xml,A.languages.atom=A.languages.xml,A.languages.rss=A.languages.xml,a=A,i={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},l="(?:[^\\\\-]|"+(s=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/).source+")",l=RegExp(l+"-"+l),c={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"},a.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:l,inside:{escape:s,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":i,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:s}},"special-escape":i,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":c}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:s,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":c}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}},A.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},A.languages.javascript=A.languages.extend("clike",{"class-name":[A.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),A.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,A.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:A.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:A.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:A.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:A.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:A.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),A.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:A.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),A.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),A.languages.markup&&(A.languages.markup.tag.addInlined("script","javascript"),A.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),A.languages.js=A.languages.javascript,A.languages.actionscript=A.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<|>>?>?|[!=]=?)=?|[~?@]/}),A.languages.actionscript["class-name"].alias="function",delete A.languages.actionscript.parameter,delete A.languages.actionscript["literal-property"],A.languages.markup&&A.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:A.languages.markup}}),function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript}(A),function(e){var t=e.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(t,"addSupport",{value:function(t,n){(t="string"==typeof t?[t]:t).forEach((function(t){var r=function(e){e.inside||(e.inside={}),e.inside.rest=n},o="doc-comment";if(a=e.languages[t]){var a,i=a[o];if((i=i||(a=e.languages.insertBefore(t,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[o])instanceof RegExp&&(i=a[o]={pattern:i}),Array.isArray(i))for(var s=0,l=i.length;s |\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=t,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),{pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0});e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,number:n})}(A),function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ \t]+"+t.source+")?|"+t.source+"(?:[ \t]+"+n.source+")?)",o=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-] )(?:[ \t]*(?:(?![#:]) |: ))*/.source.replace(/ /g,(function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source})),a=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function i(e,t){t=(t||"").replace(/m/g,"")+"m";var n=/([:\-,[{]\s*(?:\s< >[ \t]+)?)(?:< >)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/< >/g,(function(){return r})).replace(/< >/g,(function(){return e}));return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s< >[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/< >/g,(function(){return r}))),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:< >[ \t]+)?)< >(?=\s*:\s)/.source.replace(/< >/g,(function(){return r})).replace(/< >/g,(function(){return"(?:"+o+"|"+a+")"}))),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:i(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:i(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:i(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:i(a),lookbehind:!0,greedy:!0},number:{pattern:i(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(A),function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(e){return e=e.replace(/ /g,(function(){return t})),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+e+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,o=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,(function(){return r})),a=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,i=(e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+o+a+"(?:"+o+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+o+a+")(?:"+o+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+o+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+o+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_) |_(?:(?!_) )+_)+__\b|\*\*(?:(?!\*) |\*(?:(?!\*) )+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_) |__(?:(?!_) )+__)+_\b|\*(?:(?!\*) |\*\*(?:(?!\*) )+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~) )+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\]) )+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]) )+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach((function(t){["url","bold","italic","strike","code-snippet"].forEach((function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])}))})),e.hooks.add("after-tokenize",(function(e){"markdown"!==e.language&&"md"!==e.language||function e(t){if(t&&"string"!=typeof t)for(var n=0,r=t.length;n ",quot:'"'},l=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(A),A.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:A.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},A.hooks.add("after-tokenize",(function(e){if("graphql"===e.language)for(var t=e.tokens.filter((function(e){return"string"!=typeof e&&"comment"!==e.type&&"scalar"!==e.type})),n=0;n ?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.javascript["template-string"],n=t.pattern.source,r=t.inside.interpolation,o=r.inside["interpolation-punctuation"],a=r.pattern.source;function i(t,r){if(e.languages[t])return{pattern:RegExp("((?:"+r+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:t}}}}function s(t,n,r){return t={code:t,grammar:n,language:r},e.hooks.run("before-tokenize",t),t.tokens=e.tokenize(t.code,t.grammar),e.hooks.run("after-tokenize",t),t.tokens}function l(t,n,i){var l=e.tokenize(t,{interpolation:{pattern:RegExp(a),lookbehind:!0}}),c=0,u={},d=(l=s(l.map((function(e){if("string"==typeof e)return e;var n,r;for(e=e.content;-1!==t.indexOf((r=c++,n="___"+i.toUpperCase()+"_"+r+"___")););return u[n]=e,n})).join(""),n,i),Object.keys(u));return c=0,function t(n){for(var a=0;a =d.length)return;var i,l,p,f,g,m,h,y=n[a];"string"==typeof y||"string"==typeof y.content?(i=d[c],-1!==(h=(m="string"==typeof y?y:y.content).indexOf(i))&&(++c,l=m.substring(0,h),g=u[i],p=void 0,(f={})["interpolation-punctuation"]=o,3===(f=e.tokenize(g,f)).length&&((p=[1,1]).push.apply(p,s(f[1],e.languages.javascript,"javascript")),f.splice.apply(f,p)),p=new e.Token("interpolation",f,r.alias,g),f=m.substring(h+i.length),g=[],l&&g.push(l),g.push(p),f&&(t(m=[f]),g.push.apply(g,m)),"string"==typeof y?(n.splice.apply(n,[a,1].concat(g)),a+=g.length-1):y.content=g)):(h=y.content,Array.isArray(h)?t(h):t([h]))}}(l),new e.Token(i,l,"language-"+i,t)}e.languages.javascript["template-string"]=[i("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),i("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),i("svg",/\bsvg/.source),i("markdown",/\b(?:markdown|md)/.source),i("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),i("sql",/\bsql/.source),t].filter(Boolean);var c={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function u(e){return"string"==typeof e?e:Array.isArray(e)?e.map(u).join(""):u(e.content)}e.hooks.add("after-tokenize",(function(t){t.language in c&&function t(n){for(var r=0,o=n.length;r ]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(A),function(e){var t=e.languages.javascript,n=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,r="(@(?:arg|argument|param|property)\\s+(?:"+n+"\\s+)?)";e.languages.jsdoc=e.languages.extend("javadoclike",{parameter:{pattern:RegExp(r+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(r+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:t,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?: \s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/ /g,(function(){return n}))),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+n),lookbehind:!0,inside:{string:t.string,number:t.number,boolean:t.boolean,keyword:e.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:t,alias:"language-javascript"}}}}),e.languages.javadoclike.addSupport("javascript",e.languages.jsdoc)}(A),function(e){e.languages.flow=e.languages.extend("javascript",{}),e.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),e.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete e.languages.flow.parameter,e.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(e.languages.flow.keyword)||(e.languages.flow.keyword=[e.languages.flow.keyword]),e.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})}(A),A.languages.n4js=A.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),A.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),A.languages.n4jsd=A.languages.n4js,function(e){function t(e,t){return RegExp(e.replace(/ /g,(function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source})),t)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:t(/(\bimport\b\s*)(?: (?:\s*,\s*(?:\*\s*as\s+ |\{[^{}]*\}))?|\*\s*as\s+ |\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(/(\bexport\b\s*)(?:\*(?:\s*as\s+ )?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:t(/(\.\s*)#? /.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],r=0;r *\.{3}(?:[^{}]| )*\})/.source;function a(e,t){return e=e.replace(/ /g,(function(){return n})).replace(//g,(function(){return r})).replace(/ /g,(function(){return o})),RegExp(e,t)}function i(t){for(var n=[],r=0;r "!==o.content[o.content.length-1].content&&n.push({tagName:s(o.content[0].content[1]),openedBraces:0}):0 +(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+| ))?|