{"mappings":"AAAA,SAAS,qBAAqB;AAC9B,cAAc,iBAAiC;AAI/C,OAAO,cAAM,oBAAoB,cAAc;AAE/C,eAAe;KAIV,gBAAgB,YAAY;CAAE,aAAa;;AAEhD,OAAO,iBAAS,YAAY,eAAe,eAAU;AAIrD,OAAO,iBAAS,eAAe,mBAAmB;AAMlD,OAAO,cAAMA,eAAe;CAC1B,gBAAgB;CAChB,QAAQ;CACR,SAAS;CACT,OAAO;CACP,QAAQ;CACR,WAAW;CACX,WAAW;CACX,YAAY;CACZ,YAAY;CACZ,mBAAmB;CACnB,mBAAmB;CACnB,OAAO","names":["cssGlobalVars: {\n  backgroundClip: CSSResult_Var;\n  active: CSSResult_Var;\n  passive: CSSResult_Var;\n  input: CSSResult_Var;\n  radius: CSSResult_Var;\n  ringWidth: CSSResult_Var;\n  ringColor: CSSResult_Var;\n  background: CSSResult_Var;\n  foreground: CSSResult_Var;\n  primaryBackground: CSSResult_Var;\n  primaryForeground: CSSResult_Var;\n  muted: CSSResult_Var;\n}"],"sources":["../../../src/internal/global-style.ts"],"sourcesContent":["import { GodownElement } from \"@godown/element\";\nimport { type CSSResult, css, unsafeCSS } from \"lit\";\nimport { resetStyle } from \"./reset-style.js\";\nimport { trim } from \"sharekit\";\n\nexport class GlobalStyle extends GodownElement {}\n\nexport default GlobalStyle;\n\nconst cssvar = trim(GlobalStyle.godownConfig.prefix, \"-\");\n\ntype CSSResult_Var = CSSResult & { toVar: () => CSSResult };\n\nexport function scopePrefix(scope: string, len = 1): CSSResult_Var {\n  return variablePrefix(cssvar + \"-\".repeat(len) + scope);\n}\n\nexport function variablePrefix(variable: string): CSSResult_Var {\n  const v = unsafeCSS(`--${variable}`) as CSSResult_Var;\n  v.toVar = () => unsafeCSS(`var(${v})`);\n  return v;\n}\n\nexport const cssGlobalVars: {\n  backgroundClip: CSSResult_Var;\n  active: CSSResult_Var;\n  passive: CSSResult_Var;\n  input: CSSResult_Var;\n  radius: CSSResult_Var;\n  ringWidth: CSSResult_Var;\n  ringColor: CSSResult_Var;\n  background: CSSResult_Var;\n  foreground: CSSResult_Var;\n  primaryBackground: CSSResult_Var;\n  primaryForeground: CSSResult_Var;\n  muted: CSSResult_Var;\n} = {\n  background: scopePrefix(\"background\", 2),\n  foreground: scopePrefix(\"foreground\", 2),\n  backgroundClip: scopePrefix(\"background-clip\", 2),\n  primaryBackground: scopePrefix(\"primary\", 2),\n  primaryForeground: scopePrefix(\"primary-foreground\", 2),\n  muted: scopePrefix(\"muted\", 2),\n  active: scopePrefix(\"active\", 2),\n  passive: scopePrefix(\"passive\", 2),\n  input: scopePrefix(\"input\", 2),\n  radius: scopePrefix(\"radius\", 2),\n  ringWidth: scopePrefix(\"ring-width\", 2),\n  ringColor: scopePrefix(\"ring-color\", 2),\n};\n\nGlobalStyle.styles = [\n  resetStyle,\n  css`\n    @supports (color: light-dark(#fff, #000)) {\n      :host {\n        ${cssGlobalVars.background}: light-dark(hsl(0 0% 96%), hsl(0 0% 4%));\n        ${cssGlobalVars.foreground}: light-dark(hsl(0 0% 4%), hsl(0 0% 96%));\n        ${cssGlobalVars.muted}: light-dark(hsl(0 0% 88%), hsl(0 0% 18%));\n      }\n    }\n    @supports not (color: light-dark(#fff, #000)) {\n      :host {\n        ${cssGlobalVars.background}: hsl(0 0% 4%);\n        ${cssGlobalVars.foreground}: hsl(0 0% 96%);\n        ${cssGlobalVars.muted}: hsl(0 0% 18%);\n      }\n    }\n  `,\n  css`\n    :host {\n      ${cssGlobalVars.primaryBackground}: ${cssGlobalVars.foreground.toVar()};\n      ${cssGlobalVars.primaryForeground}:${cssGlobalVars.background.toVar()};\n      ${cssGlobalVars.active}: ${cssGlobalVars.primaryBackground.toVar()};\n      ${cssGlobalVars.passive}: ${cssGlobalVars.muted.toVar()};\n      ${cssGlobalVars.ringColor}: ${cssGlobalVars.passive.toVar()};\n      ${cssGlobalVars.ringWidth}: .1em;\n      ${cssGlobalVars.radius}: .25em;\n      ${cssGlobalVars.backgroundClip}: linear-gradient(to bottom, ${cssGlobalVars.foreground.toVar()}, ${cssGlobalVars.muted.toVar()});\n    }\n  `,\n  css`\n    :host([contents]) {\n      display: contents;\n    }\n\n    [part=\"root\"] {\n      width: 100%;\n      height: 100%;\n    }\n\n    :host([contents]) [part=\"root\"] {\n      height: inherit;\n      width: inherit;\n    }\n\n    :where(:host([contents]) [part=\"root\"]) {\n      all: inherit;\n      display: revert;\n    }\n  `,\n  css`\n    :host {\n      border-radius: ${cssGlobalVars.radius.toVar()};\n      border-style: none;\n      outline-style: none;\n    }\n  `,\n];\n"],"version":3,"file":"global-style.d.ts"}