hypnagaga/docs/assets/Theme-30eff4b8.js
2023-06-10 20:17:38 +01:00

3 lines
3.9 KiB
JavaScript

import{S as v,i as w,s as j,q as O,w as b,x as m,C as d,a as C,z as A,u as M,r as T,v as x,b as z,t as B,d as K}from"./index-25af778d.js";const S={colour:{background:"#2e3440","text-primary":"#ffffff","text-secondary":"rgb(255 255 255 / 60%)",accent:" #ef3c2a","brand-logo":"#ffffff","brand-rules":"rgb(255 255 255 / 25%)","brand-shadow":"rgb(255 255 255 / 10%)"},font:{"size-base":"1.375","family-serif":"freight-book, serif","family-sans-serif":"Knowledge, sans-serif","family-monospace":'Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',"family-hed":"var(--theme-font-family-sans-serif)","family-subhed":"var(--theme-font-family-sans-serif)","family-body":"var(--theme-font-family-serif)","family-note":"var(--theme-font-family-sans-serif)"}},q={colour:{background:"#ffffff","text-primary":"#404040","text-secondary":"#666666",accent:" #fa6400","brand-logo":"#fa6400","brand-rules":"#d0d0d0","brand-shadow":"rgb(64 64 64 / 80%)"},font:{"size-base":"1.375","family-serif":"freight-book, serif","family-sans-serif":"Knowledge, sans-serif","family-monospace":'Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',"family-hed":"var(--theme-font-family-sans-serif)","family-subhed":"var(--theme-font-family-sans-serif)","family-body":"var(--theme-font-family-serif)","family-note":"var(--theme-font-family-sans-serif)"}};function L(e){return e&&e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}const p=e=>e.replace(/[^a-z0-9-]/gi,"");function N(e){const s="-",n={};function t(l,a,i=1){Object.keys(l).forEach(function(o){const r=l[o],f=Array.isArray(r),c=Object.prototype.toString.call(r),_=L(r),k=c==="[object Object]"||c==="[object Array]",h=a?a+s+p(o):p(o);if(!f&&!_&&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 u(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]:{}}),u(e[t],n[t])):Object.assign(e,{[t]:n[t]});return u(e,...s)}function V(e){let s,n,t;const l=e[5].default,a=O(l,e,e[4],null);return{c(){s=b("div"),n=b("div"),a&&a.c(),m(n,"class","theme-client-override"),d(n,"display","contents"),m(s,"class","theme"),m(s,"style",e[0]),d(s,"display","contents")},m(i,o){C(i,s,o),A(s,n),a&&a.m(n,null),t=!0},p(i,[o]){a&&a.p&&(!t||o&16)&&M(a,l,i,i[4],t?x(l,i[4],o,null):T(i[4]),null),(!t||o&1)&&m(s,"style",i[0]),o&1&&d(s,"display","contents")},i(i){t||(z(a,i),t=!0)},o(i){B(a,i),t=!1},d(i){i&&K(s),a&&a.d(i)}}}const g={light:q,dark:S};function E(e,s,n){let t,l,{$$slots:a={},$$scope:i}=s,{theme:o={}}=s,{base:r="light"}=s;return e.$$set=f=>{"theme"in f&&n(1,o=f.theme),"base"in f&&n(2,r=f.base),"$$scope"in f&&n(4,i=f.$$scope)},e.$$.update=()=>{e.$$.dirty&6&&n(3,t=u({},g[r]||g.light,o)),e.$$.dirty&8&&n(0,l=Object.entries(N({theme:t})).map(([f,c])=>`--${f}: ${c};`).join(" "))},[l,o,r,t,i,a]}class P extends v{constructor(s){super(),w(this,s,E,V,j,{theme:1,base:2})}}P.__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{P as T,g as t};
//# sourceMappingURL=Theme-30eff4b8.js.map