hypnagaga/docs/assets/Theme-d43f33ce.js
Jon McClure c420ce15b4 docs
2023-09-19 08:31:54 +01:00

3 lines
2.8 KiB
JavaScript

import{S as j,i as w,s as v,l as O,o as p,h as f,j as d,b as A,k as T,u as B,q as C,r as S,t as q,a as K,f as V}from"./index-22a9b7f9.js";import{l as z,d as E}from"./light-59dc4e88.js";function P(e){return e&&e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}const b=e=>e.replace(/[^a-z0-9-]/gi,"");function D(e){const s="-",n={};function t(c,o,i=1){Object.keys(c).forEach(function(a){const r=c[a],l=Array.isArray(r),u=Object.prototype.toString.call(r),g=P(r),k=u==="[object Object]"||u==="[object Array]",h=o?o+s+b(a):b(a);if(!l&&!g&&k&&Object.keys(r).length)return t(r,h,i+1);n[h]=r})}return t(e),n}function y(e){return e&&typeof e=="object"&&!Array.isArray(e)}function m(e,...s){if(!s.length)return e;const n=s.shift();if(y(e)&&y(n))for(const t in n)y(n[t])?(e[t]||Object.assign(e,{[t]:{}}),m(e[t],n[t])):Object.assign(e,{[t]:n[t]});return m(e,...s)}function F(e){let s,n,t;const c=e[5].default,o=O(c,e,e[4],null);return{c(){s=p("div"),n=p("div"),o&&o.c(),f(n,"class","theme-client-override"),d(n,"display","contents"),f(s,"class","theme"),f(s,"style",e[0]),d(s,"display","contents")},m(i,a){A(i,s,a),T(s,n),o&&o.m(n,null),t=!0},p(i,[a]){o&&o.p&&(!t||a&16)&&B(o,c,i,i[4],t?S(c,i[4],a,null):C(i[4]),null),(!t||a&1)&&f(s,"style",i[0]),a&1&&d(s,"display","contents")},i(i){t||(q(o,i),t=!0)},o(i){K(o,i),t=!1},d(i){i&&V(s),o&&o.d(i)}}}const _={light:z,dark:E};function G(e,s,n){let t,c,{$$slots:o={},$$scope:i}=s,{theme:a={}}=s,{base:r="light"}=s;return e.$$set=l=>{"theme"in l&&n(1,a=l.theme),"base"in l&&n(2,r=l.base),"$$scope"in l&&n(4,i=l.$$scope)},e.$$.update=()=>{e.$$.dirty&6&&n(3,t=m({},_[r]||_.light,a)),e.$$.dirty&8&&n(0,c=Object.entries(D({theme:t})).map(([l,u])=>`--${l}: ${u};`).join(" "))},[c,a,r,t,i,o]}class H extends j{constructor(s){super(),w(this,s,G,F,v,{theme:1,base:2})}}H.__docgen={version:3,name:"Theme.svelte",data:[{keywords:[{name:"type",description:"{{ light, dark }}"}],visibility:"public",description:"Pre-made themes you can import.",name:"themes",kind:"const",static:!0,readonly:!0,type:{kind:"type",text:"{ light, dark }",type:"{ light, dark }"}},{keywords:[],visibility:"public",description:`Custom theme object. Can be a partial theme with just
what you want to change.`,name:"theme",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"object",type:"object"}},{keywords:[],visibility:"public",description:"Base theme is one of `light` or `dark` and will be merged\nwith your custom theme to fill in any values you don't\nexplicitly set.",name:"base",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:"light"}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[{keywords:[],visibility:"public",description:"Themed content",name:"default"}],refs:[]};export{H as T,_ as t};
//# sourceMappingURL=Theme-d43f33ce.js.map